Linux Commands
Linux Commands
Read
Courses
Video
Linux is a Unix-Like operating system. All the Linux/Unix commands are run in the terminal
provided by the Linux system. This terminal is just like the command prompt of Windows
OS. Linux/Unix commands are case-sensitive. The terminal can be used to accomplish all
Administrative tasks. This includes package installation, file manipulation, and user
management. Linux terminal is user-interactive. The terminal outputs the results of
commands which are specified by the user itself. Execution of typed command is done only
after you press the Enter key.
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T
| U | V | W | X | Y | Z
Commands Description
Used to check whether the calling program has access to a specified
access file. It can be used to check whether a file exists or not
Used to turn on or turn off the process for accounting or change info
accton process accounting file
aclocal Used to automatically generate aclocal.m4 files from configure.in file
acpi Used to display the battery status and other ACPI information
Tests whether ACPI (Advanced Configuration and Power Interface)
acpi_available subsystem is available or not
It provides intelligent power management on a system and is used to
acpid notify the user-space programs about the ACPI events
addr2line Used to convert addresses into file names and line numbers
It is a Linux version of getty, which is a Unix program running on a
host computer that manages physical or virtual terminals to allow
agetty multi-user access
Instructs the shell to replace one string with another string while
alias executing the commands
It is a command-line mixer for ALSA(Advanced Linux Sound
amixer Architecture) sound-card driver
It is a command-line audio player for ALSA(Advanced Linux Sound
aplay Architecture) sound card drivers.
Used to play standard MIDI(Musical Instrument Digital Interface)
files, by sending the content of a MIDI file to an ALSA(Advanced
aplaymidi Linux Sound Architecture) MIDI port
It helps the user when they don’t remember the exact command but
knows a few keywords related to the command that define its uses or
apropos functionality
Provides a high-level CLI (Command Line Interface) for the package
management system and is intended as an interface for the end user
which enables some options better suited for interactive usage by
default compared to more specialized APT tools like apt-cache and
apt apt-get
apt-get It is a command-line tool which helps in handling packages in Linux
Opens up a highly built-in interface to interact with the package
aptitude manager of the machine
ar Used to create, modify and extract the files from the archives
arch Used to print the computer architecture
It manipulates the System’s ARP cache. It also allows a complete
arp dump of the ARP cache
aspell Used as a spell checker in Linux
It is a job scheduler daemon that runs jobs scheduled for later
atd execution
Used to remove the specified jobs. To remove a job, its job number is
atrm passed in the command
atq It displays the list of pending jobs which are scheduled by the user
autoconf Used in Linux to generate configuration scripts
Used to create a template file of C “#define” or any other template
autoheader header for configure to use
Used for automatically generating Makefile.in files compliant with the
automake set GNU Coding Standards
Used to create automatically buildable source code for Unix-like
autoreconf systems
Used to update configure.in file in our Linux system to a newer
autoupdate Autoconf.
It is a scripting language used for manipulating data and generating
awk reports
banner Used to print the ASCII character string in large letter to standard output
It strips directory information and suffixes from file names i.e. it prints the
basename
file name NAME with any leading directory components removed
Used to read commands from standard input or a specified file and execute
batch them when system load levels permit i.e. when the load average drops below
1.5
A mail notification system for unix that notifies the user at the command line
biff
when new mail arrives and tells from whom it is
break Used to terminate the execution of for loop, while loop and until loop
Used to run a shell builtin, passing it arguments(args), and also to get the
builtin
exit status
It does not have to read the entire input file before starting, so with a large
bzless
file, it starts up faster
Used as a filter for CRT viewing of bzip2 compressed files, which are saved
bzmore
with .bz2 suffix
case It is the best alternative when we had to use multiple if/elif on a single variable
Reads data from file and gives their content as output. It helps us to create, view,
cat
concatenate files
cc It is used to compile the C language codes and create executables
chage Used to view and change the user password expiry information
It is a file system command which is used for changing the attributes of a file in
chattr
a directory
It allows you to change a user’s name and other details easily. chfn stands for
chfn
Change finger
chkconfig Used to list all available services and view or update their run level settings
chvt Used to switch between the different TTY (TeleTYpewriter) terminals available
Used to display a CRC(Cyclic Redundancy Check) value, the byte size of the
cksum
file and the name of the file to standard output
Used to compare the two files byte by byte and helps you to find out whether the
cmp
two files are identical or not
It is used to filter out reverse line feeds. The col utility simply reads from the
col
standard input and writes to standard output
Used to format the text processor output so that it can be viewed on Cathode
colcrt
Ray Tube displays
Compares two sorted files line by line and write to standard output; the lines that
comm
are common and the lines that are unique
Used to reduce the file size. After compression, the file will be available with an
compress
added .Z extension
continue Used to skip the current iteration in for, while and until loop
cpio stands for “copy in, copy out“. It is used for processing the archive files
cpio
like *.cpio or *.tar. This command can copy files to and from archives
csplit Used to split any file into many parts as required by the user
It allows quick access across the files (For example quickly seeing definition of
ctags
a function)
curl A tool to transfer data to or from a server, using any of the supported protocols
For cutting out the sections from each line of files and writing the result to
cut
standard output
Used to store the history of a file. Whenever a file gets corrupted or anything
cvs
goes wrong “cvs” help us to go back to the previous version and restore our file
Used to display the system date and time. It is also used to set date and time of
date
the system
Used to declare shell variables and functions, set their attributes and display
declare
their values
Used to display information related to file systems about total space and
df
available space
diff Used to display the differences in the files by comparing the files line by line
Used to remove the trailing forward slahes “/” from the NAME and prints the
dirname
remaining portion
dmesg Used to examine the kernel ring buffer and print the message buffer of
Set the Hostname: Open terminal and enter the following command in order to
change the hostname.
sudo hostname your_hostname
Replace “your_hostname” with the hostname that you want to keep.
Setting up the time zone: Move to /usr/share/zoneinfo/your_zone and then link
the zone file with /etc/localtime to set the time zone.
sudo ln -sf Kolkata /etc/localtime
File System and Management
Managing files is the most important task in Linux as all devices, directories, and
packages are just a type of file in Linux.
1. To know about File system read the article File System in Linux.
2. To learn more about Linux file hierarchy structure you can read the article Linux
File System Hierarchy
3. To get the difference between Linux and Windows File System read the
article Windows vs Linux
Below is the list of some file management commands in Linux:
Command Description
You can also read the file management in Linux from the
article https://www.geeksforgeeks.org/file-management-in-linux/
Networking Commands
Command Description
Used to send some packets to a server and receive them back in case of a good
ping
network connection.
Used for querying the Domain Name System to obtain domain name or IP
nslookup
address mapping, or other DNS records.
Used to view and change the configuration of the network interfaces on your
ifconfig
system
tracepath Used to traces path to destination discovering MTU along this path
Command Description
telnet Used to test if a port is open and even to work with telnet protocol.
Used to securely copy files and directories between two locations over a
scp
network.
used for performing any operation in Linux related to TCP, UDP, or UNIX-
netcat
domain sockets
Used for monitoring network connections both incoming and outgoing as well
netstat
as viewing routing tables, interface statistics, etc
To learn more about Linux networking commands then read the article Linux
Networking Tools
Managing Users and Group in Linux
A system administrator has to manage the users working on the system. Users are
the accounts which are logged in to your system or may log in to the system. Each
user in Linux has a unique UID to identify the user. All information of the users is
stored in /etc/passwd file and all hashed passwords are stored in /etc/shadow file.
There are basically 2 types of user in Linux on the basis of their rights to access.
Superuser or Administrator
General users
Each user may or may not be a part of a group which is a collection of users. To
learn more about users in Linux go through the article Users in Linux System
Administration. Here is a list of commands that are used to manage users.
Command Description
su and sudo Used to change the user and work with root
To learn more about how to manage users read the article User Management in
Linux
To learn more about how to manage groups read the article Group Management in
Linux
Command Description
Used to get information about processes, memory, paging, block IO, disk, and
vmstat
CPU scheduling
A good system Administrator must have an idea of how to read and manage logs
as they give a lot of crucial and required information.
Command Description
tail Used to print details from the log files located in the folder /var/log
Whether you're preparing for your first job interview or aiming to upskill in this ever-
evolving tech landscape, GeeksforGeeks Courses are your key to success. We
provide top-quality content at affordable prices, all geared towards accelerating
your growth in a time-bound manner. Join the millions we've already empowered,
and we're here to do the same for you. Don't miss out - check it out now!
Looking for a place to share your ideas, learn, and connect? Our Community portal
is just the spot! Come join us and see what all the buzz is about!