An A-Z of Linux – 40 Essential Commands You Should Know

Ads by Google

linux commandsLinux is the oft-ignored third wheel to Windows and Mac. Yes, over the past decade, the open source operating system has gained a lot of traction, but it’s still a far cry from being considered popular. Yet though that may be true, Linux still earns new converts every day. Will you join them?

The learning curve of Linux is what deters most users from even trying it in the first place. It can be a traumatic experience having to go from a GUI-based operating system like Windows or Mac to one that requires command line fiddling. But if you can get over that initial hump of difficulty, you may find that Linux is surprisingly robust.

If you want a crash course on all that is Linux, we’ve got a great Linux newbie’s guide that will teach you all you need to know. For the rest of you who just want a brief overview of some important commands you ought to know, the following list is all you’ll need.

Newbie Commands

cd - Changes the current working directory in the command line console.

exit - Exits out of the current program, terminates the current command line terminal, or logs you out of a Unix network depending on the context.

kill - Terminates the specified running process. The Linux version of Windows’ “End Process” in the task manager.

Ads by Google

ls - List all of the contents of a specified directory. If no directory is specified, it will use the current directory.

man - There’s a running gag in the Linux community that man is the only command you need to know. It stands for manual, and it will give you detailed information on commands and aspects of Linux.

pwd - Displays the current working directory for the command line terminal. Good for when 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. Parameters can be specified to issue a delayed shutdown or a shutdown at a particular time.

sudo - Runs commands as root, which means no limitations due to permissions.

linux commands

System Information

date - Prints out the 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 - Displays the name of the current host system.

ps - Displays information about all of the processes currently running 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 top processes in the system, by default sorted by CPU usage.

uptime - Reports how long the system has been running since last boot. Extremely useful for servers.

basic linux commands

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. Can copy directories too, whether recursively (includes all subdirectories) or not.

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 to another location. Can be used to rename files and directories by keep their source and destination locations the same.

open – Opens a specified file using the default system application for files of its type.

rm - Remove and remove directory. Used to delete files and directories from the system, whether one at a time or in batch.

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.

linux commands

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. Available on Debian-based Linux distributions.

ftp / sftp - Connects to a remote FTP server in order to download multiple files.

wget - Downloads files from the Internet at the 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.

emacs – One of the most well-known text editors on Unix-like systems.

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.

Image Credits: Folder Via Shutterstock, System Via Shutterstock

Join live MakeUseOf Groups on Grouvi App Join live Groups on Grouvi
Master the Linux Command Line
Master the Linux Command Line
121 Members
Linux for New Switchers
Linux for New Switchers
101 Members
Best Linux Apps
Best Linux Apps
91 Members
Linux Distros Talk
Linux Distros Talk
77 Members
Comments (72)
  • Atif Hussain

    comprehensive solution for most of basic problems

  • Rigoberto Garcia

    Excelnet Joel. Share with my friends. Thanks…

  • Pwince Khan

    nice article

  • Skee

    hmm, I would add:
    ./configure make make install.
    su – username

  • Brandon Ragoo

    Linux is a beautiful, powerfull and amazing OS don’t get me wrong but I
    certinatelly dont think I am will to make the switch at this moment in
    life. You see when using Linux as a primary OS you definately have to learn
    the commands to use in he terminal as a technication or some other person in
    the field of IT. I mean sometimes I do consider taking the time to learn the
    commands but as a technication it definatelly affects me in a bad way. The
    more time I spend away from Microsoft using Linux I start to forget how to
    navigate through Windows inorder to use different features to solve problems.
    If I as a technication use forget how to navigate through Windows it will
    not make me look like a professional haveing to playaround with someones laptop
    inorder to find a certin feature or even worse if the customer has to remind me how to get to
    that feature. Trust me it happens after using Linux for even a short period of time.
    Besides that when a student goes to school to study any software the student
    is required to use will be made for Windows only most of the time, even if there
    is a version of the software available for Linux or Mac the teacher will be teacher
    will be teaching you to install and use it on Windows. For example we are using a
    program called WAMP in school to learn php programming, I tried installing
    that on Linux after the installing it in Windows and if u dont know any Linux
    commands it just pain to install the program. The teacher in school also
    diden’t know to install it in Mac when a student asked so I would not
    of even bothered asking him about installing it on Linux.
    My point is besides making the effort to learn the commands those are
    some other things you will have to take into consideration.
    Just to be clear I will say it from now I am not in any way bias towards
    Linux, in face when I heard about it for the first time I loved it,
    I installed Ubuntu, customized it and showed everyone in school how cool
    it was, when u use Linux for the first time u feel cool, but after some time
    when u gain the knowledge of why most ppl dont use it u understand it dosen’t
    make you cool. Anyone reading this is free to use Linux it has it advantages
    and disadvantages I just wanted to let you know why I choose not to use it
    despite the fact that I constiantely think about it at times.

    • Knut

      Sorry – but you are a novice to Linux.

      The “Commends” that are described above is “applications” that access the kernel to get things done. All applications are executed in a shell, usually The Bourne Again Shell – “/bin/bash”. Applications all have an exit value 0 or False or 1 or some error code or TRUE. Once you find a smart way you can write a “script” – where the result of one application may be fed into another, they can be done at the same time, after one another and you can branch according to what happens resulting in a new a “application” by just making it executable.

      Linux and MacOS is based on a pile of these script, press a button on a screen, and you may start one. Consider as if Windows .Net was just VBA – and you have it. Just that the basic structure on Linux is “C” – and “Regular Expressions”. Learn “awk” and “Perl” and study Bash – then you can play with “commends” and basic line-oriented applications. Then use Python to access your scripts through a graphical UI. Soon you will forget the “commands” on Linux – they are all in /bin, and described in the manual pages – type “man” a space and the command or standard application you want explained – like “ls”.

      “man” may be the most important “command”. All is organised according to strict system of rules, what goes where is not random. On Linux you have no use for these command shells, unless you make scripts. Use the graphical interface to configure Linux, find and install applications and get things done. I have consultants that really know Linux, they do not use “commands”, not even to comile and link the code – they use the graphical tools that run “make” and SCCS and the rest. Why should a novice user need to know? The only answer is that they are curious to see if the same exists on Linux and MacOS. Type “ls” and -a gives you also the hidden file, and -l the long variant where you can see that only you can read a file, you can hide it from “root” – everyone else. And you have to grant is “x” rights for it to be run as a script – so a jpeg file that is “x” may be malware. That simple.

Load 10 more
Affiliate Disclamer

This review may contain affiliate links, which pays us a small compensation if you do decide to make a purchase based on our recommendation. Our judgement is in no way biased, and our recommendations are always based on the merits of the items.

For more details, please read our disclosure.
Affiliate Disclamer

This review may contain affiliate links, which pays us a small compensation if you do decide to make a purchase based on our recommendation. Our judgement is in no way biased, and our recommendations are always based on the merits of the items.

For more details, please read our disclosure.
New comment

Please login to avoid entering captcha

Log In