50 Common Linux Console Commands You Should Learn By Heart

Posted by R. MAK. 14 October, 2008

We have listed below 50 commonly used Linux / Unix commands that we think every geek should learn by heart. These commands are vital for your complete access to Shells and Consoles.  Print them out. Hang them near your monitor. Practice them. Only constant practice will let you retain the usage and utility of all these console commands. Enjoy the list.

RJ45 with Patch cable

  1. clear: Clears the terminal window
  2. ls directory: List contents of a directory
  3. cat filename: Displays the contents of a file in the terminal
  4. rm filename: Removes a file
  5. cp sourcefile detstinationfilename: Copies a file
  6. passwd: Changes password
  7. motd: Message of the Day
  8. finger username: User information lookup program
  9. startx: Starts an X Window System server
  10. less filename or more filename: Displays the contents of a file in the terminal one page at a time
  11. info: Displays information and documentation on shells, utilities and programs
  12. lpr filename: Sends file to printer
  13. grep string filename: looks through files for strings
  14. head filename: Displays first 10 lines of file
  15. tail filename: Displays last 10 lines of file
  16. mv existingfilename newfilename: Moves or renames file
  17. file filename: Displays information about file contents
  18. echo string: Copies string to terminal
  19. date: Displays current date and time
  20. cal: Displays calendar
  21. gzip filename: Compresses a file
  22. gunzip filename: Decompresses a compressed file
  23. which command: Displays path to command
  24. whereis command: Displays paths to locations of commands
  25. who: Lists currently logged on users
  26. finger username@hostname: Obtains detailed information about a user currently using the system
  27. w: Lists currently logged on users with processing usage
  28. mesg y/n: Sets options for letting other users write you messages
  29. write user: Sends message to other users
  30. talk user: Allows two way chat to other users
  31. chmod permissions filename: Changes file access permissions
  32. mkdir directoryname: Makes a directory
  33. rmdir directoryname: Removes an empty directory
  34. ln existingfile new-link: Creates link to an existing file (hard link)
  35. df: Displays all mounted filesystems
  36. top: Displays updating list of currently running processes
  37. tty: Displays the name of the terminal in which the command was issued
  38. kill PID or %job number: Aborts a process by PID (Process Identification Number) or job number
  39. jobs: Displays a list of current jobs
  40. netstat: Displays network connections
  41. traceroute host: Prints the route packets take to the host
  42. nslookup: Queries Internet domain name servers
  43. hostname: Displays system identity name
  44. rlogin host: Utility to connect to a remote system
  45. telnet host: Utility to connect to a remote system (similar to rlogin but more interactive)
  46. rcp file remotemachine: Used to copy from a remote computer
  47. ftp: Utility to transfer files between systems on a network
  48. rsh command: Utility to run a command on a remote system without logging in
  49. ping host: Utility used to test connection to a remote system
  50. lcd directorypath: Changes local machine directory while logged on to remote machine

In order to practice the commands above, a free Linux shell account comes very handy. We have compiled a list of free shell account providers here.

A good Telnet / SSH client like PuTTY is also very useful to access Linux/Unix servers across the network.

Have a great day!

People who liked this Post also read

You might also be interested in



Link to this article from your site or blog. Just copy and paste following code:


Categories : Tips & Tricks Tags : , , , , , , ,

Comments

October 14, 2008

motd is useless. I used it once in a class and once when a sysadmin mentioned that he put clever things up as motd. It is truly a utility that should be forgotton. Finger, talk/write/mesg, rcp? who uses that over scp?, cal over date?, startx? I mean if you’re meorizing commands you have x running on a virtual term nowadays. You shouldn’t be putting up obviously misleading guides. We need more DECENT sysadmins, so arm them correctly.

Posted by Jack9
October 14, 2008

rlogin/rsh ?

Those commands are dead. Use slogin/ssh.

rlogin/rsh should be turned off on any machine that is concerned about security. The same goes for NIS.

Posted by AJ
October 14, 2008

uhh… not to mention ‘man’… how exactly did you miss that?

Posted by jason
October 14, 2008

these are simple commands!!!

i need all commands of linux !!!

and i know u can !!!

paras wadhers last blog post..Apple’s Future

Posted by paras wadher
October 14, 2008

I have to agree that motd isn’t very useful. finger is no longer of much use, and can represent a security risk. Also, it’s mentioned at #8 and #26.

rlogin, rcp, and telnet are all outdated. Use ssh, scp, and just forget about telnet altogether - it’s a security hole.

Someone pointed out that you omitted man. info is about as good, but sometimes there are man pages when there isn’t an info page. I recommend using both.

Posted by Chiron
October 14, 2008

yeah, quite lame, do your homework, buddy.
it’s 2008

Posted by Takashi
October 15, 2008

I will still say nice work. Even though the post has generated a lot of harsh comment, it achieves at least one goal.

It has created an opportunity for newbies to learn what is useful, what is obsolete and what is now deemed risky!

Nice try. Just do more research. Cheers.

Naija Businesss last blog post..How To Receive Payment Online

Posted by Naija Business
October 16, 2008

Good for linux users!

Posted by web design company
October 18, 2008

The main biggy your are missing is ‘ps’ to view the process table (although you have kill?) - I myself must type ps -ef on average about 25 times a day.

Also there is ’su’ - to change user accounts which a sysadmin will use all the time.

Then there is lsof, nohup, sed and awk etc etc.

In the 15 years I hve worked with *nix - I have never used motd :) I will try it now.

Posted by luke
October 18, 2008

As others have suggested, this list is kind of weak. I would take out these commands: clear (easier to use keyboard shortcut ctrl-L)
motd, (rarely implemented and when it is it’s usually added to a user’s profile)
finger, rarely implemented (security issues)
mesg, write, talk (not much use for them these days but if you needed to send a message to users why not just use wall?)
who/w are redundant one or the other would suffice but i’d keep w personally
no need to remember gunzip really since the functionality is in gzip also w/ the -d option
rlogin,rsh,rcp,telnet (obsolete for quite a while no one in their right mind would use these anymore)

a couple i would add: fuser, lsof, find, xargs, mount, man(as someone else suggested), an editor (vi emacs nano etc), chown, reset, strings, split,tar, bzip2, and also a working knowledge of redirection <, <<, >>, |, etc.

i guess there are a lot of commands someone “should learn by heart” (didn’t even touch regex or scripting) but i guess it comes down to the level of proficiency they require.

Posted by Marcus
October 18, 2008

edit: << should be <<<

also i’d like to add pkill, pgrep, time, watch, and crontab to the list.

Posted by Marcus
October 18, 2008

It’s a very nice list - but as commented already, there are some commands that are long overdue and some other important ones missing.

It’s still something to bookmark, and poses a nice reference. I didn’t even know about “w”, only “who” - so I still learned a bit :-)

Posted by Mojah
October 25, 2008

It’s a very nice list - but as commented already, there are some commands that are long overdue and some other important ones missing.

It’s still something to bookmark, and poses a nice reference. I didn’t even know about “w”, only “who” - so I still learned a bit

Posted by Cam'doloz

Leave a comment

(required)

(required)