Skip to main content
Resources

A to Z Linux Commands

All the Linux commands that have been covered on LHB organized in alphabetical order.

Abhishek Prakash

There are numerous Linux commands out there. There are a subset of built-in shell commands like cd and then there are the ones from GNU coreutils like less. In addition to that there are additional CLI utilities like curl, wget etc.

On Linux Handbook, we have covered over 80 Linux commands with practical examples. This is a collection of all the Linux commands we have covered so far.

The commands have been organized in alphabetical order so that it is easy for you to find the commands from the index.

A

alias

The alias command is simply a way to reference another command. It can be used to avoid repetitive long typing of commands and shell lines and simplify work.

Linux Alias Command: Set, Create and Remove Aliases
Alias command in Linux saves a lot of your time and improves your efficiency. Learn how to use this command properly and see some of the common aliases I use.

at

The at command in Linux is used to schedule jobs that do not run on a regular schedule.

Schedule Jobs in Linux With ‘at’ Command
The at command in Linux can be used to schedule jobs that do not run on a regular schedule. Learn how to use the at command.

awk

The AWK command dates back to the early Unix days. Long back before Perl or Python came into existence, AWK was used in scripts for manipulating text. You can use it for writing relatively complex programs, but also because of the powerful one-liners you can write to solve issues with your data files.

AWK Tutorial: 25 Practical Examples of AWK Command in Linux
Wondering how to use AWK command in Linux? Here are 25 AWK command examples with proper explanation that will help you master the basics of AWK.

B

basename

The basename command in Linux prints the final component in a file path. This is particularly helpful in bash scripts where you want to extract the file name from the long file path.

Using Linux Basename Command in Bash Scripts [Examples]
The basename command in Linux prints the final component in a file path. Learn some practical examples of using basename command in bash scripts.

C

cal

Unix-like systems provide a handful of tools for dealing with dates and times. Cal is one such command that enables you to view calendar in the command line.

5 Examples of Cal Command in Linux
This quick tutorial shows you how to display calendar in Linux with cal command and some common examples of this command.

cat

cat is one of the most used commands in Linux. Intended for concatenating text, it is mainly used for displaying the contents of text files.

Cat Command in Linux: Essential and Advanced Examples
cat is one of the most used commands in Linux but do you really know the cat command? Learn the basics as well as advanced examples of cat command in Linux.

cd

The cd command is used to navigate between directories in Linux. It stands for ‘change directory’.

cd Command in Linux: 7 Practical Examples
Learn to use cd command to its full potential in Linux with these practical examples.

chgrp

chgrp command is used for changing the group of a file or directory in Linux.

5 Practical Examples of chgrp command in Linux
chgrp command is used for changing the group of a file or directory in Linux. This guide shows you how to use chgrp command in Linux with practical examples.

chmod

chmod stands for change mode. This command is used for changing the mode of access, i.e. the file permissions in Linux.

chmod 777 or 755? Learn to use chmod Command with Examples
This article will teach you how to change permissions in Linux with practical examples of chmod command.

chown

The chown command in Linux enables you to change the user and group ownership of a file or directory.

How to Use chown Command in Linux [6 Essential Examples]
The chown command in Linux enables you to change the user and group ownership of a file or directory. Learn to use chown with some practical examples.

cp

One of the commands that you must know in Linux is cp. It’s often called the copy command in Linux and it is actually short for copy and it does exactly as it name suggests: it copies.

Copy Command in Linux: 7 Practical Examples
cp command in Linux is used for copying files and directories. In this tutorial, you’ll learn some of the essential usages of the cp command.

cron

The crontab is used to automate all types of tasks on Linux systems. This is an especially important skill for aspiring system administrators to learn.

Crontab Explained in Linux [With Examples]
Learn the concept of crontab in Linux. See how you can set up cron jobs to automatically run scripts and command at predefined time.

curl

CURL is a tool for data transfer. The most popular use case for curl command is to download files from the web in Linux terminal.

Curl Command in Linux [21 Practical Examples]
Learn some essential and some pro tips and tricks about using the Curl command in Linux.

cut

The cut command is the canonical tool to remove “columns” from a text file. In this context, a “column” can be defined as a range of characters or bytes identified by their physical position on the line, or a range of fields delimited by a separator.

4 Essential and Practical Usage of Cut Command in Linux
The cut command in Linux allows removing data on each line of a file. Read this tutorial to know how to use it effectively to process text or CSV data file.

D

date

The date command gives you the current date and time of you Linux system. But it can do a lot more than that.

7 Examples of Date Command in Linux
The date command gives you the current date and time of you Linux system. But it can do a lot more than that. Check out these practical examples.

dd

The dd command in Linux is a powerful utility for copying and converting files. Its most popular use case is creating live Linux USB using Linux command line.

dd Command in Linux: 5 Real World Examples Explained
The dd command in Linux is a powerful utility for copying and converting files. This detailed article explains some of the practical examples of the dd command.

df

The df command is used for checking disk space in Linux.

Check Linux Disk Space with df Command [Useful Examples]
The df command is used for checking disk space in Linux. Learn some of the most common usage of the df command in Linux.

diff

When you need to compare two files containing similar text in Linux, using the diff command can make your task much easier. The command compares two files to suggest changes that would make the files identical. Great for finding that extra curly brace that broke your newly updated code.

How to Use the Diff Command in Linux [Output Explained]
The diff command is excellent for comparing two files in Linux terminal. But its output could see super complicated. We uncomplicate the things by explaining the diff command output.

dig

Dig command in Linux is commonly used for retrieving the DNS information of a remote server.

Dig Command in Linux Explained
Dig command in Linux is commonly used for retrieving the DNS information of a remote server. Learn how to use the dig command and understand its output.

dirname

The dirname command in Linux prints a file path with its final component removed. This basically gives you the directory path from the file path.

Using Linux Dirname Command in Bash Scripts [Examples]
The dirname command in Linux extracts the directory path from a file path. Learn some practical examples of using dirname command in bash scripts.

du

Knowing the size of a file is easy in Linux but it won't show the size of directories. The du command is used for checking the size of directory.

How to Find Size of Directory with du Command in Linux
The du command in Linux is used for checking the size of directory. Here are various ways you can find the size of directory in Linux with the du command.

E

echo

The echo command is perhaps one of the first few commands you see when you start learning Linux commands or bash shell scripting. It is a simple command that simply prints its arguments on the display.

echo Command in Linux [7 Practical Examples]
Learn to use the echo command in Linux with these simple but useful examples. The echo command is useful for displaying information in bash shell scripts.

emacs

There are many text-based editors in Linux. GNU Emacs is one of the oldest and powerful editor that has a steep learning curve.

Basic Emacs Command Explained in Detail
Struggling with Emacs? This detailed guide gives you enough information about Emacs commands so that you can start using Emacs editor smoothly.

expand

This is a rather less known and less used command with the main use case being the ability to convert tabs into spaces.

How to Convert Tabs to Spaces in Linux With Expand Command
This tutorial teaches you to convert the tabs into spaces in Linux command line from the programming perspective.

F

file

The file command gives you various information about a file in Linux. This includes the type of file, MIME type etc.

File Command in Linux: 5 Essential Examples
Here are various examples of the file command in Linux to determine the actual type of file and gather related information.

find

One of the frequent used commands. The find command can be used to looks for files based on their name, type, modification time and more. Combine it with the likes of exec or xargs command and you have a powerful tool at your hand for searching and modifying files.

15 Super Useful Examples of Find Command in Linux
Learn the super powerful and super useful find command with these practical examples.

findmnt

Another lesser know command which is used for checking if a file system is mounted.

Findmnt - Better Way of Finding Mounted Filesystems on Linux
Learn to use findmnt instead of mount for a more robust and customizable listing of mounted file systems.

fmt and fold

Both of these commands are used for formatting text so the lines will fit in the available space on the target device.

Format Text in Linux Terminal With Fold and FMT Commands
Formatting text so the lines will fit in the available space on the target device are not that easy when it comes to the terminal. Instead of breaking lines by hand you can use the POSIX fold utility and the GNU/BSD fmt command to reflow a text so lines will not exceed a given length.

free

If you would like to know the detailed information about the memory availability on your Linux system, the free command is a simple utility that makes it easy to find real time results for a variety of use cases.

Free Command in Linux: Explained With Examples
If you would like to know the detailed information about the memory availability on your Linux system, the free command is a simple utility that makes it easy to find real time results for a variety of use cases.

fsck

The fsck (file system check) command helps with a potentially corrupted filesystem. This utility is used for checking and (optionally) repairing the file system.

Check and Repair Filesystem Errors With fsck Command in Linux
Linux systems come with a command line utility fsck to check for file system errors. Learn how to use it.

G

grep

Find command works on file name. The grep command is used to find patterns inside file content.

10 Practical Grep Command Examples for Developers
The grep command is used to find patterns in files. This tutorial shows some of the most common grep command examples that would be specifically beneficial for software developers.

groupadd

The groupadd command in Linux creates new groups

How to Create Groups in Linux With Groupadd Command
The groupadd command in Linux creates new groups. Learn how to use groupadd command to add new groups in Linux.

groupdel

The groupdel command is perhaps the simplest command in Linux with virtually no options. It is used for deleting an existing group.

How to Delete Groups in Linux With groupdel Command
Learn how to delete a group in Linux using groupdel command. Also learn what to do with files owned by the deleted groups.

groupmod

You can modify group properties like group name and group ID with the groupmod command in Linux.

Modify Groups in Linux With groupmod Command
Learn how to modify group properties like group name and group ID with the groupmod command in Linux.

groups

This command helps you find the groups a Linux user belongs to in Linux command line.

How to Know The Groups of a Linux User
This quick tip teaches you how to find the groups a Linux user belongs to in Linux command line.

H

You can use the head command to print a specified number of lines from the beginning of the file.

Head Command in Linux [5 Essential Examples]
In this article, you will learn some essential examples of the head command in Linux.

history

Everything you type in the terminal is stored in the shell history. This aspect can be displayed and controlled through the history command.

Using History Command in Linux [Beginner’s Guide]
Everything you type in the terminal is stored in the shell history. Learn how to use command history in Linux in this introduction to history command.

I

id

Every user in Linux has a unique, numeric user ID and a default group with a unique numeric group ID. The id command prints this information.

id Command in Linux: 5 Practical Examples
Every user in Linux has a unique, numeric user ID and a default group with a unique numeric group ID. The id command prints this information.

J

jobs

The jobs command in Linux allows the user to directly interact with processes in the current shell.

How to Use Jobs Command in Linux
The jobs command in Linux allows the user to directly interact with processes in the current shell. Here’s how to use it.

L

less

Less is an awesome Linux command utility for viewing text files.

9 Practical Example of Less Command in Linux
Less is an awesome Linux command utility for viewing text files. Here are some essential less command examples to use it effectively.

ln

The ln command allows you to create both soft and hard links in Linux.

How to Use ln Command in Linux for Creating Soft & Hard Links
Links are one of the essential part of the Linux filesystem. Learn how to create links using ln command in this tutorial.

locate

The locate command allows you to preform a super quick search for files.

Quickly Find Files in Linux With Locate Command
The locate command allows you to preform a super quick search for files. In this tutorial, you’ll learn how locate command works and how to use it.

ls

The ls command in Linux is one of the most used commands. It is used for listing the contents of a directory.

ls Command in Linux: 17 Useful Examples Explained
The ls command in Linux is one of the most used commands. But most people don’t utilize its full potential. Check out the basics as well as advanced ls command examples in Linux.

lsof

You can list opened files by a user or a process by using the lsof command in Linux.

lsof Command in Linux: 7 Practical Examples
This article teaches you how to list opened files by a user or a process by using the lsof command in Linux.

M

mkdir

The mkdir command allows you to make new directories (folders in common term) in Linux.

mkdir command: Create New Directories in Linux
mkdir is one of the essential Linux commands that every Linux user should know. You can create new directories using mkdir.

mkfs

mkfs is the command line tool in Linux to format a disk or partition in a certain filesystem of your choice.

Using mkfs command in Linux to Format the Filesystem on a Disk or Partition
mkfs is the command line tool in Linux to format a disk or partition in a certain filesystem of your choice.

more

The more command in Linux opens a text file in page views. It's predecessor to the less command and not used a lot these days.

How to Use More Command in Linux to Read Large Text Files
Cat command output flooding your terminal screen? Learn to use more command in Linux to view large text files.

mv

mv command in Linux is used for moving and renaming files and directories.

mv Command Examples in Linux: Move Files and Directories
mv command in Linux is used for moving and renaming files and directories. In this tutorial, you’ll learn some of the essential usages of the mv command.

N

nc (netcat)

The core functionality of Netcat is allowing two computers to connect and share resources. It is a powerful and versatile network tool that is available for Linux, Mac, and Windows machines.

nc Command in Linux: 5 Practical Examples
Here are some practical examples you can follow to learn how the netcat command is used in Linux.

nohup

Nohup command in Linux enables you to run commands even after logging out.

Keep Commands Running After SSH Log Out With Nohup Linux Command
This article will show you how you can start a process and keep it running even after you have logged out using the nohup command.

nslookup

nslookup is one of the popular networking commands in Linux used for querying the Domain Name System (DNS) records.

nslookup Command in Linux: 7 Practical Examples
nslookup is one of the popular networking commands in Linux used for querying the Domain Name System (DNS) records. Learn how to use nslookup command.

P

passwd

The passwd command in Linux allows you to change user password, lock accounts, expire passwords and more.

Passwd command in Linux: 8 Practical Examples
The passwd command in Linux allows you to change user password, lock accounts, expire passwords and more. Learn how to use the passwd command with practical examples.

paste

The paste command merges several input files to produce a new delimited text file from them.

7 Essential and Practical Usage of Paste Command in Linux
Learn how to use the paste utility on practical examples to merge text files, and discover a couple of tricks and pitfalls of that command at the same time.

ping

Ping is mainly used to check if a remote host is reachable or not.

Linux Ping Command: 7 Practical Examples
Here are some of the most common usages of ping command in Linux along with their explanation.

printf

You may print simple outputs with echo command but that's not enough for complicated formatted outputs. printf allows a C styled formating of the output.

Bash printf Command Examples [Better Than Echo]
You may print simple outputs with echo command but that’s not enough for complicated formatted outputs.

ps

The ps command in Linux is used for getting information about running processes.

Essential Examples of the ps Command in Linux
The ps command in Linux is used for getting information about running processes. Here are some useful examples of the complicated and extensive ps command.

R

read

With read command, you can make your bash script interactive by accepting user inputs.

Linux Read Command: 6 Practical Examples
With read command, you can make your bash script interactive by accepting user inputs. Learn to use the read command in Linux with these practical examples.

reboot

Reboot performs the actions of the halt command (explained below), requiring that all processing stop. Then instead of triggering the ACPI signal, your system is restarted.

How to Reboot Linux From Command Line
Here are various ways to reboot a Linux system from the command line.

rename

Rename command can be used to rename multiple files in Linux at once.

Rename Multiple Files at Once in Linux with Rename Command
Rename command can be used to rename multiple files in Linux at once. Here are some practical scenarios in which you can use the rename command.

rm

The rm command is used for removing files and directories in Linux.

How to Remove Files and Directories in Linux Command Line
Learn how to delete files and remove directories with rm command in Linux.

rsync

Rsync (Remote Sync) is a synchronization tool for copying files and directories in a system or between systems. Its most popular use case includes copying files between remote systems.

15 Practical Examples of rsync Command in Linux
Wondering how to use rsync command? This article lists some of the essential usages of the rsync command in Linux.

S

scp

Scp stands for secure copy but I like to think it as 'SSH copy'. Like rsync, scp is also used for copying files between remote systems.

Using scp Command in Linux: 10 Practical Examples Explained
Here are some practical and essential scp command example to show how to securely copy files between remote Linux systems.

screen

The screen command in Linux allows you to use multiple virtual terminals that can be saved by name and reopened using keyboard shortcuts.

How to Use Linux Screen to Get Multiple Terminals
The screen command in Linux allows you to use multiple virtual terminals that can be saved by name and reopened using keyboard shortcuts. Here’s how to use it.

sed

Sed is part of the Unix standard toolbox since the end of the 60s. As any text editor, it will help you to modify text files.

Getting Started With SED Command [Beginner’s Guide]
Learn to use one of the most powerful commands of the Unix toolbox: sed, the stream editor with practical examples of SED commands.

seq

The seq command, short for sequence, is used for printing a sequence of numbers. The numbers could be integers or real (with decimal points).

Seq Command in Linux [Explained With Examples]
Print a sequence of numbers with specified increment or format with seq command.

sleep

Linux sleep command is one of the simplest commands out there. As you can guess from the name, its only function is to sleep. In other words, it introduces a delay for a specified time.

Bash Sleep Command Examples in Linux
This tutorial shows you how to use sleep commands and its various options in bash scripts.

source

The source command is a handy utility that can be used to refresh environment variables among some other things.

What is Source Command in Linux? How to Use it?
The source command is a handy utility that can be used to refresh environment variables among some other things.

stat

You can get file permissions, size, mtime, ctime, atime, ownership and several other file attribute information using the stat command in Linux.

Use Stat Command in Linux to Display File Attributes
You can get file permissions, size, mtime, ctime, atime, ownership and several other file attribute information using the stat command in Linux.

T

tail

The tail command prints the last ten lines of the input files. The tail command is also used for reading log files in real time.

5 Practical Examples of Tail Command in Linux
Learn the tail command syntax along with some practical examples of the tail command in Linux. This will also help you in monitoring the log files.

tar

Tar is one of the most common tool used for archiving files in Linux.

How to Create and Extract Tarballs in Linux Command Line
Tar is one of the most common tool used for archiving files in Linux. Learn how to create a tarball and how to extract it in the beginner’s tutorial.

tee

The tee command reads from the standard input and writes to both standard output and files. The result is that you get to see your command’s output as well as save it to a file at the same time.

Tee Command in Linux Explained with Examples
If you want to display the output of a command and save it to a file simultaneously, tee command is what you need. Learn various ways of using tee command in Linux.

time

The time command in Linux measures how long a particular command or script runs.

Check Command and Script Completion Time with Time Command
The time command in Linux measures how long a particular command or script runs. Learn how to use this command.

timeout

With the timeout command you can set a time limit on running other commands and programs.

Put a Timer on Running Commands With Timeout Command in Linux
With the timeout command you can set a time limit on running other commands and programs. If the program runs longer than the set limit, timeout kills it. Learn how to use it.

top

The top command provides a quick look at system resources and processes.

How to Use the Top Command as Task Manager in Linux
The top command provides a quick look at system resources and processes. You can also control it to use it as the task manager in Linux terminal.

touch

Touch command in Linux is used for changing file timestamps however one of the most common usages of touch command includes creating a new empty file.

Touch Command in Linux: 9 Useful Examples
Learn to use touch command in Linux with these useful and practical examples.

tr

The tr command in Linux is used to perform simple but useful translations of one set of characters into another.

tr Command in Linux: 6 Useful Examples
The tr command in Linux is used to perform simple but useful translations of one set of characters into another. Learn some practical examples of the tr command.

type

The type command tells you whether a Linux command is built-in shell command, where is its executable located and whether it is aliased to some other command.

Use Type Command in Linux to Get More Info About Commands
The type command tells you whether a Linux command is built-in shell command, where is its executable located and whether it is aliased to some other command. Here’s how to use the type command in Linux.

U

ulimit

Ulimit is a built-in shell command designed to display, allocate, and limit resources.

How to Use Ulimit Command in Linux [Control System Resource]
Ulimit is a built-in shell command designed to display, allocate, and limit resources. Learn how to use the ulimit command in Linux.

uname

You can get Linux kernel version and some other system information with the uname command in Linux.

Using uname command in Linux [Output Explained]
You can get Linux kernel version and some other system information with the uname command in Linux. Here’s how to use it.

uniq

The uniq command in Linux and Unix is used for removing duplicate lines from a file.

Uniq Command in Unix and Linux: 7 Essential Examples
The uniq command in Linux and Unix is used for removing duplicate lines from a file. Learn how to use uniq command with these examples.

useradd

The useradd command lets a superuser create a new user account on Linux.

How to Add New Users in Linux With Useradd Command
The useradd command lets a superuser create a new user account on Linux. Here’s how to use the useradd command with various options.

userdel

The userdel lets you delete an existing user.

How to Delete Users in Ubuntu Linux With Userdel Command
If you want to delete an existing user in Ubuntu or any other Linux distribution, you can use the userdel command in the terminal.

usermod

The usermod command in Linux allows you to modify a user account in various ways.

8 Essential Examples of Usermod Command in Linux
The usermod command in Linux allows you to modify a user account in various ways. Check out what settings you can modify in this tutorial.

V

vim

Vim is one of the most popular text editor in the Linux command line.

Basic Vim Commands Every Linux User Must Know [With PDF Cheat Sheet]
A comprehensive guide explaining basic vim commands that will be useful to any Linux user be it a sysadmin or a developer.

W

watch

Watch is a great utility that automatically refreshes data. Some of the more common uses for this command involve monitoring system processes or logs, but it can be used in combination with pipes for more versatility.

Watch Command in Linux: Essential Examples
Watch is a great utility that automatically refreshes data. Some of the more common uses for this command involve monitoring system processes or logs, but it can be used in combination with pipes for more versatility.

wc

The wc command displays statistical information about a file such as the number of lines, words, characters.

WC Command Examples: Count Number of Lines, Words & Characters
Some practical examples of wc command in Linux to count the number of lines, words and characters of a text file.

which

which command is an extremely useful command for locating executable files located anywhere in the Linux system.

Which Command in Linux [Explained with Examples]
Linux which command is an extremely useful command for locating executable files located anywhere in the Linux system. Learn how to use it.

who

The who command in Linux lists all logged-in users on the system.

How to Use Who Command in Linux
The who command in Linux lists all logged-in users on the system. Here’s how to use it to get various information about logged users.

This is all for the moment. I'll add more commands as they get featured here.

Abhishek Prakash