Monday, 29 April 2013

Essential Linux Commands- An A-Z of Linux

Newbie Commands

cd - Changes the current working directory to its parent, child or the directory specified in the address.
exit - Exits out of the current program, terminates the current command line terminal, or logs you out (from services like ssh and telnet).
kill - Terminates the specified running process. It is analogous to “End Process” in the Windows task manager.
ls - Lists all the contents of a specified directory. If no directory is specified, by default current directory will be used.
man - If you are stuck at any command and don't know how to utilize it, simply use man command followed by command name, and entire manual page regarding the specified command will appear on your screen.
pwd - This is Print Working Directory command which displays the current working directory for the command line terminal. Its is useful  you’ve lost track of where you are in your system.
reboot - Immediately stops all running processes, shuts down the system, then reboots.
shutdown - Stops all running processes and shuts down the system.
sudo - Runs commands as root (Highest User Level in Linux), it is analogous to "Run as Administrator" command in Windows.

System Information

date - Displays current system date and time. Specified parameters can change the format of the output.
df - Reports the disk space usage for the file system.
hostname - Prints the name of the current host system.
ps - Shows information about all the currently running processes on the system.
quota - Displays disk limits and current disk usage for a specified user. Useful when there are multiple users assigned to a particular system.
top - Displays all of the running processes in the system, by default sorted by CPU usage. It is analogous to "Task Manager" in Windows.
uptime - Reports how long the system has been running since last boot. Extremely useful for server applications.

File Manipulation

bzip2 - Compresses specified contents into a .bz2 archive or extracts from a .bz2 archive depending on parameters.
chmod / chown - Changes the access permissions of one or more files (chmod) or changes the ownership of a particular file to a new user (chown). Only users with permission or ownership of a file can change that file’s permissions or ownership.
cp - Copies files to a new location with a new name depending on the parameters. So as to copy a directory "-r" should be used to run the command recursively.
find / locate - Searches the system starting at a specific directory and matching all files within that location to a set of conditions laid out by the command parameters. Very useful for quickly finding certain files.
grep – Searches through all of the files in a specified location trying to find files that contain lines that match a given string. Returns a list of all the files that scored a match.
install - Used in conjunction with Makefiles to copy files from one location to the system. Not to be confused with installing packages from a software repository.
mkdir / rmdir - Creates a directory (mkdir) or deletes a specified directory (rmdir). Directories can only be created and deleted within directories that you have permission in.
mv - Moves files and directories from one location to another. It can also be used to rename files and directories by keeping their source and destination locations the same.
open – Opens a specified file using the default system application for files of its type.
rm - Removes files and removes directory. In order to delete a directory, you should use "-r" to run the command recursively.
tar - Creates a .tar archive or extracts from a .tar archive depending on specified parameters.
zip / unzip - Creates a .zip archive or extracts from a .zip archive depending on specified parameters.

Other Noteworthy Commands

apt-get – Advanced Packaging Tool. Use this command to install, remove, and configure software packages on your system. For a menu-based version, use aptitude command. 
ftp / sftp - Connects to a remote FTP server in order to download a bulk of files.
wget - Downloads files from the Internet from a specified URL to your system.
yum - Yellowdog Updater Modified. An open source package manager used to easily install software packages from repositories. Available on RPM-compatible Linux distributions.
nano - A newbie-friendly command-line text editor that uses keyboard shortcuts to simulate menus.
vim - Vim is the successor to Vi, both of which are command line text editors for Unix-like systems. Though Vim is popular, it doesn’t use menus or icons for its interface so it has a reputation for being newbie-friendly.

1 comment:

  1. Mandar sir..gud job..vry much useful info. for new linux user..keep going on..!!