01 November 2012

Best 50 cool commands that every Linux Geek should Know..

If you are a Linux Lover and you want to become a Linux Geek then there are some commands which help you to build up your basics in Linux. I have divided them into some categories so that you can use them accordingly.I am just here to give you a small Ubuntu Linux training.

Note: All these commands are tested. It doesn't cause any harm to your computer. Just use them properly to avoid any inconvenience.

Beginners Commands
  1. reset - It will clears all the lines displaying in you terminal and gives you an fresh start.
  2. uname- It will give you detail of the current version,installed on,configuration. Use uname -a to get all details.
  3. cd - It changes the current working directory in the command line console. E.g. cd Desktop
    will take you to the Desktop wherever you are. Use cd . . to go to previous directory.
  4. help - Gives you all the help needed for particular command.E.g. help cd.
  5. info - If help does not give you particular help than info will give you the info for it.E.g info man.
  6. exit - It exits you out of any current program and terminates the current command line terminal.
  7. kill - It terminates the specified running process. E.g. kill 1234 where 1234 is the pid of particular process. 
  8. ls - List all of the contents of a specified directory. If no directory is specified, it will use the current directory.Use ls -h to show all hidden files.
  9. man - It stands for manual, and it will give you the detailed info about the commands.E.g. man ls will give all info about ls. It can be used instead of help and info commands.
  10. pwd - Displays the current working directory from the terminal. It will help you when you are lost or don't know in which directory you are.
  11. reboot - Immediately stops all running processes, shuts down the system, then reboots.
  12. shutdown - Stops all running processes and shuts down the system.E.g use shutdown -h now to shut it down immediately or use shutdown -h 20:00 by which system will go to halt after 575 mts. 
  13. sudo - Runs commands as root which means doesn't require any permission.

System Info Commands

  1. du - It will give the file space usage of each file in you sytem. Use du -h
  2. free - It displays the amount of used and free memory. Use free -m to display usage in megabytes.
  3. df - It will give you the amount of disk space used by the system.Use df -h
  4. lsmod - It gives information of installed drivers. 
  5. dpkg - It will give details about installed software on your system. Use dpkg --list
  6. fdisk -  It gives all information about partition on disk. Use fdisk -l to get full detail.
  7. who - It gives information about the logged in users and what they are doing.
  8. date - It prints out the current system date and time.
  9. hostname - Displays the name of the current host system.
  10. ps - It displays information about all of the processes currently running on the system.use ps -A to get all running process.
  11. quota - It displays disk limits and current disk usage for a specified user. Useful when there are multiple users assigned to a particular system.On some systems it is not installed so don't be worried about it.E.g quota -V will give you the version installed.
  12. top -It displays all of the top processes in the system running on the CPU.
  13. uptime - It reports how long the system has been running since last boot which is very useful for servers.

File Related Commands

  1. cat- It is used to display the content of the file.
  2. bzip2 - Compresses specified contents into a .bz2 archive.Use bunzip filename to unzip the file.
  3. chmod- changes file acess permission. Use chmod [options][mode][file].E.g. chmod 454 calci.h 
  4. chown - changed file ownership or group.E.g chown shubham myfile.txt
  5. cp -It copies files/directories to a new location with a new name.Use as cp[option]..src dest.
    E.g. cp filename.txt newfilename.txt  OR cp filename.txt /root where root is the directory.
  6. find / locate - It searches for the file name specified. E.g. find myfile.txt
  7. grep – It searches through all files in a specified location. Also used to find files and sentences matched string.Use as grep [pattern] [filename].
  8. 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.
  9. mkdir / rmdir - It creates a directory (mkdir) or deletes a specified directory (rmdir). Directories can only be created and deleted within directories that you have permission in.\
  10. mv - Moves files and directories to another location. Can be used to rename files and directories by keep their source and destination locations the same.
  11. open – Opens a specified file using the default system application for files of its type.
  12. rm - It remove and remove directory. Used to delete files and directories from the system, whether one at a time or in batch.
  13. tar - Creates a .tar archive or extracts from a .tar archive depending on specified parameters.
  14. zip / unzip - Creates a .zip archive or extracts from a .zip archive depending on specified parameters.

Other Useful Commands

  1. passwd - It will change the password for current user.
  2. history - It prints recently used commands.
  3. apt-get – It is used to install,upgrade new software.E.g apt-get install vlc it will install vlc into your linux system.
  4. dhclient - Use to renew and release of IP address.Use dhclient -r to release and dhclient alone to renew.
  5. ftp / sftp - It connects to a remote FTP server to download multiple files.
  6. wget - downloads files from the Internet at the specified URL to our system. Use wget -r wwwname l6 where -r is for recursive request and l6 for defining the level.
  7. yum - Stands for Yellowdog Updater, Modified. It is an open source package manager which is used to easily install software packages from repositories.Available for all Linux versions.
  8. emacs – It is one of the most well-known text editors on Unix based system.
  9. nano - Also one of the command-line text editor which uses keyboard shortcuts to simulate menus.E.g. nano myfilename.c
  10. vim - It's also a command line editor.It does not use menus,icon interfaces.

I hope you will find this post worthy. So Happy Linuxing..!!!