0% found this document useful (0 votes)
29 views

40+ Most Used Linux Terminal Commands

The document provides an overview of 40+ common Linux terminal commands organized into categories including file management commands, system management commands, and more. Some key commands summarized are: - ls and cd for navigating and viewing files in directories - cat, cp, mv, rm for viewing, copying, moving, and deleting files - apt-get/apt-cache for installing, searching, and managing packages - bg/fg for sending jobs between foreground and background processes - history, man, and whatis for viewing command history, manuals, and descriptions

Uploaded by

Aniket Jain
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views

40+ Most Used Linux Terminal Commands

The document provides an overview of 40+ common Linux terminal commands organized into categories including file management commands, system management commands, and more. Some key commands summarized are: - ls and cd for navigating and viewing files in directories - cat, cp, mv, rm for viewing, copying, moving, and deleting files - apt-get/apt-cache for installing, searching, and managing packages - bg/fg for sending jobs between foreground and background processes - history, man, and whatis for viewing command history, manuals, and descriptions

Uploaded by

Aniket Jain
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

19/03/2020 40+ Most Used Linux Terminal Commands

directories or get help on a command you don’t


PC & MOBILE LIFESTYLE
remember how to use.

&& — This one is so basic that it’s not even


technically a command. If you ever want to run
multiple commands in sequential order, just stick this
in between each one. For example, [command1] &&
[command2] will rst run [command1] then YouTube Channels Trivia (S1
immediately follow it with [command2]. You can chain
as many commands as you want.

! — Repeats a recently used command. Best to use it


in conjunction with the history command. You can
use !n to repeat the n-th command in history. You can
also use !-n to repeat the command that happened n
commands ago.

cd — Changes the current terminal directory. What Is Trivial Geeks? Show


Format and Rules
clear — Clears the terminal screen.

history — Displays a list of all recently used


commands. You can also cycle through recently used
commands by pressing the Up and Down arrow keys
in the terminal.

ls — Displays a list of all les in the current terminal


directory. You can modify it with parameters to
specify some other directory or to change the format Latest Deals
Best Free Pokemon Fan-Mad
of the list. Games
Learn How to
man — Displays a help page (from the manual) based
Draw Freebie
on your search query. Very useful for learning how to Bundle
use a command you don’t recognize or when you
forget the parameters for an infrequently used
command. If you’re ever confused, turn to man. The 2020 $
pwd — Displays the current terminal directory as an Premium Ethical $
absolute path.
Hacking

whatis — Displays brief descriptions of command line


programs. Think of it like a simpli ed version of man SlideHeap Slide
when you aren’t sure what a command does but don’t Templates:
need the full manual on how to use it. Professional Plan

StackSkills $
Unlimited:
Lifetime Access

https://www.makeuseof.com/tag/most-used-linux-terminal-commands/ 3/18
19/03/2020 40+ Most Used Linux Terminal Commands

PC & MOBILE LIFESTYLE

Image Credit: fatmawati achmad zaenuri via Shutterstock

File Management Commands


Most Linux distros come with a graphical desktop
environment, and no matter which desktop environment
you choose to use, you’ll be able to browse and manage
les in the same way you would on Windows or Mac — but
for complex tasks, it’s often easier and faster to use the
command line.
OJOS MATTE SCREEN GUAR
(5)
cat — When used on a single text le, it will display Rs. 399.00 (details + deliv
the contents of that le. When used on two or more
text les, it will display all of their contents in
sequential order. Use the redirection operator (“>“) to
combine multiple text les into one text le.

chmod/chown — The chmod command changes the


read, write, and execute permissions of a le while
the chown command changes the user and/or user
group that owns a le.

cp — Makes a copy of a le. By default, the copy


appears in the current terminal directory, but you can
also specify the destination directory as well.

nd — Searches a speci c directory (or your entire


system) to nd les that match a given set of criteria.
There are dozens of options, including lename,
letype, lesize, permissions, owners, date created,
date modi ed, etc.

grep — Searches a speci c le or set of les to see if


a given string of text exists, and if it does, tells you
where the text exists in those les. This command is
extremely exible (e.g. use wildcards to search all
les of a given type) and particularly useful for
programmers (to nd speci c lines of code).
https://www.makeuseof.com/tag/most-used-linux-terminal-commands/ 4/18
19/03/2020 40+ Most Used Linux Terminal Commands

locate — Searches the entire system for les or


PC & MOBILE LIFESTYLE
directories that match the search query, then outputs
the absolute paths for each match. By default, it only
searches in directories for which you have
permissions. This is the simplest and fastest way to
nd a le.

mkdir/rmdir — Creates or deletes a directory, by


default in the current terminal directory but a target
directory can be speci ed as well. When deleting, the
directory must be completely empty.

mv — Moves a le from one directory to another, and


you can specify a different name for the le in the
target directory. You can use this command to
rename a le by moving it to the same directory but
with a different lename.

nano/emacs/vim — The three main terminal text


editors that exist on nearly all Linux systems, ordered
by increasing complexity. Newbies should stick to
nano as both emacs and vim are wildly complex (and
wildly powerful).

rename — Changes the name of a le or a set of les.


Comes with a lot of interesting parameters, allowing
you to automatically rename a bunch of les
according to a pattern.

rm — Removes les. With a certain parameter, it can


be used to wipe the entire contents of a speci ed
directory. It can also be used to delete several les
that all match a certain lename pattern.

touch — Changes the date accessed or date modi ed


of the given le to right now.

wget — Downloads the le or page at the given web


URL.

zip/gzip/tar — Various formats for compressing and


decompressing le archives.

https://www.makeuseof.com/tag/most-used-linux-terminal-commands/ 5/18
19/03/2020 40+ Most Used Linux Terminal Commands

PC & MOBILE LIFESTYLE

Image Credit: isak55 via Shutterstock

System Management Commands


Again, most Linux distros provide a graphical way to
manage your system settings, but you may nd it easier
(and perhaps even more informative) to use these time-
tested commands instead. Indeed, these commands tend
to offer a lot more power in terms of what you can do.

apt — While apt isn’t a command in itself, there are


three commands that you must know to make full use
of APT: add-apt-repository (for locating third-
party packages), apt-get (for actually installing
packages), and apt-cache (for searching your
repositories).

If your distro doesn’t use APT, it may use YUM,


RPM, or some other alternative. Look into their
equivalent commands.

bg/fg — Sends a foreground job to run in the


background or a background job to run in the
foreground. For more on jobs, see the jobs
command.

df — Displays how much space is used and free on


your system.

free — Displays how much RAM is used and free on


your system.

ip — Displays useful network details such as your IP


address, network interfaces, bandwidth usage, and
more. Can also be used to con gure network-related
settings.

https://www.makeuseof.com/tag/most-used-linux-terminal-commands/ 6/18
19/03/2020 40+ Most Used Linux Terminal Commands

jobs — Displays all current jobs and their statuses. A


PC & MOBILE LIFESTYLE
job is just a representation of a running process or
group of processes.

kill/killall — You can use kill to end a process


according to its process ID (often used in conjunction
with the ps command) whereas you can use killall
to end all processes whose names match your query.

mount/umount — Attaches and detaches a separate


lesystem to your system’s main lesystem. Mostly
used to make external devices, like hard drives or
USB drives, interactable with your computer.

ps — Displays a list of currently running processes. By


default, it only lists processes started under your
current user, but parameters exist to nd and lter all
kinds of processes.

sudo/gksudo — Prepending sudo allows you to run


any command as superuser (e.g. sudo [command1]).
If you want to run a graphical program with superuser
privileges, use gksudo followed by the executable le
for the program.

top — Displays a list of currently running processes,


sorted by how much CPU each processes uses.
Unlike ps, this command regularly updates in real-
time. Basically a terminal equivalent to Task Manager.

uname — Displays core system information


depending on the parameters you use, such as kernel
name and version, machine hardware, and operating
system.

uptime — Displays time elapsed since last boot.

whereis — Finds the location of the executable le for


a given program.

whoami — Displays the current user name. Comes in


handy when you’re switching between users with the
su command and you lose track of who you are at the
moment.

Interested in running several commands at once? Take a


look at how you can multitask on the Linux terminal with
Screen.

https://www.makeuseof.com/tag/most-used-linux-terminal-commands/ 7/18
19/03/2020 40+ Most Used Linux Terminal Commands

How PC
to&Multitask
MOBILE on the Linux
LIFESTYLE

Terminal With Screen


Want to maximize your command line
productivity? GNU Screen makes it easy to run
multiple terminal sessions.

Read More

See Which Commands You Use the


Most
How do your own Linux terminal habits re ect these
commands? If you want a de nitive answer, it’s actually
quite simple to see your personal most-used commands,
and we can see what they are by using one of the
commands mentioned above:

history | awk '{print $2}' | sort | uniq -c

The pipe character (“|“) takes the output of the command


on its left and uses it as input for the command on its
right. This is basically a chain of commands that one-by-
one manipulate the output of the history command to
count how many times each command is used, then sorts
the list, then limits it to the top 10.

Pretty nifty, but loses accuracy every time you clear your
Bash cache.

For further reading, why not have a look at the


differences between Linux and Unix?

Unix vs. Linux: The Di erences


Between and Why It Matters
Before the creation of Linux, the computing
world was dominated by Unix. What's the
difference between Linux and Unix?

Read More

Explore more about: Linux, Terminal.

Af liate Disclosure: By buying the products we recommend, you help


keep the site alive. Read more.

https://www.makeuseof.com/tag/most-used-linux-terminal-commands/ 8/18

You might also like