---
title: "Introduction to Linux CLI"
lang: "en"
author: "Mohammad Abu Mattar"
canonical: https://mkabumattar.com/post/introduction-to-linux-cli
---

![Blog post image for Introduction to Linux CLI - Introduction to Linux command-line interface CLI, Linux is a Unix-like computer operating system assembled under the model of free and open-source software development and distribution.](/_astro/hero.Cojh86oN_Z2lnibN.webp)

[Home](/)›[Blog](/blog)›[All Categories](/blog/categories)›[Linux](/blog/categories/linux)

Blog

[Prev in LinuxHow to Install WordPress on Amazon Linux 2](/blog/post/how-to-install-wordpress-on-amazon-linux-2)[Next in LinuxVIM Cheat Sheet](/blog/post/vim-cheat-sheet)

[Linux](/blog/categories/linux)[Command Line Interface](/blog/categories/command-line-interface)[Operating Systems](/blog/categories/operating-systems)[System Administration](/blog/categories/system-administration)[Developer Tools](/blog/categories/developer-tools)

# Introduction to Linux CLI

[Mohammad Abu Mattar](/authors/mohammad-abu-mattar)Published: 19 Oct 2022Updated: 24 Aug 202651 Mins read53 Mins listen

[Markdown for AI(opens in a new tab)](/post/introduction-to-linux-cli/index.md "Open the plain-Markdown version of this page, for pasting into an AI tool")

TL;DR

Introduction to Linux command-line interface CLI, Linux is a Unix-like computer operating system assembled under the model of free and open-source software development and distribution.

Series

[Linux Essentials](/series/linux-essentials)1/1

All posts in this series (1)

Blog1

1.  [Introduction to Linux CLIYou are here](/blog/post/introduction-to-linux-cli)

### Introduction to Linux CLI

Contents

[Introduction](#introduction)[What is a Linux command?](#what-is-a-linux-command)[File management](#file-management)[`pwd`](#pwd)[\# `pwd` flags](#-pwd-flags)[`ls`](#ls)[\# `ls` flags](#-ls-flags)[`cd`](#cd)[`mkdir`](#mkdir)[\# `mkdir` flags](#-mkdir-flags)[`touch`](#touch)[\# `touch` flags](#-touch-flags)[`cp`](#cp)[\# `cp` flags](#-cp-flags)[`mv`](#mv)[\# `mv` flags](#-mv-flags)[`rm`](#rm)[\# `rm` flags](#-rm-flags)[`rmdir`](#rmdir)[\# `rmdir` flags](#-rmdir-flags)[`cat`](#cat)[\# `cat` flags](#-cat-flags)[`more`](#more)[\# `more` flags](#-more-flags)[`less`](#less)[\# `less` flags](#-less-flags)[`head`](#head)[\# `head` flags](#-head-flags)[`tail`](#tail)[\# `tail` flags](#-tail-flags)[Finding files and directories](#finding-files-and-directories)[`find`](#find)[\# `find` flags](#-find-flags)[`locate`](#locate)[\# `locate` flags](#-locate-flags)[`which`](#which)[\# `which` flags](#-which-flags)[`whereis`](#whereis)[\# `whereis` flags](#-whereis-flags)[Check user information](#check-user-information)[`whoami`](#whoami)[\# `whoami` flags](#-whoami-flags)[`who`](#who)[\# `who` flags](#-who-flags)[`w`](#w)[\# `w` flags](#-w-flags)[`id`](#id)[\# `id` flags](#-id-flags)[`groups`](#groups)[Managing users and groups](#managing-users-and-groups)[`useradd`](#useradd)[\# `useradd` flags](#-useradd-flags)[`userdel`](#userdel)[\# `userdel` flags](#-userdel-flags)[`usermod`](#usermod)[\# `usermod` flags](#-usermod-flags)[`passwd`](#passwd)[\# `passwd` flags](#-passwd-flags)[`groupadd`](#groupadd)[\# `groupadd` flags](#-groupadd-flags)[`groupdel`](#groupdel)[\# `groupdel` flags](#-groupdel-flags)[`groupmod`](#groupmod)[\# `groupmod` flags](#-groupmod-flags)[Managing permissions](#managing-permissions)[`chown`](#chown)[\# `chown` flags](#-chown-flags)[`chgrp`](#chgrp)[\# `chgrp` flags](#-chgrp-flags)[`chmod`](#chmod)[\# `chmod` flags](#-chmod-flags)[`newgrp`](#newgrp)[\# `newgrp` flags](#-newgrp-flags)[`setfacl`](#setfacl)[\# `setfacl` flags](#-setfacl-flags)[`umask`](#umask)[\# `umask` flags](#-umask-flags)[`getfacl`](#getfacl)[\# `getfacl` flags](#-getfacl-flags)[`chattr`](#chattr)[\# `chattr` flags](#-chattr-flags)[`lsattr`](#lsattr)[\# `lsattr` flags](#-lsattr-flags)[Check system information](#check-system-information)[`uptime`](#uptime)[\# `uptime` flags](#-uptime-flags)[`uname`](#uname)[\# `uname` flags](#-uname-flags)[`lscpu`](#lscpu)[\# `lscpu` flags](#-lscpu-flags)[`lspci`](#lspci)[\# `lspci` flags](#-lspci-flags)[`lsusb`](#lsusb)[\# `lsusb` flags](#-lsusb-flags)[`free`](#free)[\# `free` flags](#-free-flags)[Configure and troubleshoot the network](#configure-and-troubleshoot-the-network)[`ifconfig`](#ifconfig)[\# `ifconfig` flags](#-ifconfig-flags)[`ip`](#ip)[\# `ip` flags](#-ip-flags)[`netstat`](#netstat)[\# `netstat` flags](#-netstat-flags)[`route`](#route)[\# `route` flags](#-route-flags)[`ethtool`](#ethtool)[\# `ethtool` flags](#-ethtool-flags)[`tcpdump`](#tcpdump)[\# `tcpdump` flags](#-tcpdump-flags)[`ping`](#ping)[\# `ping` flags](#-ping-flags)[`traceroute`](#traceroute)[\# `traceroute` flags](#-traceroute-flags)[`dig`](#dig)[\# `dig` flags](#-dig-flags)[`nslookup`](#nslookup)[\# `nslookup` flags](#-nslookup-flags)[`host`](#host)[\# `host` flags](#-host-flags)[`drill`](#drill)[\# `drill` flags](#-drill-flags)[`ss`](#ss)[\# `ss` flags](#-ss-flags)[`wget`](#wget)[\# `wget` flags](#-wget-flags)[`curl`](#curl)[\# `curl` flags](#-curl-flags)[`nmap`](#nmap)[\# `nmap` flags](#-nmap-flags)[Manage system processes](#manage-system-processes)[`ps`](#ps)[\# `ps` flags](#-ps-flags)[`top`](#top)[\# `top` flags](#-top-flags)[`kill`](#kill)[\# `kill` flags](#-kill-flags)[`killall`](#killall)[\# `killall` flags](#-killall-flags)[`pkill`](#pkill)[\# `pkill` flags](#-pkill-flags)[`pgrep`](#pgrep)[\# `pgrep` flags](#-pgrep-flags)[`nice`](#nice)[\# `nice` flags](#-nice-flags)[`renice`](#renice)[\# `renice` flags](#-renice-flags)[`at`](#at)[\# `at` flags](#-at-flags)[`atq`](#atq)[\# `atq` flags](#-atq-flags)[`atrm`](#atrm)[\# `atrm` flags](#-atrm-flags)[`batch`](#batch)[\# `batch` flags](#-batch-flags)[`crontab`](#crontab)[\# `crontab` flags](#-crontab-flags)[`iostat`](#iostat)[\# `iostat` flags](#-iostat-flags)[`vmstat`](#vmstat)[\# `vmstat` flags](#-vmstat-flags)[`sar`](#sar)[\# `sar` flags](#-sar-flags)[Summary](#summary)[References](#references)

## [Introduction](#introduction)

The Linux operating system family is a group of free and open-source Unix systems. They consist of Red Hat, Arch Linux, Ubuntu, Debian, openSUSE, and Fedora. You must use a shell when using Linux, an application that allows you access to the system’s features. The majority of Linux distributions have a graphical user interface (GUI), which makes them user-friendly for beginners. I advise using the command-line interface (CLI), as it is speedier and gives you more control. By putting commands into the CLI, tasks that take many steps on the GUI may be completed in a matter of seconds.

## [What is a Linux command?](#what-is-a-linux-command)

An application or tool that runs on the CLI, a console that communicates with the system via text and processes, is known as a Linux command. It resembles Windows’ Command Prompt program in many ways. By hitting Enter at the end of the line, Linux commands are run on the terminal. You may use commands to carry out a range of operations, including managing users, installing packages, and manipulating files.

The general syntax of a Linux command is as follows:

**CommandName \[flag(s)\] \[parameter(s)\]**

-   **CommandName** is the name of the command you want to run.
-   **Flag(s)** are optional arguments that modify the behavior of the command.
-   **Parameter(s)** are required arguments that specify the command’s input.

Note

Remember that case affects the syntax of every Linux command.

## [File management](#file-management)

Every system administrator should be familiar with the very basic commands listed in this section. This collection of Linux commands for managing files is undoubtedly incomplete, but it can serve as a starting point and cover the majority of simple to complicated situations.

### [`pwd`](#pwd)

The `pwd` command is used to print the current working directory. The working directory is the directory you are currently in. The output of the `pwd` command is the path to the working directory.

Terminal window

```
1# Print the current working directory2pwd
```

#### [`pwd` flags](#pwd-flags)

-   `-L` - If the current working directory is a symbolic link, print the path of the symbolic link.
-   `-P` - If the current working directory is a symbolic link, print the path of the symbolic link’s target.

Terminal window

```
1# Print the current working directory2pwd -L3
4# Print the current working directory5pwd -P
```

### [`ls`](#ls)

The `ls` command lists a system’s files and directories. It will display the contents of the current working directory when run without a flag or argument.

Terminal window

```
1# List the contents of the current working directory2ls
```

#### [`ls` flags](#ls-flags)

-   `-a` - List all files, including hidden files.
-   `-l` - List files in long format.
-   `-h` - List files in human-readable format.
-   `-r` - List files in reverse order.
-   `-t` - List files by the time they were last modified.

Terminal window

```
1# List all files, including hidden files2ls -a3
4# List files in long format5ls -l6
7# List files in human-readable format8ls -h9
10# List files in reverse order11ls -r12
13# List files by the time they were last modified14ls -t
```

### [`cd`](#cd)

The `cd` command is used to change the current working directory. It takes a directory as an argument. The output of the `cd` command is the new working directory.

Terminal window

```
1# Change the current working directory to the home directory2cd ~
```

### [`mkdir`](#mkdir)

The `mkdir` command is used to create a new directory. It takes a directory name as an argument. The output of the `mkdir` command is the newly created directory.

Terminal window

```
1# Create a new directory named "new-directory"2mkdir new-directory
```

#### [`mkdir` flags](#mkdir-flags)

-   `-p` - Create parent directories as needed.

Terminal window

```
1# Create a new directory named "new-directory" and its parent directories2mkdir -p new-directory
```

### [`touch`](#touch)

The `touch` command is used to create a new file. It takes a file name as an argument. The output of the `touch` command is the newly created file.

Terminal window

```
1# Create a new file named "new-file"2touch new-file
```

#### [`touch` flags](#touch-flags)

-   `-a` - Change the access time of the file.
-   `-m` - Change the modification time of the file.
-   `-t` - Change the access and modification times of the file.

Terminal window

```
1# Change the access time of the file2touch -a new-file3
4# Change the modification time of the file5touch -m new-file6
7# Change the access and modification times of the file8touch -t new-file
```

### [`cp`](#cp)

The `cp` command is used to copy files and directories. It takes the source and destination as arguments. The output of the `cp` command is the copied file or directory.

Terminal window

```
1# Copy the file "file" to the directory "directory"2cp file directory
```

#### [`cp` flags](#cp-flags)

-   `-r` - Copy directories recursively.

Terminal window

```
1# Copy the directory "directory" to the directory "new-directory"2cp -r directory new-directory
```

### [`mv`](#mv)

The `mv` command is used to move files and directories. It takes the source and destination as arguments. The output of the `mv` command is the moved file or directory.

Terminal window

```
1# Move the file "file" to the directory "directory"2mv file directory
```

#### [`mv` flags](#mv-flags)

-   `-i` - Prompt before overwriting an existing file.
-   `-f` - Force the move of a file, even if it already exists.
-   `-u` - Move a file only if the source file is newer than the destination file.

Terminal window

```
1# Move the file "file" to the directory "directory" and prompt before overwriting an existing file2mv -i file directory3
4# Move the file "file" to the directory "directory" and force the move of a file, even if it already exists5mv -f file directory6
7# Move the file "file" to the directory "directory" and move a file only if the source file is newer than the destination file8mv -u file directory
```

### [`rm`](#rm)

The `rm` command is used to remove files and directories. It takes the file or directory as an argument. The output of the `rm` command is the removed file or directory.

Terminal window

```
1# Remove the file "file"2rm file
```

#### [`rm` flags](#rm-flags)

-   `-r` - Remove directories and their contents recursively.
-   `-f` - Force remove files without prompting for confirmation.

Terminal window

```
1# Remove the directory "directory" and its contents recursively2rm -r directory3
4# Remove the file "file" without prompting for confirmation5rm -f file
```

### [`rmdir`](#rmdir)

The `rmdir` command is used to remove empty directories. It takes the directory as an argument. The output of the `rmdir` command is the removed directory.

Terminal window

```
1# Remove the directory "directory"2rmdir directory
```

#### [`rmdir` flags](#rmdir-flags)

-   `-p` - Remove parent directories as needed.

Terminal window

```
1# Remove the directory "directory" and its parent directories2rmdir -p directory
```

### [`cat`](#cat)

The `cat` command is used to display the contents of a file. It takes a file as an argument. The output of the `cat` command is the contents of the specified file.

Terminal window

```
1# Display the contents of the file "file"2cat file
```

#### [`cat` flags](#cat-flags)

-   `-n` - Number all output lines.

Terminal window

```
1# Display the contents of the file "file" and number all output lines2cat -n file
```

### [`more`](#more)

The `more` command is used to display the contents of a file. It takes a file as an argument. The output of the `more` command is the contents of the specified file.

Terminal window

```
1# Display the contents of the file "file"2more file
```

#### [`more` flags](#more-flags)

-   `-d` - Display the contents of the file “file” and number all output lines.

Terminal window

```
1# Display the contents of the file "file" and number all output lines2more -d file
```

### [`less`](#less)

The `less` command is used to display the contents of a file. It takes a file as an argument. The output of the `less` command is the contents of the specified file.

Terminal window

```
1# Display the contents of the file "file"2less file
```

#### [`less` flags](#less-flags)

-   `-N` - Display the contents of the file “file” and number all output lines.

Terminal window

```
1# Display the contents of the file "file" and number all output lines2less -N file
```

### [`head`](#head)

The `head` command is used to display the first 10 lines of a file. It takes a file as an argument. The output of the `head` command is the first 10 lines of the specified file.

Terminal window

```
1# Display the first 10 lines of the file "file"2head file
```

#### [`head` flags](#head-flags)

-   `-n` - Display the first n lines of the file “file”.

Terminal window

```
1# Display the first 5 lines of the file "file"2head -n 5 file
```

### [`tail`](#tail)

The `tail` command is used to display the last 10 lines of a file. It takes a file as an argument. The output of the `tail` command is the last 10 lines of the specified file.

Terminal window

```
1# Display the last 10 lines of the file "file"2tail file
```

#### [`tail` flags](#tail-flags)

-   `-n` - Display the last n lines of the file “file”.

Terminal window

```
1# Display the last 5 lines of the file "file"2tail -n 5 file
```

## [Finding files and directories](#finding-files-and-directories)

The find command will be used the majority of the time to locate files and folders. But I also enjoy the which command since it provides the binary’s path, which is necessary on several occasions when we must run a binary with a complete PATH.

### [`find`](#find)

The `find` command is used to find files and directories. It takes a directory as an argument. The output of the `find` command is the files and directories that match the specified criteria.

Terminal window

```
1# Find all files and directories in the current directory2find .
```

#### [`find` flags](#find-flags)

-   `-name` - Find files and directories with the specified name.
-   `-type` - Find files and directories of the specified type.
-   `-size` - Find files and directories of the specified size.
-   `-mtime` - Find files and directories that have been modified in the specified number of days.
-   `-exec` - Execute the specified command on the found files and directories.

Terminal window

```
1# Find all files and directories in the current directory with the name "file"2find . -name file3
4# Find all files and directories in the current directory of the type "file"5find . -type file6
7# Find all files and directories in the current directory of the size "1M"8find . -size 1M9
10# Find all files and directories in the current directory that have been modified in the last 5 days11find . -mtime 512
13# Find all files and directories in the current directory with the name "file" and execute the command "ls" on them14find . -name file -exec ls {} \;
```

### [`locate`](#locate)

The `locate` command is used to find files and directories. It takes a file or directory name as an argument. The output of the `locate` command is the files and directories that match the specified criteria.

Terminal window

```
1# Find all files and directories in the current directory with the name "file"2locate file
```

#### [`locate` flags](#locate-flags)

-   `-i` - Find files and directories with the specified name, ignoring case.

Terminal window

```
1# Find all files and directories in the current directory with the name "file" ignoring case2locate -i file
```

### [`which`](#which)

The `which` command is used to find the location of a command. It takes a command as an argument. The output of the `which` command is the location of the specified command.

Terminal window

```
1# Find the location of the command "command"2which command
```

#### [`which` flags](#which-flags)

-   `-a` - Find all locations of the specified command.
-   `-s` - Find the location of the specified command and return a status code of 0 if the command is found and 1 if the command is not found.

Terminal window

```
1# Find all locations of the command "command"2which -a command3
4# Find the location of the command "command" and return a status code of 0 if the command is found and 1 if the command is not found5which -s command
```

### [`whereis`](#whereis)

The `whereis` command is used to find the location of a command. It takes a command as an argument. The output of the `whereis` command is the location of the specified command.

Terminal window

```
1# Find the location of the command "command"2whereis command
```

#### [`whereis` flags](#whereis-flags)

-   `-b` - Find the location of the specified command and return a status code of 0 if the command is found and 1 if the command is not found.

Terminal window

```
1# Find the location of the command "command" and return a status code of 0 if the command is found and 1 if the command is not found2whereis -b command
```

## [Check user information](#check-user-information)

These are a few of the commands we employ to verify the details of the most recent person to log in, as well as a few others to obtain further information regarding an existing user.

### [`whoami`](#whoami)

The `whoami` command is used to display the current user. It takes no arguments. The output of the `whoami` command is the current user.

Terminal window

```
1# Display the current user2whoami
```

#### [`whoami` flags](#whoami-flags)

-   `-u` - Display the current user and return a status code of 0 if the user is found and 1 if the user is not found.

Terminal window

```
1# Display the current user and return a status code of 0 if the user is found and 1 if the user is not found2whoami -u
```

### [`who`](#who)

The `who` command is used to display the current users. It takes no arguments. The output of the `who` command is the current users.

Terminal window

```
1# Display the current users2who
```

#### [`who` flags](#who-flags)

-   `-u` - Display the current users and return a status code of 0 if the users are found and 1 if the users are not found.

Terminal window

```
1# Display the current users and return a status code of 0 if the users are found and 1 if the users are not found2who -u
```

### [`w`](#w)

The `w` command is used to display the current users. It takes no arguments. The output of the `w` command is the current users.

Terminal window

```
1# Display the current users2w
```

#### [`w` flags](#w-flags)

-   `-u` - Display the current users and return a status code of 0 if the users are found and 1 if the users are not found.

Terminal window

```
1# Display the current users and return a status code of 0 if the users are found and 1 if the users are not found2w -u
```

### [`id`](#id)

The `id` command is used to display the current user. It takes no arguments. The output of the `id` command is the current user.

Terminal window

```
1# Display the current user2id
```

#### [`id` flags](#id-flags)

-   `-u` - Display the current user and return a status code of 0 if the user is found and 1 if the user is not found.

Terminal window

```
1# Display the current user and return a status code of 0 if the user is found and 1 if the user is not found2id -u
```

### [`groups`](#groups)

The `groups` command is used to display the current user’s groups. It takes no arguments. The output of the `groups` command is the current user’s groups.

Terminal window

```
1# Display the current user's groups2groups
```

## [Managing users and groups](#managing-users-and-groups)

These are some of the fundamental Linux commands for managing users, including adding, editing, and removing individuals or groups.

### [`useradd`](#useradd)

The `useradd` command is used to add a user. It takes a username as an argument. The output of the `useradd` command is the user that was added.

Terminal window

```
1# Add a user with the username "user"2useradd user
```

#### [`useradd` flags](#useradd-flags)

-   `-c` - Add a user with the specified comment.
-   `-d` - Add a user with the specified home directory.
-   `-g` - Add a user with the specified primary group.
-   `-G` - Add a user with the specified supplementary groups.
-   `-m` - Add a user with the specified home directory.
-   `-s` - Add a user with the specified shell.
-   `-u` - Add a user with the specified user ID.

Terminal window

```
1# Add a user with the username "user" and comment "comment"2useradd -c "comment" user3
4# Add a user with the username "user" and home directory "/home/user"5useradd -d /home/user user6
7# Add a user with the username "user" and primary group "group"8useradd -g group user9
10# Add a user with the username "user" and supplementary groups "group1", "group2", and "group3"11useradd -G group1,group2,group3 user12
13# Add a user with the username "user" and home directory "/home/user"14useradd -m /home/user user15
16# Add a user with the username "user" and shell "/bin/sh"17useradd -s /bin/sh user18
19# Add a user with the username "user" and user ID "1000"20useradd -u 1000 user
```

### [`userdel`](#userdel)

The `userdel` command is used to delete a user. It takes a username as an argument. The output of the `userdel` command is the user that was deleted.

Terminal window

```
1# Delete a user with the username "user"2userdel user
```

#### [`userdel` flags](#userdel-flags)

-   `-r` - Delete a user with the specified home directory.

Terminal window

```
1# Delete a user with the username "user" and home directory "/home/user"2userdel -r /home/user user
```

### [`usermod`](#usermod)

The `usermod` command is used to modify a user. It takes a username as an argument. The output of the `usermod` command is the user that was modified.

Terminal window

```
1# Modify a user with the username "user"2usermod user
```

#### [`usermod` flags](#usermod-flags)

-   `-c` - Modify a user with the specified comment.
-   `-d` - Modify a user with the specified home directory.
-   `-e` - Modify a user with the specified expiration date.
-   `-g` - Modify a user with the specified primary group.
-   `-G` - Modify a user with the specified supplementary groups.
-   `-l` - Modify a user with the specified username.
-   `-m` - Modify a user with the specified home directory.
-   `-s` - Modify a user with the specified shell.
-   `-u` - Modify a user with the specified user ID.

Terminal window

```
1# Modify a user with the username "user" and comment "comment"2usermod -c "comment" user3
4# Modify a user with the username "user" and home directory "/home/user"5usermod -d /home/user user6
7# Modify a user with the username "user" and expiration date "2023-01-01"8usermod -e 2023-01-01 user9
10# Modify a user with the username "user" and primary group "group"11usermod -g group user12
13# Modify a user with the username "user" and supplementary groups "group1", "group2", and "group3"14usermod -G group1,group2,group3 user15
16# Modify a user with the username "user" and username "user2"17usermod -l user2 user18
19# Modify a user with the username "user" and home directory "/home/user"20usermod -m /home/user user21
22# Modify a user with the username "user" and shell "/bin/sh"23usermod -s /bin/sh user24
25# Modify a user with the username "user" and user ID "1000"26usermod -u 1000 user
```

### [`passwd`](#passwd)

The `passwd` command is used to change a user’s password. It takes a username as an argument. The output of the `passwd` command is the user’s password that was changed.

Terminal window

```
1# Change a user's password with the username "user"2passwd user
```

#### [`passwd` flags](#passwd-flags)

-   `-d` - Change a user’s password with the specified username and delete the password.
-   `-e` - Change a user’s password with the specified username and expire the password.
-   `-l` - Change a user’s password with the specified username and lock the password.
-   `-u` - Change a user’s password with the specified username and unlock the password.

Terminal window

```
1# Change a user's password with the username "user" and delete the password2passwd -d user3
4# Change a user's password with the username "user" and expire the password5passwd -e user6
7# Change a user's password with the username "user" and lock the password8passwd -l user9
10# Change a user's password with the username "user" and unlock the password11passwd -u user
```

### [`groupadd`](#groupadd)

The `groupadd` command is used to add a group. It takes a group name as an argument. The output of the `groupadd` command is the group that was added.

Terminal window

```
1# Add a group with the group name "group"2groupadd group
```

#### [`groupadd` flags](#groupadd-flags)

-   `-g` - Add a group with the specified group ID.
-   `-r` - Add a group with the specified system group.
-   `-f` - Add a group with the specified force.

Terminal window

```
1# Add a group with the group name "group" and group ID "1000"2groupadd -g 1000 group3
4# Add a group with the group name "group" and system group5groupadd -r group6
7# Add a group with the group name "group" and force8groupadd -f group
```

### [`groupdel`](#groupdel)

The `groupdel` command is used to delete a group. It takes a group name as an argument. The output of the `groupdel` command is the group that was deleted.

Terminal window

```
1# Delete a group with the group name "group"2groupdel group
```

#### [`groupdel` flags](#groupdel-flags)

-   `-f` - Delete a group with the specified force.

Terminal window

```
1# Delete a group with the group name "group" and force2groupdel -f group
```

### [`groupmod`](#groupmod)

The `groupmod` command is used to modify a group. It takes a group name as an argument. The output of the `groupmod` command is the group that was modified.

Terminal window

```
1# Modify a group with the group name "group"2groupmod group
```

#### [`groupmod` flags](#groupmod-flags)

-   `-g` - Modify a group with the specified group ID.
-   `-n` - Modify a group with the specified group name.

Terminal window

```
1# Modify a group with the group name "group" and group ID "1000"2groupmod -g 1000 group3
4# Modify a group with the group name "group" and group name "group2"5groupmod -n group2 group
```

## [Managing permissions](#managing-permissions)

I have simply addressed the fundamental commands that we use to assign, change, and remove rights from files and directories because the topic of Linux permissions is rather broad.

### [`chown`](#chown)

The `chown` command is used to change the owner of a file or directory. It takes a username and a file or directory as arguments. The output of the `chown` command is the file or directory that was changed.

Terminal window

```
1# Change the owner of a file or directory with the username "user" and file or directory "/home/user/file"2chown user /home/user/file
```

#### [`chown` flags](#chown-flags)

-   `-R` - Change the owner of a file or directory with the specified recursive.
-   `-c` - Change the owner of a file or directory with the specified verbose.
-   `-f` - Change the owner of a file or directory with the specified force.
-   `-h` - Change the owner of a file or directory with the specified symbolic links.
-   `-v` - Change the owner of a file or directory with the specified verbose.

Terminal window

```
1# Change the owner of a file or directory with the username "user" and file or directory "/home/user/file" and recursive2chown -R user /home/user/file3
4# Change the owner of a file or directory with the username "user" and file or directory "/home/user/file" and verbose5chown -c user /home/user/file6
7# Change the owner of a file or directory with the username "user" and file or directory "/home/user/file" and force8chown -f user /home/user/file9
10# Change the owner of a file or directory with the username "user" and file or directory "/home/user/file" and symbolic links11chown -h user /home/user/file12
13# Change the owner of a file or directory with the username "user" and file or directory "/home/user/file" and verbose14chown -v user /home/user/file
```

### [`chgrp`](#chgrp)

The `chgrp` command is used to change the group of a file or directory. It takes a group name and a file or directory as arguments. The output of the `chgrp` command is the file or directory that was changed.

Terminal window

```
1# Change the group of a file or directory with the group name "group" and file or directory "/home/user/file"2chgrp group /home/user/file
```

#### [`chgrp` flags](#chgrp-flags)

-   `-R` - Change the group of a file or directory with the specified recursive.
-   `-c` - Change the group of a file or directory with the specified verbose.
-   `-f` - Change the group of a file or directory with the specified force.
-   `-h` - Change the group of a file or directory with the specified symbolic links.
-   `-v` - Change the group of a file or directory with the specified verbose.

Terminal window

```
1# Change the group of a file or directory with the group name "group" and file or directory "/home/user/file" and recursive2chgrp -R group /home/user/file3
4# Change the group of a file or directory with the group name "group" and file or directory "/home/user/file" and verbose5chgrp -c group /home/user/file6
7# Change the group of a file or directory with the group name "group" and file or directory "/home/user/file" and force8chgrp -f group /home/user/file9
10# Change the group of a file or directory with the group name "group" and file or directory "/home/user/file" and symbolic links11chgrp -h group /home/user/file12
13# Change the group of a file or directory with the group name "group" and file or directory "/home/user/file" and verbose14chgrp -v group /home/user/file
```

### [`chmod`](#chmod)

The `chmod` command is used to change the permissions of a file or directory. It takes a permission and a file or directory as arguments. The output of the `chmod` command is the file or directory that was changed.

Terminal window

```
1# Change the permissions of a file or directory with the permission "777" and file or directory "/home/user/file"2chmod 777 /home/user/file
```

  

Note

The `chmod` command can also be used to change the permissions of a file or directory using the symbolic notation. 777 is the same as `rwxrwxrwx`. The first character is for the owner, the second character is for the group, and the third character is for everyone else. 7 is the same as `rwx`. 6 is the same as `rw-`. 5 is the same as `r-x`. 4 is the same as `r--`. 3 is the same as `-wx`. 2 is the same as `-w-`. 1 is the same as `--x`. 0 is the same as `---`.

#### [`chmod` flags](#chmod-flags)

-   `-R` - Change the permissions of a file or directory with the specified recursive.
-   `-c` - Change the permissions of a file or directory with the specified verbose.
-   `-f` - Change the permissions of a file or directory with the specified force.
-   `-h` - Change the permissions of a file or directory with the specified symbolic links.
-   `-v` - Change the permissions of a file or directory with the specified verbose.

Terminal window

```
1# Change the permissions of a file or directory with the permission "777" and file or directory "/home/user/file" and recursive2chmod -R 777 /home/user/file3
4# Change the permissions of a file or directory with the permission "777" and file or directory "/home/user/file" and verbose5chmod -c 777 /home/user/file6
7# Change the permissions of a file or directory with the permission "777" and file or directory "/home/user/file" and force8chmod -f 777 /home/user/file9
10# Change the permissions of a file or directory with the permission "777" and file or directory "/home/user/file" and symbolic links11chmod -h 777 /home/user/file12
13# Change the permissions of a file or directory with the permission "777" and file or directory "/home/user/file" and verbose14chmod -v 777 /home/user/file
```

### [`newgrp`](#newgrp)

The `newgrp` command is used to change the group of the current user. It takes a group name as an argument. The output of the `newgrp` command is the group that was changed.

Terminal window

```
1# Change the group of the current user with the group name "group"2newgrp group
```

#### [`newgrp` flags](#newgrp-flags)

-   `-` - Change the group of the current user with the specified login shell.
-   `-l` - Change the group of the current user with the specified login shell.
-   `-s` - Change the group of the current user with the specified login shell.

Terminal window

```
1# Change the group of the current user with the group name "group" and login shell2newgrp - group3
4# Change the group of the current user with the group name "group" and login shell5newgrp -l group6
7# Change the group of the current user with the group name "group" and login shell8newgrp -s group
```

### [`setfacl`](#setfacl)

The `setfacl` command is used to set the access control list of a file or directory. It takes a file or directory as an argument. The output of the `setfacl` command is the file or directory that was changed.

Terminal window

```
1# Set the access control list of a file or directory with the file or directory "/home/user/file"2setfacl /home/user/file
```

#### [`setfacl` flags](#setfacl-flags)

-   `-m` - Set the access control list of a file or directory with the specified modify.
-   `-x` - Set the access control list of a file or directory with the specified remove.
-   `-b` - Set the access control list of a file or directory with the specified remove all.
-   `-k` - Set the access control list of a file or directory with the specified remove default.
-   `-R` - Set the access control list of a file or directory with the specified recursive.
-   `-c` - Set the access control list of a file or directory with the specified verbose.
-   `-f` - Set the access control list of a file or directory with the specified force.
-   `-h` - Set the access control list of a file or directory with the specified symbolic links.
-   `-v` - Set the access control list of a file or directory with the specified verbose.

Terminal window

```
1# Set the access control list of a file or directory with the file or directory "/home/user/file" and modify2setfacl -m /home/user/file3
4# Set the access control list of a file or directory with the file or directory "/home/user/file" and remove5setfacl -x /home/user/file6
7# Set the access control list of a file or directory with the file or directory "/home/user/file" and remove all8setfacl -b /home/user/file9
10# Set the access control list of a file or directory with the file or directory "/home/user/file" and remove default11setfacl -k /home/user/file12
13# Set the access control list of a file or directory with the file or directory "/home/user/file" and recursive14setfacl -R /home/user/file15
16# Set the access control list of a file or directory with the file or directory "/home/user/file" and verbose17setfacl -c /home/user/file18
19# Set the access control list of a file or directory with the file or directory "/home/user/file" and force20setfacl -f /home/user/file21
22# Set the access control list of a file or directory with the file or directory "/home/user/file" and symbolic links23setfacl -h /home/user/file24
25# Set the access control list of a file or directory with the file or directory "/home/user/file" and verbose26setfacl -v /home/user/file
```

### [`umask`](#umask)

The `umask` command is used to set the default permissions of a file or directory. It takes a permission as an argument. The output of the `umask` command is the permission that was changed.

Terminal window

```
1# Set the default permissions of a file or directory with the permission "777"2umask 777
```

#### [`umask` flags](#umask-flags)

-   `-S` - Set the default permissions of a file or directory with the specified symbolic notation.

Terminal window

```
1# Set the default permissions of a file or directory with the permission "777" and symbolic notation2umask -S 777
```

### [`getfacl`](#getfacl)

The `getfacl` command is used to get the access control list of a file or directory. It takes a file or directory as an argument. The output of the `getfacl` command is the access control list of the file or directory.

Terminal window

```
1# Get the access control list of a file or directory with the file or directory "/home/user/file"2getfacl /home/user/file
```

#### [`getfacl` flags](#getfacl-flags)

-   `-R` - Get the access control list of a file or directory with the specified recursive.
-   `-c` - Get the access control list of a file or directory with the specified verbose.
-   `-f` - Get the access control list of a file or directory with the specified force.
-   `-h` - Get the access control list of a file or directory with the specified symbolic links.
-   `-v` - Get the access control list of a file or directory with the specified verbose.

Terminal window

```
1# Get the access control list of a file or directory with the file or directory "/home/user/file" and recursive2getfacl -R /home/user/file3
4# Get the access control list of a file or directory with the file or directory "/home/user/file" and verbose5getfacl -c /home/user/file6
7# Get the access control list of a file or directory with the file or directory "/home/user/file" and force8getfacl -f /home/user/file9
10# Get the access control list of a file or directory with the file or directory "/home/user/file" and symbolic links11getfacl -h /home/user/file12
13# Get the access control list of a file or directory with the file or directory "/home/user/file" and verbose14getfacl -v /home/user/file
```

### [`chattr`](#chattr)

The `chattr` command is used to change the attributes of a file or directory. It takes a file or directory as an argument. The output of the `chattr` command is the file or directory that was changed.

Terminal window

```
1# Change the attributes of a file or directory with the file or directory "/home/user/file"2chattr /home/user/file
```

#### [`chattr` flags](#chattr-flags)

-   `-i` - Change the attributes of a file or directory with the specified immutable.
-   `-a` - Change the attributes of a file or directory with the specified append only.
-   `-A` - Change the attributes of a file or directory with the specified no append.
-   `-d` - Change the attributes of a file or directory with the specified no dump.
-   `-D` - Change the attributes of a file or directory with the specified dump.
-   `-e` - Change the attributes of a file or directory with the specified extent.
-   `-E` - Change the attributes of a file or directory with the specified no extent.
-   `-h` - Change the attributes of a file or directory with the specified no follow.
-   `-H` - Change the attributes of a file or directory with the specified follow.
-   `-j` - Change the attributes of a file or directory with the specified data journaling.
-   `-J` - Change the attributes of a file or directory with the specified no data journaling.
-   `-s` - Change the attributes of a file or directory with the specified secure deletion.
-   `-S` - Change the attributes of a file or directory with the specified no secure deletion.
-   `-t` - Change the attributes of a file or directory with the specified notail.
-   `-T` - Change the attributes of a file or directory with the specified tail.
-   `-u` - Change the attributes of a file or directory with the specified undelete.
-   `-U` - Change the attributes of a file or directory with the specified no undelete.
-   `-v` - Change the attributes of a file or directory with the specified verbose.

Terminal window

```
1# Change the attributes of a file or directory with the file or directory "/home/user/file" and immutable2chattr -i /home/user/file3
4# Change the attributes of a file or directory with the file or directory "/home/user/file" and append only5chattr -a /home/user/file6
7# Change the attributes of a file or directory with the file or directory "/home/user/file" and no append8chattr -A /home/user/file9
10# Change the attributes of a file or directory with the file or directory "/home/user/file" and no dump11chattr -d /home/user/file12
13# Change the attributes of a file or directory with the file or directory "/home/user/file" and dump14chattr -D /home/user/file15
16# Change the attributes of a file or directory with the file or directory "/home/user/file" and extent17chattr -e /home/user/file18
19# Change the attributes of a file or directory with the file or directory "/home/user/file" and no extent20chattr -E /home/user/file21
22# Change the attributes of a file or directory with the file or directory "/home/user/file" and no follow23chattr -h /home/user/file24
25# Change the attributes of a file or directory with the file or directory "/home/user/file" and follow26chattr -H /home/user/file27
28# Change the attributes of a file or directory with the file or directory "/home/user/file" and data journaling29chattr -j /home/user/file30
31# Change the attributes of a file or directory with the file or directory "/home/user/file" and no data journaling32chattr -J /home/user/file33
34# Change the attributes of a file or directory with the file or directory "/home/user/file" and secure deletion35chattr -s /home/user/file36
37# Change the attributes of a file or directory with the file or directory "/home/user/file" and no secure deletion38chattr -S /home/user/file39
40# Change the attributes of a file or directory with the file or directory "/home/user/file" and notail41chattr -t /home/user/file42
43# Change the attributes of a file or directory with the file or directory "/home/user/file" and tail44chattr -T /home/user/file45
46# Change the attributes of a file or directory with the file or directory "/home/user/file" and undelete47chattr -u /home/user/file48
49# Change the attributes of a file or directory with the file or directory "/home/user/file" and no undelete50chattr -U /home/user/file51
52# Change the attributes of a file or directory with the file or directory "/home/user/file" and verbose53chattr -v /home/user/file
```

### [`lsattr`](#lsattr)

The `lsattr` command is used to list the attributes of a file or directory. It takes a file or directory as an argument. The output of the `lsattr` command is the attributes of the file or directory.

Terminal window

```
1# List the attributes of a file or directory with the file or directory "/home/user/file"2lsattr /home/user/file
```

#### [`lsattr` flags](#lsattr-flags)

-   `-R` - List the attributes of a file or directory with the specified recursive.
-   `-a` - List the attributes of a file or directory with the specified all.
-   `-d` - List the attributes of a file or directory with the specified directory.
-   `-h` - List the attributes of a file or directory with the specified symbolic links.
-   `-l` - List the attributes of a file or directory with the specified long format.
-   `-v` - List the attributes of a file or directory with the specified verbose.

Terminal window

```
1# List the attributes of a file or directory with the file or directory "/home/user/file" and recursive2lsattr -R /home/user/file3
4# List the attributes of a file or directory with the file or directory "/home/user/file" and all5lsattr -a /home/user/file6
7# List the attributes of a file or directory with the file or directory "/home/user/file" and directory8lsattr -d /home/user/file9
10# List the attributes of a file or directory with the file or directory "/home/user/file" and symbolic links11lsattr -h /home/user/file12
13# List the attributes of a file or directory with the file or directory "/home/user/file" and long format14lsattr -l /home/user/file15
16# List the attributes of a file or directory with the file or directory "/home/user/file" and verbose17lsattr -v /home/user/file
```

## [Check system information](#check-system-information)

You must be acquainted with these commands if you want to be a system and Linux administrator. These, such as load, CPU model, hardware model, hardware type, etc., will assist you in identifying the sort of server you are using.

### [`uptime`](#uptime)

The `uptime` command is used to display the system uptime. It takes no arguments. The output of the `uptime` command is the system uptime.

Terminal window

```
1# Display the system uptime2uptime
```

#### [`uptime` flags](#uptime-flags)

-   `-p` - Display the system uptime with the specified pretty format.
-   `-s` - Display the system uptime with the specified since.
-   `-V` - Display the system uptime with the specified version.

Terminal window

```
1# Display the system uptime with the specified pretty format2uptime -p3
4# Display the system uptime with the specified since5uptime -s6
7# Display the system uptime with the specified version8uptime -V
```

### [`uname`](#uname)

The `uname` command is used to display the system information. It takes no arguments. The output of the `uname` command is the system information.

Terminal window

```
1# Display the system information2uname
```

#### [`uname` flags](#uname-flags)

-   `-a` - Display the system information with the specified all.
-   `-m` - Display the system information with the specified machine.
-   `-n` - Display the system information with the specified nodename.
-   `-r` - Display the system information with the specified kernel release.
-   `-s` - Display the system information with the specified kernel name.
-   `-v` - Display the system information with the specified kernel version.

Terminal window

```
1# Display the system information with the specified all2uname -a3
4# Display the system information with the specified machine5uname -m6
7# Display the system information with the specified nodename8uname -n9
10# Display the system information with the specified kernel release11uname -r12
13# Display the system information with the specified kernel name14uname -s15
16# Display the system information with the specified kernel version17uname -v
```

### [`lscpu`](#lscpu)

The `lscpu` command is used to display the CPU information. It takes no arguments. The output of the `lscpu` command is the CPU information.

Terminal window

```
1# Display the CPU information2lscpu
```

#### [`lscpu` flags](#lscpu-flags)

-   `-a` - Display the CPU information with the specified all.
-   `-e` - Display the CPU information with the specified extended.
-   `-h` - Display the CPU information with the specified human-readable.
-   `-i` - Display the CPU information with the specified size in bytes.
-   `-p` - Display the CPU information with the specified physical.
-   `-x` - Display the CPU information with the specified XML.

Terminal window

```
1# Display the CPU information with the specified all2lscpu -a3
4# Display the CPU information with the specified extended5lscpu -e6
7# Display the CPU information with the specified human-readable8lscpu -h9
10# Display the CPU information with the specified size in bytes11lscpu -i12
13# Display the CPU information with the specified physical14lscpu -p15
16# Display the CPU information with the specified XML17lscpu -x
```

### [`lspci`](#lspci)

The `lspci` command is used to display the PCI information. It takes no arguments. The output of the `lspci` command is the PCI information.

Terminal window

```
1# Display the PCI information2lspci
```

#### [`lspci` flags](#lspci-flags)

-   `-a` - Display the PCI information with the specified all.
-   `-b` - Display the PCI information with the specified brief.
-   `-d` - Display the PCI information with the specified device.
-   `-D` - Display the PCI information with the specified dump.
-   `-k` - Display the PCI information with the specified kernel.
-   `-n` - Display the PCI information with the specified numeric.
-   `-s` - Display the PCI information with the specified slot.
-   `-t` - Display the PCI information with the specified tree.
-   `-v` - Display the PCI information with the specified verbose.

Terminal window

```
1# Display the PCI information with the specified all2lspci -a3
4# Display the PCI information with the specified brief5lspci -b6
7# Display the PCI information with the specified device8lspci -d9
10# Display the PCI information with the specified dump11lspci -D12
13# Display the PCI information with the specified kernel14lspci -k15
16# Display the PCI information with the specified numeric17lspci -n18
19# Display the PCI information with the specified slot20lspci -s21
22# Display the PCI information with the specified tree23lspci -t24
25# Display the PCI information with the specified verbose26lspci -v
```

### [`lsusb`](#lsusb)

The `lsusb` command is used to display the USB information. It takes no arguments. The output of the `lsusb` command is the USB information.

Terminal window

```
1# Display the USB information2lsusb
```

#### [`lsusb` flags](#lsusb-flags)

-   `-a` - Display the USB information with the specified all.
-   `-b` - Display the USB information with the specified brief.
-   `-d` - Display the USB information with the specified device.
-   `-D` - Display the USB information with the specified dump.
-   `-k` - Display the USB information with the specified kernel.
-   `-n` - Display the USB information with the specified numeric.
-   `-s` - Display the USB information with the specified slot.
-   `-t` - Display the USB information with the specified tree.
-   `-v` - Display the USB information with the specified verbose.

Terminal window

```
1# Display the USB information with the specified all2lsusb -a3
4# Display the USB information with the specified brief5lsusb -b6
7# Display the USB information with the specified device8lsusb -d9
10# Display the USB information with the specified dump11lsusb -D12
13# Display the USB information with the specified kernel14lsusb -k15
16# Display the USB information with the specified numeric17lsusb -n18
19# Display the USB information with the specified slot20lsusb -s21
22# Display the USB information with the specified tree23lsusb -t24
25# Display the USB information with the specified verbose26lsusb -v
```

### [`free`](#free)

The `free` command is used to display the memory information. It takes no arguments. The output of the `free` command is the memory information.

Terminal window

```
1# Display the memory information2free
```

#### [`free` flags](#free-flags)

-   `-b` - Display the memory information with the specified bytes.
-   `-k` - Display the memory information with the specified kilobytes.
-   `-m` - Display the memory information with the specified megabytes.
-   `-g` - Display the memory information with the specified gigabytes.
-   `-h` - Display the memory information with the specified human-readable.
-   `-t` - Display the memory information with the specified total.
-   `-s` - Display the memory information with the specified seconds.
-   `-c` - Display the memory information with the specified continuous.
-   `-o` - Display the memory information with the specified omit header.
-   `-V` - Display the memory information with the specified version.

Terminal window

```
1# Display the memory information with the specified bytes2free -b3
4# Display the memory information with the specified kilobytes5free -k6
7# Display the memory information with the specified megabytes8free -m9
10# Display the memory information with the specified gigabytes11free -g12
13# Display the memory information with the specified human-readable14free -h15
16# Display the memory information with the specified total17free -t18
19# Display the memory information with the specified seconds20free -s21
22# Display the memory information with the specified continuous23free -c24
25# Display the memory information with the specified omit header26free -o27
28# Display the memory information with the specified version29free -V
```

## [Configure and troubleshoot the network](#configure-and-troubleshoot-the-network)

Network engineers fresh to the Linux environment can benefit from reading this section. I made an effort to include the most used network troubleshooting commands. Tcpdump, iperf, netperf, and several more networking tools are also available for debugging network-related problems, but because of their complexity, they are not included in this list.

### [`ifconfig`](#ifconfig)

The `ifconfig` command is used to configure and display the network interface information. It takes no arguments. The output of the `ifconfig` command is the network interface information.

Terminal window

```
1# Display the network interface information2ifconfig
```

#### [`ifconfig` flags](#ifconfig-flags)

-   `-a` - Display the network interface information with the specified all.
-   `-s` - Display the network interface information with the specified summary.
-   `-v` - Display the network interface information with the specified verbose.
-   `-V` - Display the network interface information with the specified version.

Terminal window

```
1# Display the network interface information with the specified all2ifconfig -a3
4# Display the network interface information with the specified summary5ifconfig -s6
7# Display the network interface information with the specified verbose8ifconfig -v9
10# Display the network interface information with the specified version11ifconfig -V
```

### [`ip`](#ip)

The `ip` command is used to configure and display the network interface information. It takes no arguments. The output of the `ip` command is the network interface information.

Terminal window

```
1# Display the network interface information2ip
```

#### [`ip` flags](#ip-flags)

-   `-s` - Display the network interface information with the specified statistics.
-   `-d` - Display the network interface information with the specified details.
-   `-h` - Display the network interface information with the specified help.
-   `-v` - Display the network interface information with the specified verbose.
-   `-V` - Display the network interface information with the specified version.

Terminal window

```
1# Display the network interface information with the specified statistics2ip -s3
4# Display the network interface information with the specified details5ip -d6
7# Display the network interface information with the specified help8ip -h9
10# Display the network interface information with the specified verbose11ip -v12
13# Display the network interface information with the specified version14ip -V
```

### [`netstat`](#netstat)

The `netstat` command is used to display the network information. It takes no arguments. The output of the `netstat` command is the network information.

Terminal window

```
1# Display the network information2netstat
```

#### [`netstat` flags](#netstat-flags)

-   `-a` - Display the network information with the specified all.
-   `-c` - Display the network information with the specified continuous.
-   `-e` - Display the network information with the specified extended.
-   `-g` - Display the network information with the specified multicast.
-   `-i` - Display the network information with the specified interfaces.
-   `-l` - Display the network information with the specified listening.
-   `-m` - Display the network information with the specified memory.
-   `-n` - Display the network information with the specified numeric.
-   `-p` - Display the network information with the specified protocol.
-   `-r` - Display the network information with the specified routing.

Terminal window

```
1# Display the network information with the specified all2netstat -a3
4# Display the network information with the specified continuous5netstat -c6
7# Display the network information with the specified extended8netstat -e9
10# Display the network information with the specified multicast11netstat -g12
13# Display the network information with the specified interfaces14netstat -i15
16# Display the network information with the specified listening17netstat -l18
19# Display the network information with the specified memory20netstat -m21
22# Display the network information with the specified numeric23netstat -n24
25# Display the network information with the specified protocol26netstat -p27
28# Display the network information with the specified routing29netstat -r
```

### [`route`](#route)

The `route` command is used to display the routing information. It takes no arguments. The output of the `route` command is the routing information.

Terminal window

```
1# Display the routing information2route
```

#### [`route` flags](#route-flags)

-   `-n` - Display the routing information with the specified numeric.
-   `-v` - Display the routing information with the specified verbose.
-   `-V` - Display the routing information with the specified version.

Terminal window

```
1# Display the routing information with the specified numeric2route -n3
4# Display the routing information with the specified verbose5route -v6
7# Display the routing information with the specified version8route -V
```

### [`ethtool`](#ethtool)

The `ethtool` command is used to display the network interface information. It takes no arguments. The output of the `ethtool` command is the network interface information.

Terminal window

```
1# Display the network interface information2ethtool
```

#### [`ethtool` flags](#ethtool-flags)

-   `-a` - Display the network interface information with the specified all.
-   `-i` - Display the network interface information with the specified interface.
-   `-k` - Display the network interface information with the specified kernel.
-   `-S` - Display the network interface information with the specified statistics.
-   `-c` - Display the network interface information with the specified command.
-   `-h` - Display the network interface information with the specified help.
-   `-V` - Display the network interface information with the specified version.

Terminal window

```
1# Display the network interface information with the specified all2ethtool -a3
4# Display the network interface information with the specified interface5ethtool -i6
7# Display the network interface information with the specified kernel8ethtool -k9
10# Display the network interface information with the specified statistics11ethtool -S12
13# Display the network interface information with the specified command14ethtool -c15
16# Display the network interface information with the specified help17ethtool -h18
19# Display the network interface information with the specified version20ethtool -V
```

### [`tcpdump`](#tcpdump)

The `tcpdump` command is used to capture and display the network packets. It takes no arguments. The output of the `tcpdump` command is the network packets.

Terminal window

```
1# Capture and display the network packets2tcpdump
```

#### [`tcpdump` flags](#tcpdump-flags)

-   `-c` - Capture and display the network packets with the specified count.
-   `-i` - Capture and display the network packets with the specified interface.
-   `-n` - Capture and display the network packets with the specified numeric.
-   `-r` - Capture and display the network packets with the specified read.
-   `-s` - Capture and display the network packets with the specified snapshot.
-   `-w` - Capture and display the network packets with the specified write.
-   `-A` - Capture and display the network packets with the specified ASCII.
-   `-C` - Capture and display the network packets with the specified file.
-   `-D` - Capture and display the network packets with the specified devices.
-   `-F` - Capture and display the network packets with the specified output.
-   `-G` - Capture and display the network packets with the specified rotate.
-   `-H` - Capture and display the network packets with the specified hex.
-   `-L` - Capture and display the network packets with the specified follow.
-   `-N` - Capture and display the network packets with the specified no.
-   `-S` - Capture and display the network packets with the specified size.
-   `-T` - Capture and display the network packets with the specified timestamp.
-   `-Z` - Capture and display the network packets with the specified user.
-   `-d` - Capture and display the network packets with the specified decode.
-   `-V` - Capture and display the network packets with the specified version.

Terminal window

```
1# Capture and display the network packets with the specified count2tcpdump -c3
4# Capture and display the network packets with the specified interface5tcpdump -i6
7# Capture and display the network packets with the specified numeric8tcpdump -n9
10# Capture and display the network packets with the specified read11tcpdump -r12
13# Capture and display the network packets with the specified snapshot14tcpdump -s15
16# Capture and display the network packets with the specified write17tcpdump -w18
19# Capture and display the network packets with the specified ASCII20tcpdump -A21
22# Capture and display the network packets with the specified file23tcpdump -C24
25# Capture and display the network packets with the specified devices26tcpdump -D27
28# Capture and display the network packets with the specified output29tcpdump -F30
31# Capture and display the network packets with the specified rotate32tcpdump -G33
34# Capture and display the network packets with the specified hex35tcpdump -H36
37# Capture and display the network packets with the specified follow38tcpdump -L39
40# Capture and display the network packets with the specified no41tcpdump -N42
43# Capture and display the network packets with the specified size44tcpdump -S45
46# Capture and display the network packets with the specified timestamp47tcpdump -T48
49# Capture and display the network packets with the specified user50tcpdump -Z51
52# Capture and display the network packets with the specified decode53tcpdump -d54
55# Capture and display the network packets with the specified version56tcpdump -V
```

### [`ping`](#ping)

The `ping` command is used to send the ICMP echo request packets to the specified host. It takes no arguments. The output of the `ping` command is the ICMP echo reply packets.

Terminal window

```
1# Send the ICMP echo request packets to the specified host2ping <host>
```

#### [`ping` flags](#ping-flags)

-   `-c` - Send the ICMP echo request packets to the specified host with the specified count.
-   `-i` - Send the ICMP echo request packets to the specified host with the specified interval.
-   `-I` - Send the ICMP echo request packets to the specified host with the specified interface.
-   `-s` - Send the ICMP echo request packets to the specified host with the specified size.
-   `-t` - Send the ICMP echo request packets to the specified host with the specified ttl.
-   `-v` - Send the ICMP echo request packets to the specified host with the specified verbose.
-   `-V` - Send the ICMP echo request packets to the specified host with the specified version.

Terminal window

```
1# Send the ICMP echo request packets to the specified host with the specified count2ping -c <host>3
4# Send the ICMP echo request packets to the specified host with the specified interval5ping -i <host>6
7# Send the ICMP echo request packets to the specified host with the specified interface8ping -I <host>9
10# Send the ICMP echo request packets to the specified host with the specified size11ping -s <host>12
13# Send the ICMP echo request packets to the specified host with the specified ttl14ping -t <host>15
16# Send the ICMP echo request packets to the specified host with the specified verbose17ping -v <host>18
19# Send the ICMP echo request packets to the specified host with the specified version20ping -V <host>
```

### [`traceroute`](#traceroute)

The `traceroute` command is used to trace the route to the specified host. It takes no arguments. The output of the `traceroute` command is the route to the specified host.

Terminal window

```
1# Trace the route to the specified host2traceroute <host>
```

#### [`traceroute` flags](#traceroute-flags)

-   `-d` - Trace the route to the specified host with the specified debug.
-   `-f` - Trace the route to the specified host with the specified first.
-   `-g` - Trace the route to the specified host with the specified gateway.
-   `-I` - Trace the route to the specified host with the specified interface.
-   `-m` - Trace the route to the specified host with the specified max.
-   `-n` - Trace the route to the specified host with the specified numeric.
-   `-p` - Trace the route to the specified host with the specified port.
-   `-q` - Trace the route to the specified host with the specified query.
-   `-s` - Trace the route to the specified host with the specified source.
-   `-t` - Trace the route to the specified host with the specified ttl.
-   `-v` - Trace the route to the specified host with the specified verbose.
-   `-V` - Trace the route to the specified host with the specified version.

Terminal window

```
1# Trace the route to the specified host with the specified debug2traceroute -d <host>3
4# Trace the route to the specified host with the specified first5traceroute -f <host>6
7# Trace the route to the specified host with the specified gateway8traceroute -g <host>9
10# Trace the route to the specified host with the specified interface11traceroute -I <host>12
13# Trace the route to the specified host with the specified max14traceroute -m <host>15
16# Trace the route to the specified host with the specified numeric17traceroute -n <host>18
19# Trace the route to the specified host with the specified port20traceroute -p <host>21
22# Trace the route to the specified host with the specified query23traceroute -q <host>24
25# Trace the route to the specified host with the specified source26traceroute -s <host>27
28# Trace the route to the specified host with the specified ttl29traceroute -t <host>30
31# Trace the route to the specified host with the specified verbose32traceroute -v <host>33
34# Trace the route to the specified host with the specified version35traceroute -V <host>
```

### [`dig`](#dig)

The `dig` command is used to query the DNS name servers. It takes no arguments. The output of the `dig` command is the DNS name servers.

Terminal window

```
1# Query the DNS name servers2dig <host>
```

#### [`dig` flags](#dig-flags)

-   `-a` - Query the DNS name servers with the specified all.
-   `-b` - Query the DNS name servers with the specified bind.
-   `-c` - Query the DNS name servers with the specified class.
-   `-d` - Query the DNS name servers with the specified debug.
-   `-f` - Query the DNS name servers with the specified file.
-   `-i` - Query the DNS name servers with the specified interface.
-   `-k` - Query the DNS name servers with the specified key.
-   `-m` - Query the DNS name servers with the specified max.
-   `-n` - Query the DNS name servers with the specified numeric.
-   `-p` - Query the DNS name servers with the specified port.
-   `-q` - Query the DNS name servers with the specified query.
-   `-r` - Query the DNS name servers with the specified recurse.
-   `-s` - Query the DNS name servers with the specified server.
-   `-t` - Query the DNS name servers with the specified type.
-   `-v` - Query the DNS name servers with the specified verbose.
-   `-V` - Query the DNS name servers with the specified version.

Terminal window

```
1# Query the DNS name servers with the specified all2dig -a <host>3
4# Query the DNS name servers with the specified bind5dig -b <host>6
7# Query the DNS name servers with the specified class8dig -c <host>9
10# Query the DNS name servers with the specified debug11dig -d <host>12
13# Query the DNS name servers with the specified file14dig -f <host>15
16# Query the DNS name servers with the specified interface17dig -i <host>18
19# Query the DNS name servers with the specified key20dig -k <host>21
22# Query the DNS name servers with the specified max23dig -m <host>24
25# Query the DNS name servers with the specified numeric26dig -n <host>27
28# Query the DNS name servers with the specified port29dig -p <host>30
31# Query the DNS name servers with the specified query32dig -q <host>33
34# Query the DNS name servers with the specified recurse35dig -r <host>36
37# Query the DNS name servers with the specified server38dig -s <host>39
40# Query the DNS name servers with the specified type41dig -t <host>42
43# Query the DNS name servers with the specified verbose44dig -v <host>45
46# Query the DNS name servers with the specified version47dig -V <host>
```

### [`nslookup`](#nslookup)

The `nslookup` command is used to query the DNS name servers. It takes no arguments. The output of the `nslookup` command is the DNS name servers.

Terminal window

```
1# Query the DNS name servers2nslookup <host>
```

#### [`nslookup` flags](#nslookup-flags)

-   `-a` - Query the DNS name servers with the specified all.
-   `-b` - Query the DNS name servers with the specified bind.
-   `-c` - Query the DNS name servers with the specified class.
-   `-d` - Query the DNS name servers with the specified debug.
-   `-f` - Query the DNS name servers with the specified file.
-   `-i` - Query the DNS name servers with the specified interface.
-   `-k` - Query the DNS name servers with the specified key.
-   `-m` - Query the DNS name servers with the specified max.
-   `-n` - Query the DNS name servers with the specified numeric.
-   `-p` - Query the DNS name servers with the specified port.
-   `-q` - Query the DNS name servers with the specified query.
-   `-r` - Query the DNS name servers with the specified recurse.
-   `-s` - Query the DNS name servers with the specified server.
-   `-t` - Query the DNS name servers with the specified type.
-   `-v` - Query the DNS name servers with the specified verbose.
-   `-V` - Query the DNS name servers with the specified version.

Terminal window

```
1# Query the DNS name servers with the specified all2nslookup -a <host>3
4# Query the DNS name servers with the specified bind5nslookup -b <host>6
7# Query the DNS name servers with the specified class8nslookup -c <host>9
10# Query the DNS name servers with the specified debug11nslookup -d <host>12
13# Query the DNS name servers with the specified file14nslookup -f <host>15
16# Query the DNS name servers with the specified interface17nslookup -i <host>18
19# Query the DNS name servers with the specified key20nslookup -k <host>21
22# Query the DNS name servers with the specified max23nslookup -m <host>24
25# Query the DNS name servers with the specified numeric26nslookup -n <host>27
28# Query the DNS name servers with the specified port29nslookup -p <host>30
31# Query the DNS name servers with the specified query32nslookup -q <host>33
34# Query the DNS name servers with the specified recurse35nslookup -r <host>36
37# Query the DNS name servers with the specified server38nslookup -s <host>39
40# Query the DNS name servers with the specified type41nslookup -t <host>42
43# Query the DNS name servers with the specified verbose44nslookup -v <host>45
46# Query the DNS name servers with the specified version47nslookup -V <host>
```

### [`host`](#host)

The `host` command is used to query the DNS name servers. It takes no arguments. The output of the `host` command is the DNS name servers.

Terminal window

```
1# Query the DNS name servers2host <host>
```

#### [`host` flags](#host-flags)

-   `-a` - Query the DNS name servers with the specified all.
-   `-b` - Query the DNS name servers with the specified bind.
-   `-c` - Query the DNS name servers with the specified class.
-   `-d` - Query the DNS name servers with the specified debug.
-   `-f` - Query the DNS name servers with the specified file.
-   `-i` - Query the DNS name servers with the specified interface.
-   `-k` - Query the DNS name servers with the specified key.
-   `-m` - Query the DNS name servers with the specified max.
-   `-n` - Query the DNS name servers with the specified numeric.
-   `-p` - Query the DNS name servers with the specified port.
-   `-q` - Query the DNS name servers with the specified query.
-   `-r` - Query the DNS name servers with the specified recurse.
-   `-s` - Query the DNS name servers with the specified server.
-   `-t` - Query the DNS name servers with the specified type.
-   `-v` - Query the DNS name servers with the specified verbose.
-   `-V` - Query the DNS name servers with the specified version.

Terminal window

```
1# Query the DNS name servers with the specified all2host -a <host>3
4# Query the DNS name servers with the specified bind5host -b <host>6
7# Query the DNS name servers with the specified class8host -c <host>9
10# Query the DNS name servers with the specified debug11host -d <host>12
13# Query the DNS name servers with the specified file14host -f <host>15
16# Query the DNS name servers with the specified interface17host -i <host>18
19# Query the DNS name servers with the specified key20host -k <host>21
22# Query the DNS name servers with the specified max23host -m <host>24
25# Query the DNS name servers with the specified numeric26host -n <host>27
28# Query the DNS name servers with the specified port29host -p <host>30
31# Query the DNS name servers with the specified query32host -q <host>33
34# Query the DNS name servers with the specified recurse35host -r <host>36
37# Query the DNS name servers with the specified server38host -s <host>39
40# Query the DNS name servers with the specified type41host -t <host>42
43# Query the DNS name servers with the specified verbose44host -v <host>45
46# Query the DNS name servers with the specified version47host -V <host>
```

### [`drill`](#drill)

The `drill` command is used to query the DNS name servers. It takes no arguments. The output of the `drill` command is the DNS name servers.

Terminal window

```
1# Query the DNS name servers2drill <host>
```

#### [`drill` flags](#drill-flags)

-   `-a` - Query the DNS name servers with the specified all.
-   `-b` - Query the DNS name servers with the specified bind.
-   `-c` - Query the DNS name servers with the specified class.
-   `-d` - Query the DNS name servers with the specified debug.
-   `-f` - Query the DNS name servers with the specified file.
-   `-i` - Query the DNS name servers with the specified interface.
-   `-k` - Query the DNS name servers with the specified key.
-   `-m` - Query the DNS name servers with the specified max.
-   `-n` - Query the DNS name servers with the specified numeric.
-   `-p` - Query the DNS name servers with the specified port.
-   `-q` - Query the DNS name servers with the specified query.
-   `-r` - Query the DNS name servers with the specified recurse.
-   `-s` - Query the DNS name servers with the specified server.
-   `-t` - Query the DNS name servers with the specified type.
-   `-v` - Query the DNS name servers with the specified verbose.
-   `-V` - Query the DNS name servers with the specified version.

Terminal window

```
1# Query the DNS name servers with the specified all2drill -a <host>3
4# Query the DNS name servers with the specified bind5drill -b <host>6
7# Query the DNS name servers with the specified class8drill -c <host>9
10# Query the DNS name servers with the specified debug11drill -d <host>12
13# Query the DNS name servers with the specified file14drill -f <host>15
16# Query the DNS name servers with the specified interface17drill -i <host>18
19# Query the DNS name servers with the specified key20drill -k <host>21
22# Query the DNS name servers with the specified max23drill -m <host>24
25# Query the DNS name servers with the specified numeric26drill -n <host>27
28# Query the DNS name servers with the specified port29drill -p <host>30
31# Query the DNS name servers with the specified query32drill -q <host>33
34# Query the DNS name servers with the specified recurse35drill -r <host>36
37# Query the DNS name servers with the specified server38drill -s <host>39
40# Query the DNS name servers with the specified type41drill -t <host>42
43# Query the DNS name servers with the specified verbose44drill -v <host>45
46# Query the DNS name servers with the specified version47drill -V <host>
```

### [`ss`](#ss)

The `ss` command is used to query the DNS name servers. It takes no arguments. The output of the `ss` command is the DNS name servers.

Terminal window

```
1# Query the DNS name servers2ss <host>
```

#### [`ss` flags](#ss-flags)

-   `-a` - Query the DNS name servers with the specified all.
-   `-b` - Query the DNS name servers with the specified bind.
-   `-c` - Query the DNS name servers with the specified class.
-   `-d` - Query the DNS name servers with the specified debug.
-   `-f` - Query the DNS name servers with the specified file.
-   `-i` - Query the DNS name servers with the specified interface.
-   `-k` - Query the DNS name servers with the specified key.
-   `-m` - Query the DNS name servers with the specified max.
-   `-n` - Query the DNS name servers with the specified numeric.
-   `-p` - Query the DNS name servers with the specified port.
-   `-q` - Query the DNS name servers with the specified query.
-   `-r` - Query the DNS name servers with the specified recurse.
-   `-s` - Query the DNS name servers with the specified server.
-   `-t` - Query the DNS name servers with the specified type.
-   `-v` - Query the DNS name servers with the specified verbose.
-   `-V` - Query the DNS name servers with the specified version.

Terminal window

```
1# Query the DNS name servers with the specified all2ss -a <host>3
4# Query the DNS name servers with the specified bind5ss -b <host>6
7# Query the DNS name servers with the specified class8ss -c <host>9
10# Query the DNS name servers with the specified debug11ss -d <host>12
13# Query the DNS name servers with the specified file14ss -f <host>15
16# Query the DNS name servers with the specified interface17ss -i <host>18
19# Query the DNS name servers with the specified key20ss -k <host>21
22# Query the DNS name servers with the specified max23ss -m <host>24
25# Query the DNS name servers with the specified numeric26ss -n <host>27
28# Query the DNS name servers with the specified port29ss -p <host>30
31# Query the DNS name servers with the specified query32ss -q <host>33
34# Query the DNS name servers with the specified recurse35ss -r <host>36
37# Query the DNS name servers with the specified server38ss -s <host>39
40# Query the DNS name servers with the specified type41ss -t <host>42
43# Query the DNS name servers with the specified verbose44ss -v <host>45
46# Query the DNS name servers with the specified version47ss -V <host>
```

### [`wget`](#wget)

The `wget` command is used to query the DNS name servers. It takes no arguments. The output of the `wget` command is the DNS name servers.

Terminal window

```
1# Query the DNS name servers2wget <host>
```

#### [`wget` flags](#wget-flags)

-   `-a` - Query the DNS name servers with the specified all.
-   `-b` - Query the DNS name servers with the specified bind.
-   `-c` - Query the DNS name servers with the specified class.
-   `-d` - Query the DNS name servers with the specified debug.
-   `-f` - Query the DNS name servers with the specified file.
-   `-i` - Query the DNS name servers with the specified interface.
-   `-k` - Query the DNS name servers with the specified key.
-   `-m` - Query the DNS name servers with the specified max.
-   `-n` - Query the DNS name servers with the specified numeric.
-   `-p` - Query the DNS name servers with the specified port.
-   `-q` - Query the DNS name servers with the specified query.
-   `-r` - Query the DNS name servers with the specified recurse.
-   `-s` - Query the DNS name servers with the specified server.
-   `-t` - Query the DNS name servers with the specified type.
-   `-v` - Query the DNS name servers with the specified verbose.
-   `-V` - Query the DNS name servers with the specified version.

Terminal window

```
1# Query the DNS name servers with the specified all2wget -a <host>3
4# Query the DNS name servers with the specified bind5wget -b <host>6
7# Query the DNS name servers with the specified class8wget -c <host>9
10# Query the DNS name servers with the specified debug11wget -d <host>12
13# Query the DNS name servers with the specified file14wget -f <host>15
16# Query the DNS name servers with the specified interface17wget -i <host>18
19# Query the DNS name servers with the specified key20wget -k <host>21
22# Query the DNS name servers with the specified max23wget -m <host>24
25# Query the DNS name servers with the specified numeric26wget -n <host>27
28# Query the DNS name servers with the specified port29wget -p <host>30
31# Query the DNS name servers with the specified query32wget -q <host>33
34# Query the DNS name servers with the specified recurse35wget -r <host>36
37# Query the DNS name servers with the specified server38wget -s <host>39
40# Query the DNS name servers with the specified type41wget -t <host>42
43# Query the DNS name servers with the specified verbose44wget -v <host>45
46# Query the DNS name servers with the specified version47wget -V <host>
```

### [`curl`](#curl)

The `curl` command is used to query the DNS name servers. It takes no arguments. The output of the `curl` command is the DNS name servers.

Terminal window

```
1# Query the DNS name servers2curl <host>
```

#### [`curl` flags](#curl-flags)

-   `-a` - Query the DNS name servers with the specified all.
-   `-b` - Query the DNS name servers with the specified bind.
-   `-c` - Query the DNS name servers with the specified class.
-   `-d` - Query the DNS name servers with the specified debug.
-   `-f` - Query the DNS name servers with the specified file.
-   `-i` - Query the DNS name servers with the specified interface.
-   `-k` - Query the DNS name servers with the specified key.
-   `-m` - Query the DNS name servers with the specified max.
-   `-n` - Query the DNS name servers with the specified numeric.
-   `-p` - Query the DNS name servers with the specified port.
-   `-q` - Query the DNS name servers with the specified query.
-   `-r` - Query the DNS name servers with the specified recurse.
-   `-s` - Query the DNS name servers with the specified server.
-   `-t` - Query the DNS name servers with the specified type.
-   `-v` - Query the DNS name servers with the specified verbose.
-   `-V` - Query the DNS name servers with the specified version.

Terminal window

```
1# Query the DNS name servers with the specified all2curl -a <host>3
4# Query the DNS name servers with the specified bind5curl -b <host>6
7# Query the DNS name servers with the specified class8curl -c <host>9
10# Query the DNS name servers with the specified debug11curl -d <host>12
13# Query the DNS name servers with the specified file14curl -f <host>15
16# Query the DNS name servers with the specified interface17curl -i <host>18
19# Query the DNS name servers with the specified key20curl -k <host>21
22# Query the DNS name servers with the specified max23curl -m <host>24
25# Query the DNS name servers with the specified numeric26curl -n <host>27
28# Query the DNS name servers with the specified port29curl -p <host>30
31# Query the DNS name servers with the specified query32curl -q <host>33
34# Query the DNS name servers with the specified recurse35curl -r <host>36
37# Query the DNS name servers with the specified server38curl -s <host>39
40# Query the DNS name servers with the specified type41curl -t <host>42
43# Query the DNS name servers with the specified verbose44curl -v <host>45
46# Query the DNS name servers with the specified version47curl -V <host>
```

### [`nmap`](#nmap)

The `nmap` command is used to query the DNS name servers. It takes no arguments. The output of the `nmap` command is the DNS name servers.

Terminal window

```
1# Query the DNS name servers2nmap <host>
```

#### [`nmap` flags](#nmap-flags)

-   `-A` - Query the DNS name servers with the specified all.
-   `-V` - Query the DNS name servers with the specified version.

Terminal window

```
1# Query the DNS name servers with the specified all2nmap -A <host>3
4# Query the DNS name servers with the specified version5nmap -V <host>
```

## [Manage system processes](#manage-system-processes)

You may control Linux processes and troubleshoot any server resource-related issues with the use of these Linux commands. These commands let you keep an eye on your server’s RAM, CPU, disk IO, and other resources.

### [`ps`](#ps)

The `ps` command is used to list the processes running on the system. It takes no arguments. The output of the `ps` command is the processes running on the system.

Terminal window

```
1# List the processes running on the system2ps
```

#### [`ps` flags](#ps-flags)

-   `-a` - List the processes running on the system with the specified all.
-   `-f` - List the processes running on the system with the specified full.
-   `-l` - List the processes running on the system with the specified long.
-   `-u` - List the processes running on the system with the specified user.

Terminal window

```
1# List the processes running on the system with the specified all2ps -a3
4# List the processes running on the system with the specified full5ps -f6
7# List the processes running on the system with the specified long8ps -l9
10# List the processes running on the system with the specified user11ps -u
```

### [`top`](#top)

The `top` command is used to display the processes running on the system. It takes no arguments. The output of the `top` command is the processes running on the system.

Terminal window

```
1# Display the processes running on the system2top
```

#### [`top` flags](#top-flags)

-   `-b` - Display the processes running on the system with the specified batch.
-   `-c` - Display the processes running on the system with the specified command.
-   `-d` - Display the processes running on the system with the specified delay.
-   `-h` - Display the processes running on the system with the specified help.
-   `-i` - Display the processes running on the system with the specified idle.
-   `-n` - Display the processes running on the system with the specified iterations.
-   `-p` - Display the processes running on the system with the specified pid.
-   `-s` - Display the processes running on the system with the specified sort.
-   `-u` - Display the processes running on the system with the specified user.
-   `-v` - Display the processes running on the system with the specified version.

Terminal window

```
1# Display the processes running on the system with the specified batch2top -b3
4# Display the processes running on the system with the specified command5top -c6
7# Display the processes running on the system with the specified delay8top -d9
10# Display the processes running on the system with the specified help11top -h12
13# Display the processes running on the system with the specified idle14top -i15
16# Display the processes running on the system with the specified iterations17top -n18
19# Display the processes running on the system with the specified pid20top -p21
22# Display the processes running on the system with the specified sort23top -s24
25# Display the processes running on the system with the specified user26top -u27
28# Display the processes running on the system with the specified version29top -v
```

### [`kill`](#kill)

The `kill` command is used to kill a process. It takes one argument. The output of the `kill` command is the killed process.

Terminal window

```
1# Kill a process2kill <pid>
```

#### [`kill` flags](#kill-flags)

-   `-l` - Kill a process with the specified list.

Terminal window

```
1# Kill a process with the specified list2kill -l <pid>
```

### [`killall`](#killall)

The `killall` command is used to kill a process. It takes one argument. The output of the `killall` command is the killed process.

Terminal window

```
1# Kill a process2killall <process>
```

#### [`killall` flags](#killall-flags)

-   `-l` - Kill a process with the specified list.

Terminal window

```
1# Kill a process with the specified list2killall -l <process>
```

### [`pkill`](#pkill)

The `pkill` command is used to kill a process. It takes one argument. The output of the `pkill` command is the killed process.

Terminal window

```
1# Kill a process2pkill <process>
```

#### [`pkill` flags](#pkill-flags)

-   `-l` - Kill a process with the specified list.

Terminal window

```
1# Kill a process with the specified list2pkill -l <process>
```

### [`pgrep`](#pgrep)

The `pgrep` command is used to kill a process. It takes one argument. The output of the `pgrep` command is the killed process.

Terminal window

```
1# Kill a process2pgrep <process>
```

#### [`pgrep` flags](#pgrep-flags)

-   `-l` - Kill a process with the specified list.

Terminal window

```
1# Kill a process with the specified list2pgrep -l <process>
```

### [`nice`](#nice)

The `nice` command is used to run a process with a nice value. It takes one argument. The output of the `nice` command is the process with a nice value.

Terminal window

```
1# Run a process with a nice value2nice <process>
```

#### [`nice` flags](#nice-flags)

-   `-n` - Run a process with a nice value with the specified nice.
-   `-p` - Run a process with a nice value with the specified pid.
-   `-v` - Run a process with a nice value with the specified verbose.

Terminal window

```
1# Run a process with a nice value with the specified nice2nice -n <process>3
4# Run a process with a nice value with the specified pid5nice -p <process>6
7# Run a process with a nice value with the specified verbose8nice -v <process>
```

### [`renice`](#renice)

The `renice` command is used to run a process with a nice value. It takes one argument. The output of the `renice` command is the process with a nice value.

Terminal window

```
1# Run a process with a nice value2renice <process>
```

#### [`renice` flags](#renice-flags)

-   `-n` - Run a process with a nice value with the specified nice.
-   `-p` - Run a process with a nice value with the specified pid.
-   `-v` - Run a process with a nice value with the specified verbose.

Terminal window

```
1# Run a process with a nice value with the specified nice2renice -n <process>3
4# Run a process with a nice value with the specified pid5renice -p <process>6
7# Run a process with a nice value with the specified verbose8renice -v <process>
```

### [`at`](#at)

The `at` command is used to run a process at a specified time. It takes one argument. The output of the `at` command is the process at a specified time.

Terminal window

```
1# Run a process at a specified time2at <time>
```

#### [`at` flags](#at-flags)

-   `-f` - Run a process at a specified time with the specified file.
-   `-q` - Run a process at a specified time with the specified queue.
-   `-r` - Run a process at a specified time with the specified remove.
-   `-v` - Run a process at a specified time with the specified verbose.

Terminal window

```
1# Run a process at a specified time with the specified file2at -f <time>3
4# Run a process at a specified time with the specified queue5at -q <time>6
7# Run a process at a specified time with the specified remove8at -r <time>9
10# Run a process at a specified time with the specified verbose11at -v <time>
```

### [`atq`](#atq)

The `atq` command is used to run a process at a specified time. It takes one argument. The output of the `atq` command is the process at a specified time.

Terminal window

```
1# Run a process at a specified time2atq <time>
```

#### [`atq` flags](#atq-flags)

-   `-c` - Run a process at a specified time with the specified clear.
-   `-q` - Run a process at a specified time with the specified queue.
-   `-v` - Run a process at a specified time with the specified verbose.

Terminal window

```
1# Run a process at a specified time with the specified clear2atq -c <time>3
4# Run a process at a specified time with the specified queue5atq -q <time>6
7# Run a process at a specified time with the specified verbose8atq -v <time>
```

### [`atrm`](#atrm)

The `atrm` command is used to run a process at a specified time. It takes one argument. The output of the `atrm` command is the process at a specified time.

Terminal window

```
1# Run a process at a specified time2atrm <time>
```

#### [`atrm` flags](#atrm-flags)

-   `-v` - Run a process at a specified time with the specified verbose.

Terminal window

```
1# Run a process at a specified time with the specified verbose2atrm -v <time>
```

### [`batch`](#batch)

The `batch` command is used to run a process at a specified time. It takes one argument. The output of the `batch` command is the process at a specified time.

Terminal window

```
1# Run a process at a specified time2batch <time>
```

#### [`batch` flags](#batch-flags)

-   `-f` - Run a process at a specified time with the specified file.
-   `-q` - Run a process at a specified time with the specified queue.
-   `-r` - Run a process at a specified time with the specified remove.
-   `-v` - Run a process at a specified time with the specified verbose.

Terminal window

```
1# Run a process at a specified time with the specified file2batch -f <time>3
4# Run a process at a specified time with the specified queue5batch -q <time>6
7# Run a process at a specified time with the specified remove8batch -r <time>9
10# Run a process at a specified time with the specified verbose11batch -v <time>
```

### [`crontab`](#crontab)

The `crontab` command is used to run a process at a specified time. It takes one argument. The output of the `crontab` command is the process at a specified time.

Terminal window

```
1# Run a process at a specified time2crontab <time>
```

#### [`crontab` flags](#crontab-flags)

-   `-e` - Run a process at a specified time with the specified edit.
-   `-l` - Run a process at a specified time with the specified list.
-   `-r` - Run a process at a specified time with the specified remove.

Terminal window

```
1# Run a process at a specified time with the specified edit2crontab -e <time>3
4# Run a process at a specified time with the specified list5crontab -l <time>6
7# Run a process at a specified time with the specified remove8crontab -r <time>
```

### [`iostat`](#iostat)

The `iostat` command is used to run a process at a specified time. It takes one argument. The output of the `iostat` command is the process at a specified time.

Terminal window

```
1# Run a process at a specified time2iostat <time>
```

#### [`iostat` flags](#iostat-flags)

-   `-c` - Run a process at a specified time with the specified count.
-   `-d` - Run a process at a specified time with the specified device.
-   `-h` - Run a process at a specified time with the specified help.
-   `-k` - Run a process at a specified time with the specified kilobytes.
-   `-m` - Run a process at a specified time with the specified megabytes.
-   `-p` - Run a process at a specified time with the specified partition.
-   `-q` - Run a process at a specified time with the specified quiet.
-   `-t` - Run a process at a specified time with the specified time.
-   `-x` - Run a process at a specified time with the specified extended.
-   `-y` - Run a process at a specified time with the specified summary.

Terminal window

```
1# Run a process at a specified time with the specified count2iostat -c <time>3
4# Run a process at a specified time with the specified device5iostat -d <time>6
7# Run a process at a specified time with the specified help8iostat -h <time>9
10# Run a process at a specified time with the specified kilobytes11iostat -k <time>12
13# Run a process at a specified time with the specified megabytes14iostat -m <time>15
16# Run a process at a specified time with the specified partition17iostat -p <time>18
19# Run a process at a specified time with the specified quiet20iostat -q <time>21
22# Run a process at a specified time with the specified time23iostat -t <time>24
25# Run a process at a specified time with the specified extended26iostat -x <time>27
28# Run a process at a specified time with the specified summary29iostat -y <time>
```

### [`vmstat`](#vmstat)

The `vmstat` command is used to run a process at a specified time. It takes one argument. The output of the `vmstat` command is the process at a specified time.

Terminal window

```
1# Run a process at a specified time2vmstat <time>
```

#### [`vmstat` flags](#vmstat-flags)

-   `-a` - Run a process at a specified time with the specified all.
-   `-d` - Run a process at a specified time with the specified disk.
-   `-f` - Run a process at a specified time with the specified file.
-   `-h` - Run a process at a specified time with the specified help.
-   `-i` - Run a process at a specified time with the specified interrupt.

Terminal window

```
1# Run a process at a specified time with the specified all2vmstat -a <time>3
4# Run a process at a specified time with the specified disk5vmstat -d <time>6
7# Run a process at a specified time with the specified file8vmstat -f <time>9
10# Run a process at a specified time with the specified help11vmstat -h <time>12
13# Run a process at a specified time with the specified interrupt14vmstat -i <time>
```

### [`sar`](#sar)

The `sar` command is used to run a process at a specified time. It takes one argument. The output of the `sar` command is the process at a specified time.

Terminal window

```
1# Run a process at a specified time2sar <time>
```

#### [`sar` flags](#sar-flags)

-   `-A` - Run a process at a specified time with the specified all.
-   `-B` - Run a process at a specified time with the specified block.
-   `-b` - Run a process at a specified time with the specified boot.
-   `-d` - Run a process at a specified time with the specified device.
-   `-e` - Run a process at a specified time with the specified error.
-   `-f` - Run a process at a specified time with the specified file.
-   `-h` - Run a process at a specified time with the specified help.
-   `-H` - Run a process at a specified time with the specified huge.
-   `-I` - Run a process at a specified time with the specified interrupt.
-   `-j` - Run a process at a specified time with the specified job.
-   `-k` - Run a process at a specified time with the specified kernel.
-   `-l` - Run a process at a specified time with the specified lock.
-   `-m` - Run a process at a specified time with the specified memory.
-   `-n` - Run a process at a specified time with the specified network.
-   `-o` - Run a process at a specified time with the specified output.
-   `-p` - Run a process at a specified time with the specified partition.
-   `-q` - Run a process at a specified time with the specified queue.
-   `-r` - Run a process at a specified time with the specified remove.
-   `-R` - Run a process at a specified time with the specified reboot.
-   `-S` - Run a process at a specified time with the specified swap.
-   `-s` - Run a process at a specified time with the specified system.
-   `-t` - Run a process at a specified time with the specified time.
-   `-u` - Run a process at a specified time with the specified user.
-   `-v` - Run a process at a specified time with the specified version.
-   `-w` - Run a process at a specified time with the specified wait.
-   `-W` - Run a process at a specified time with the specified watchdog.
-   `-x` - Run a process at a specified time with the specified extended.
-   `-y` - Run a process at a specified time with the specified summary.

Terminal window

```
1# Run a process at a specified time with the specified all2sar -A <time>3
4# Run a process at a specified time with the specified block5sar -B <time>6
7# Run a process at a specified time with the specified boot8sar -b <time>9
10# Run a process at a specified time with the specified device11sar -d <time>12
13# Run a process at a specified time with the specified error14sar -e <time>15
16# Run a process at a specified time with the specified file17sar -f <time>18
19# Run a process at a specified time with the specified help20sar -h <time>21
22# Run a process at a specified time with the specified huge23sar -H <time>24
25# Run a process at a specified time with the specified interrupt26sar -I <time>27
28# Run a process at a specified time with the specified job29sar -j <time>30
31# Run a process at a specified time with the specified kernel32sar -k <time>33
34# Run a process at a specified time with the specified lock35sar -l <time>36
37# Run a process at a specified time with the specified memory38sar -m <time>39
40# Run a process at a specified time with the specified network41sar -n <time>42
43# Run a process at a specified time with the specified output44sar -o <time>45
46# Run a process at a specified time with the specified partition47sar -p <time>48
49# Run a process at a specified time with the specified queue50sar -q <time>51
52# Run a process at a specified time with the specified remove53sar -r <time>54
55# Run a process at a specified time with the specified reboot56sar -R <time>57
58# Run a process at a specified time with the specified swap59sar -S <time>60
61# Run a process at a specified time with the specified system62sar -s <time>63
64# Run a process at a specified time with the specified time65sar -t <time>66
67# Run a process at a specified time with the specified user68sar -u <time>69
70# Run a process at a specified time with the specified version71sar -v <time>72
73# Run a process at a specified time with the specified wait74sar -w <time>75
76# Run a process at a specified time with the specified watchdog77sar -W <time>78
79# Run a process at a specified time with the specified extended80sar -x <time>81
82# Run a process at a specified time with the specified summary83sar -y <time>
```

## [Summary](#summary)

You learnt about Linux CLI commands in this tutorial, along with the fundamental commands for:

-   File management
-   Finding files and directories
-   Check user information
-   Managing users and groups
-   Managing permissions
-   Check system information
-   Configure and troubleshoot the network
-   Manage system processes

## [References](#references)

-   [The Linux Command Line by William Shotts (Free Book)](https://linuxcommand.org/tlcl.php)
-   [Linux Journey - Learning Portal](https://linuxjourney.com/)
-   [Ubuntu Manpages Online](https://manpages.ubuntu.com/) (Useful for checking specific command options)
-   [GNU Coreutils Manual](https://www.gnu.org/software/coreutils/manual/coreutils.html) (Covers many basic commands like `ls`, `cp`, `mv`, `rm`)
-   [ArchWiki - Command-line shell](https://wiki.archlinux.org/title/Command-line_shell)
-   [Red Hat Enterprise Linux Documentation](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/)
-   [Debian Administrator’s Handbook](https://debian-handbook.info/browse/stable/)
-   [`man` command (Your local Linux system’s manual pages, e.g., `man ls`)](https://en.wikipedia.org/wiki/Man_page)
-   [DigitalOcean Community Tutorials - Linux Basics](https://www.digitalocean.com/community/tutorials?q=linux+basics)
-   [TecMint - Linux How-To Guides](https://www.tecmint.com/)
-   [Explain Shell - Write a command to see the help text that matches each argument](https://explainshell.com/)
-   [Linux Foundation - Training & Certification](https://training.linuxfoundation.org/)
-   [Ryan’s Tutorials - Linux](https://ryanstutorials.net/linuxtutorial/)
-   [SS64 Command line reference - Linux](https://ss64.com/bash/)
-   [Linuxize - Linux Howtos, Tutorials & Guides](https://linuxize.com/)

Was this useful?

## Tags

[#Linux CLI](/blog/tags/linux-cli)[#Bash](/blog/tags/bash)[#Shell Commands](/blog/tags/shell-commands)[#File Management](/blog/tags/file-management)[#User Management](/blog/tags/user-management)[#Permissions](/blog/tags/permissions)[#System Information](/blog/tags/system-information)[#Network Utilities](/blog/tags/network-utilities)[#Process Management](/blog/tags/process-management)[#Linux Basics](/blog/tags/linux-basics)

## Share

[Facebook](https://facebook.com/sharer/sharer.php?u=https%3A%2F%2Fmkabumattar.com%2Fblog%2Fpost%2Fintroduction-to-linux-cli "Share on Facebook")[Twitter](https://twitter.com/intent/tweet/?text=Introduction%20to%20Linux%20CLI&url=https%3A%2F%2Fmkabumattar.com%2Fblog%2Fpost%2Fintroduction-to-linux-cli "Share on Twitter")[LinkedIn](https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fmkabumattar.com%2Fblog%2Fpost%2Fintroduction-to-linux-cli&title=Introduction%20to%20Linux%20CLI&summary=Introduction%20to%20Linux%20command-line%20interface%20CLI%2C%20Linux%20is%20a%20Unix-like%20computer%20operating%20system%20assembled%20under%20the%20model%20of%20free%20and%20open-source%20software%20development%20and%20distribution.&source=https://mkabumattar.com "Share on LinkedIn")[WhatsApp](https://wa.me/?text=Introduction%20to%20Linux%20CLI%20https%3A%2F%2Fmkabumattar.com%2Fblog%2Fpost%2Fintroduction-to-linux-cli "Share on WhatsApp")[Telegram](https://t.me/share/url?url=https%3A%2F%2Fmkabumattar.com%2Fblog%2Fpost%2Fintroduction-to-linux-cli&text=Introduction%20to%20Linux%20CLI "Share on Telegram")[Reddit](https://www.reddit.com/submit?url=https%3A%2F%2Fmkabumattar.com%2Fblog%2Fpost%2Fintroduction-to-linux-cli&title=Introduction%20to%20Linux%20CLI "Share on Reddit")[Hacker News](http://news.ycombinator.com/submitlink?u=https%3A%2F%2Fmkabumattar.com%2Fblog%2Fpost%2Fintroduction-to-linux-cli&t=Introduction%20to%20Linux%20CLI "Share on Hacker News")[Pinterest](https://pinterest.com/pin/create/button/?url=https%3A%2F%2Fmkabumattar.com%2Fblog%2Fpost%2Fintroduction-to-linux-cli&media=&description=Introduction%20to%20Linux%20command-line%20interface%20CLI%2C%20Linux%20is%20a%20Unix-like%20computer%20operating%20system%20assembled%20under%20the%20model%20of%20free%20and%20open-source%20software%20development%20and%20distribution. "Share on Pinterest")[Email](<mailto:?subject=Introduction%20to%20Linux%20CLI&body=Check out this article: https%3A%2F%2Fmkabumattar.com%2Fblog%2Fpost%2Fintroduction-to-linux-cli>)

## Comments

## You might also enjoy

More posts on similar topics

[![VIM Cheat Sheet](/_astro/hero.Buk-UDGW_2r0YqI.webp)](/blog/post/vim-cheat-sheet)

## [VIM Cheat Sheet](/blog/post/vim-cheat-sheet)

-   [Mohammad Abu Mattar](/authors/mohammad-abu-mattar)
-   [Linux](/blog/categories/linux)
-   [VIM](/blog/categories/vim)
-   [Text Editors](/blog/categories/text-editors)
-   [Developer Tools](/blog/categories/developer-tools)
-   [Command Line](/blog/categories/command-line)

What is VIM? VIM (Vi Improved) is a versatile text editor pre-installed on most Linux systems, known for its efficiency in command-line file editing. Its modal nature, switching between modes like

[#VIM Commands](/blog/tags/vim-commands)[#VIM Cheat Sheet](/blog/tags/vim-cheat-sheet)[#Text Editing](/blog/tags/text-editing)+5 tags

[read more](/blog/post/vim-cheat-sheet)

[![How To Install Docker On Linux In 4 Easy Steps](/_astro/hero.CpX7CDI1_VrFPo.webp)](/blog/post/how-to-install-docker-on-linux-in-4-easy-steps)

## [How To Install Docker On Linux In 4 Easy Steps](/blog/post/how-to-install-docker-on-linux-in-4-easy-steps)

-   [Mohammad Abu Mattar](/authors/mohammad-abu-mattar)
-   [Docker](/blog/categories/docker)
-   [Linux](/blog/categories/linux)
-   [DevOps](/blog/categories/devops)
-   [System Administration](/blog/categories/system-administration)
-   [Containerization](/blog/categories/containerization)

Introduction Docker is a platform that lets developers create, deploy, and run applications in containers. Containers are isolated environments that allow you to run your applications in a consist

[#Docker Installation](/blog/tags/docker-installation)[#Linux Setup](/blog/tags/linux-setup)[#DevOps Tools](/blog/tags/devops-tools)+3 tags

[read more](/blog/post/how-to-install-docker-on-linux-in-4-easy-steps)

[![Git SSH Keys for GitHub, GitLab, and Bitbucket on Linux](/_astro/hero.ohMeiGHZ_Z1ILCmY.webp)](/blog/post/git-ssh-keys-for-github-gitlab-and-bitbucket-on-linux)

## [Git SSH Keys for GitHub, GitLab, and Bitbucket on Linux](/blog/post/git-ssh-keys-for-github-gitlab-and-bitbucket-on-linux)

-   [Mohammad Abu Mattar](/authors/mohammad-abu-mattar)
-   [Linux](/blog/categories/linux)
-   [Git](/blog/categories/git)
-   [SSH](/blog/categories/ssh)
-   [Version Control](/blog/categories/version-control)
-   [Developer Tools](/blog/categories/developer-tools)

Introduction By default, Git talks to remotes over HTTPS, so it asks for your username and password on every git pull or git push. SSH fixes that. GitHub, GitLab, and Bitbucket all let Git aut

[#SSH Keys](/blog/tags/ssh-keys)[#Ed25519](/blog/tags/ed25519)[#GitHub SSH](/blog/tags/github-ssh)+8 tags

[read more](/blog/post/git-ssh-keys-for-github-gitlab-and-bitbucket-on-linux)

[![Dotfiles: A Git-Based Strategy for Configuration Management](/_astro/hero.wfzXy7kc_dMWKx.webp)](/blog/post/dotfiles)

## [Dotfiles: A Git-Based Strategy for Configuration Management](/blog/post/dotfiles)

-   [Mohammad Abu Mattar](/authors/mohammad-abu-mattar)
-   [Linux](/blog/categories/linux)
-   [Git](/blog/categories/git)
-   [Configuration Management](/blog/categories/configuration-management)
-   [Developer Tools](/blog/categories/developer-tools)
-   [Productivity](/blog/categories/productivity)

Introduction Your dotfiles, those hidden .-prefixed configuration files scattered across your home directory, are the muscle memory of your environment. They hold your shell aliases, your editor

[#Dotfiles Management](/blog/tags/dotfiles-management)[#Git Bare Repository](/blog/tags/git-bare-repository)[#Shell Configuration](/blog/tags/shell-configuration)+7 tags

[read more](/blog/post/dotfiles)

[![How to Install and Setup FireWall on Amazon Linux 2](/_astro/hero.b8oDtFR4_ZdWcUP.webp)](/blog/post/how-to-install-and-setup-firewall-on-amazon-linux-2)

## [How to Install and Setup FireWall on Amazon Linux 2](/blog/post/how-to-install-and-setup-firewall-on-amazon-linux-2)

-   [Mohammad Abu Mattar](/authors/mohammad-abu-mattar)
-   [AWS](/blog/categories/aws)
-   [EC2](/blog/categories/ec2)
-   [Linux](/blog/categories/linux)
-   [Firewall](/blog/categories/firewall)
-   [Security](/blog/categories/security)

Introduction This tutorial covers installing and configuring firewalld on Amazon Linux 2, including setting the default zone and managing services and ports. Prerequisites To follow along wit

[#Firewalld](/blog/tags/firewalld)[#Amazon Linux 2](/blog/tags/amazon-linux-2)[#EC2 Security](/blog/tags/ec2-security)+5 tags

[read more](/blog/post/how-to-install-and-setup-firewall-on-amazon-linux-2)

[![How to Install Apache Web Server on Amazon Linux 2](/_astro/hero.CFurz9Hr_Z2mT9lT.webp)](/blog/post/how-to-install-apache-web-server-on-amazon-linux-2)

## [How to Install Apache Web Server on Amazon Linux 2](/blog/post/how-to-install-apache-web-server-on-amazon-linux-2)

-   [Mohammad Abu Mattar](/authors/mohammad-abu-mattar)
-   [AWS](/blog/categories/aws)
-   [EC2](/blog/categories/ec2)
-   [Apache](/blog/categories/apache)
-   [Web Server](/blog/categories/web-server)
-   [Linux](/blog/categories/linux)
-   [Firewall](/blog/categories/firewall)

Introduction In this tutorial, we will learn how to install Apache web server on Amazon Linux 2. We will also learn how to configure Apache web server to serve a simple HTML web page. Prerequi

[#Apache Installation](/blog/tags/apache-installation)[#Amazon Linux 2](/blog/tags/amazon-linux-2)[#HTTPD](/blog/tags/httpd)+4 tags

[read more](/blog/post/how-to-install-apache-web-server-on-amazon-linux-2)

6 related posts
