Linux Commands

What Are The Most Important Linux Commands?

Working from a Linux command line is not always intuitive, especially since there are hundreds of different commands with a myriad of switches and flags to make things even more confusing. You certainly don't need to know all of them to make good use of your Linux system, but there is a certain set of indispensable tools with which you should be familiar.

We've covered a handful of commands in previous sections that let you work with the shell and your file system. The commands covered in this section will complement what you've learned and give you some essential tools to manage your Linux environment. (You'll also be able to use these commands on other Unix-based systems.) You'll pick up other important commands in the "Text Editors" and "Slicing and Dicing" sections but you should first master this starter set to build the skills that will help you perform common Linux tasks more easily.

If You Need Help, Ask the man

Assuming you can remember the right command for a particular job, it's tougher still to remember all the switches associated with that command. The man command (short for manual) will help you on both counts by displaying pages from online manuals and telling you which commands may be relevant to the task at hand.

Say you want to change your password, but you don't know the command to do it. You can use the man command plus the keyword flag, -k, to search by keyword password for relevant commands:

man -k password
passwd passwd (1) - change login password
pwck pwck (1m) - password/group file checkers
vipw vipw (1b) - edit the password file

You can probably deduce that passwd is the correct command. But before blindly issuing any Linux command, you should know the proper syntax and understand what the command might do to you first. Using man with a command name will display all you need to know (probably more) about a command. For example, entering

man passwd

will display

passwd(1) User Commands passwd(1)
passwd - change login password and attributes
passwd [ name ]
passwd [ -d | -l ] [ -f ] [ -n min ] [ -w warn ]
[ -x max ] name
passwd -s [ -a ]
passwd -s [ name ]

The passwd command changes the password or lists
attributes associated with the user's login name.

(The man command pauses after each screenful and waits for you to press the spacebar before continuing.) The word More at the bottom of each page indicates how much of the help has so far been displayed. The terms in square brackets are optional parameters (-d, -l, -f, for example); vertical bars indicate that the terms on either side are mutually exclusive--you can use only one at a time.

For more information on the man command, see the man manual.

Previous Lesson: Changing File Permissions
Next Lesson: Changing Your Password



Comments - most recent first
(Please feel free to answer questions posted by others!)

Manoj Kaushik     (21 Sep 2012, 23:18)

I want to install Nagios on my VM machine any body who can guide me step by step. Please Please
Manoj Kaushik     (21 Sep 2012, 23:14)
Its really very helpful for new comers like me. I don't think there is any other site for LINUx in such a simple and useful way.
<a href="">Forex Broker Comparison</a>     (04 Sep 2012, 12:08)
And so, dear friends, let me press that question upon you. Never mind you--and you are to choose with entire freedom--whether you wish to human weaknesses in the light of eternity.
myagana     (02 Aug 2012, 05:54)
wowowow you are so smart. i want to date you. :* :*
shefal     (02 Aug 2012, 05:49)
hi bob
Nagesh     (13 Apr 2012, 18:23)
I Am Looking for Linux Commands
Some Pdf or Books dowloading
sulley muntari     (13 Mar 2012, 06:22)
Please I am new to the Linux operation system and I would like you to assist me with the Linux commands and the way forward to the operating system.Thank you.
vicgnesh     (22 Feb 2012, 00:51)
hai dr bob... how can i install oracle10g in linux please help me sir
JAdhav Manisha     (19 Jan 2012, 11:55)
its nice to learn more.
Uttam     (03 Jan 2012, 07:28)
I have a software installed on unix and windows machines that has a licence.txt file in a specified location. this licence.txt file has a Valid until value. I want to run a script that runs on all the machines and checks the expiration date and sens a mail if it is expiring in a week. also i have a url where I could find the licence file. I want it to update this licence.txt file with the new information found in the url.
srikanthreddy     (25 Oct 2011, 06:52)
i will become a good programer on linux
what can i do for achiving my goal
shankar kamannavar     (14 Oct 2011, 03:25)
just i have completed diploma (E&C).now i am learning for linux please could you help me...
ramakrishnan     (29 Sep 2011, 10:23)
dear sir,

i need the linux administration command
Mike     (01 Jun 2011, 18:16)
dr. BOB, you'r a genius
can't thank you enough!
thank you, thank you, thank you *n
jitendra vishwkarma     (28 Apr 2011, 04:32)
hi friend please visit this site of increasing his Linux knowledge i always use this site for his knowledge
injesh     (28 Apr 2011, 04:28)
the Linux is such as global operating system and this site support it very much i always use this site for increasing his Linux knowledge.thanks for starting this site
vinodkumar     (06 Apr 2011, 03:59)
Actually i am facing problem with ES3(RHEL3) server. When i fire clustat -x command it does not retrieve the year detail for package transition. So i am looking for a command which can display transition year too. Please help!
vinodkumar     (06 Apr 2011, 03:56)
Hi Bob,

Is there any command which is equivalent to clustat -x? Kindly let me know.
jainesh     (03 Apr 2011, 01:30)
it is wonderful web site thanks fr providing such info
Robyn234     (31 Mar 2011, 16:43)
need to mamually setting up a new daemon & it need to run at level 5 & be the very last daemon to laod. How do I wrtie command to use a symbolic lik to the daemon
Sottya     (07 Mar 2011, 14:45)
specific row in of multiple files in a directory
patco     (01 Mar 2011, 06:27)
ganesan     (25 Feb 2011, 03:10)

search command is as windows search.
Roger     (07 Feb 2011, 03:10)
Thumps up doctor bob :)
Gene     (04 Feb 2011, 11:40)
Can the command line support wildcard or multiple variables? I would like to use the following command:
ausearch -sv no -ui >499 (or -ui 5*)
looking at the audit data and I want to look for success=no and the uid>499.
The >499 is not accepted as numerical. I have tried to enclose it with different brackets without any luck. I know I can grep the desired results, however the format does not stay as needed.
bemmo     (18 Jan 2011, 15:22)
Please can someone help me on how to write scrits
t3st1ng     (08 Jan 2011, 08:18)
how configure a proxy in text mode ?
Shiasue Chimchie     (18 Nov 2010, 15:22)
is there any way to download the required rpm's from a specified website and then install them at a machine having no internet access ( as we do in windows )........i am new to linux hence facing a huge problem...plzzzz help me out !!
Spiceyal     (12 Oct 2010, 15:16)
How would I log unauthorized remote attempts and email the admin after 3 unsuccessful attempts have been made?
praveen     (06 Oct 2010, 02:51)
this is a very nice site to vist and the topics are very understandble
Paul Ah Leung     (11 Sep 2010, 05:40)
My someone claim intellectual property, copyright or trade secret non-disclosure on any work released under the GNU/GPL License or Open Source
Prof Debashis Bandyopadhyay     (04 Sep 2010, 12:02)
Thanks Doctor Bob for creating such a useful site. Linux users should add this site in their web as favorite link to help others.
Charles     (27 Aug 2010, 18:02)
I cannot believe how many students want you and me to do their homework for them. I covered all the information in 10 hours learn enough to teach beginning students.
mutua     (24 Aug 2010, 02:13)
nice notes
feroz khan     (14 Aug 2010, 14:47)
Hi bob,I saw the above comments from different people and found that,You have got the easiest way to explain the commands, I am new to linux and try to learn myself before joining any institute,
Linux Tutorial with commands
Linux Basics with commands
Linux Files
I need linux tutorials with basic commands so that I can have good command over linux as I am making it as My career.
gabe     (05 Aug 2010, 22:45)
what is the number next to the command? what does it mean?
gabe     (05 Aug 2010, 22:43)
i did the excercise but with ubuntu 10 i got than few lines of listing

~$ man -k password
chage (1) - change user password expiry information
chgpasswd (8) - update group passwords in batch mode
chpasswd (8) - update passwords in batch mode
cpgr (8) - copy with locking the given file to the password or gr...
cppw (8) - copy with locking the given file to the password or gr...
crypt (3) - password and data encryption
crypt_r (3) - password and data encryption
endpwent (3) - get password file entry
endspent (3) - get shadow password file entry
expiry (1) - check and enforce password expiration policy
fgetpwent (3) - get password file entry
fgetspent (3) - get shadow password file entry
fgetspent_r (3) - get shadow password file entry
getpass (3) - get a password
getpw (3) - Re-construct password line entry
getpwent (3) - get password file entry
getpwnam (3) - get password file entry
getpwnam_r (3) - get password file entry
getpwuid (3) - get password file entry
getpwuid_r (3) - get password file entry
getspent (3) - get shadow password file entry
getspent_r (3) - get shadow password file entry
getspnam (3) - get shadow password file entry
getspnam_r (3) - get shadow password file entry
gnome-keyring-daemon (1) - keep password and other secrets for users
Gnome2::PasswordDialog (3pm) - wrapper for GnomePasswordDialog
grpconv (8) - convert to and from shadow passwords and groups
grpunconv (8) - convert to and from shadow passwords and groups
lckpwdf (3) - get shadow password file entry
login.defs (5) - shadow password suite configuration
lppasswd (1) - add, change, or delete digest passwords.
pam_pwhistory (8) - PAM module to remember last passwords
pam_unix (8) - Module for traditional password authentication
passwd (1) - change user password
passwd (1ssl) - compute password hashes
passwd (5) - the password file
passwd2des (3) - RFS password encryption
putpwent (3) - write a password file entry
putspent (3) - get shadow password file entry
pwck (8) - verify integrity of password files
pwconv (8) - convert to and from shadow passwords and groups
pwunconv (8) - convert to and from shadow passwords and groups
setpwent (3) - get password file entry
setspent (3) - get shadow password file entry
sgetspent (3) - get shadow password file entry
sgetspent_r (3) - get shadow password file entry
shadow (5) - shadowed password file
shadowconfig (8) - toggle shadow passwords on and off
smbpasswd (5) - The Samba encrypted password file
smbpasswd (8) - change a user's SMB password
su-to-root (1) - A simple script to give an `interactive' front-end to ...
ulckpwdf (3) - get shadow password file entry
unix_chkpwd (8) - Helper binary that verifies the password of the curren...
unix_update (8) - Helper binary that updates the password of a given user
vigr (8) - edit the password, group, shadow-password or shadow-gr...
vipw (8) - edit the password, group, shadow-password or shadow-gr...
xcrypt (3) - RFS password encryption
xdecrypt (3) - RFS password encryption
xencrypt (3) - RFS password encryption
gub     (28 Jul 2010, 03:35)
great tips, thanks for info
takdog     (19 Jun 2010, 15:39)
hey bob,thankyou so much for the easiest linux tuts i can find on net.btw i'm watching teh world cup at the moment you know from south africa...and it seems to me that many of the comments here are originating from africans ,love yer replys....hilarious.thanks again from tasmania.
Bob Rankin     (28 May 2010, 13:17)
@sukhpreet - Sounds like a good place to start... why not?
sukhpreet     (28 May 2010, 10:01)
hi bob , i saw the above comments from difrent people and found that, u have got the easiest way to explain the commands, i am new to linux and try to learn myself before joining any institure,
so i can see on this page on left hand side, some topics that
Linux Tutorial
Linux Basics
Linux Files

so what do u suggest , should i start reading that topics to get good command overlinux
amit mathuriya     (27 May 2010, 04:40)
hi ..... this site very nice site and very easy site I always use this site.
hpal     (20 May 2010, 22:18)
Great Linux tip!
vishal kandharkar     (19 May 2010, 01:09)
its reallly help full for the beginners..........
Bob Rankin     (04 May 2010, 07:08)
Ooooh, and I need an oil change for my truck! Can we swap?
edgar     (03 May 2010, 03:58)
i need linux tutorials

thanks in advance
Bob Rankin     (23 Apr 2010, 07:09)
It's the TAB character.
Ben Bocalt     (22 Apr 2010, 22:16)
What does \t do in a BASH script?
Such as:
echo -e "$NAME\t$ADDRESS\t$PHONE" >> database
Debi     (13 Apr 2010, 13:54)
Know this should be a very easy answer, but cannot find the answer anywhere online. Sometimes when I run a command (not gedit or vi) the command prompt doesn't come back up. I have tried everything I can think of to get it back (quit, exit, esc, etc.). I end up shutting down and starting over, but that is a huge waste of time. Help!! Thanks!!
Henok Ephrem     (27 Mar 2010, 04:12)
still this operating system is not user friendly so please try to user friendly but the rest functionality is is best
Bob Rankin     (26 Mar 2010, 11:58)
@mauqista - I'll do your homework, but I charge a hefty hourly rate for that... :-)
mauqista williams     (26 Mar 2010, 09:15)
Create a text file that contains what is your absolute path, relative path and call it paths.txt

I'm new to Linux and I need help with this.
Kurt     (22 Mar 2010, 22:16)
To exit man use either q or CTRL-z
sri     (13 Mar 2010, 13:33)
i really liked the way you taught linux...i found it useful for a learner...
Bob Rankin     (03 Mar 2010, 08:33)
Are you posting a homework question here??? If so, it would have been easier to do a Google search for "TCP Port 22".
adah     (02 Mar 2010, 21:10)
your server log file shows repeated connections to TCP port 22. what is service is being accessed?
anurag nath     (21 Feb 2010, 02:41)
IT's a very good site for learning linux the fast and easy way !!! Bravo !!
Bob Rankin     (05 Feb 2010, 06:14)
@codjoe - Your wish is granted! Please begin reading the lessons on this site.

@kalai - Your question is too general. There are dozens of commands to read files from disk, depending on what you want to do with the data. See the Linux Commands section in the navbar here.
kalai     (05 Feb 2010, 04:53)
hi,how i ll retrive the file from hardisk and memory in linux,which command ll be use.plz help me
codjoe benjamin     (05 Feb 2010, 00:26)
hi, i will be much pleased if you could send me a beginners lesson on linux. i dont have any idea about it.
Ajeet kumar     (21 Jan 2010, 22:39)
Its really nice commands.......

I welcome your comments. However... I am puzzled by many people who say "Please send me the Linux tutorial." This website *is* your Linux Tutorial! Read everything here, learn all you can, ask questions if you like. But don't ask me to send what you already have. :-)

NO SPAM! If you post garbage, it will be deleted, and you will be banned.
Notify me about new comments on this page
Hide my email

Ask Bob Rankin - Free Tech Support

Copyright by - Privacy Policy
All rights reserved - Redistribution is allowed only with permission.

Popular Pages