Linux command cheat sheet

13 May 2023 5 minutes Author: Lady Liberty

Linux cheat sheet: commands for beginners

Terminal and text commands are the main way to control the Linux operating system, especially when it comes to the server. Although the word “terminal” scares beginners, believe me, everything is much simpler. Today we have prepared a cheat sheet with basic commands for you – bookmark it and increase your productivity hundreds of times. A command is the name of a program that a user enters in the terminal to perform a specific task. Commands can have additional data and parameters.
Sometimes it is difficult to recall some Linux terminal commands, and it is a good practice to save them on your computer or on paper as a cheat sheet. This list is not exhaustive, but it contains the most commonly used commands. Linux commands can seem intimidating at first glance if you are not used to using a terminal. There are many commands to perform operations and processes on a Linux system. Whether you’re new to Linux or an experienced user, having a list of common commands at your fingertips will be helpful.This guide will provide you with commonly used Linux commands with syntax and examples.

You can keep this Linux command cheat sheet on your desk. We are confident that you will quickly master these commands if you have just recently started learning them, and you will soon become a Linux expert. Commands are divided into different sections depending on their use. Links to the PDF and PNG versions of this cheat sheet are at the end of the post. We’ve grouped the Linux commands in the following sections for easier understanding. At first glance, the list may seem very difficult to memorize, but memorization comes with practice! The more often you use certain commands, the faster you will memorize them.

Basic Linux commands


Lists with all files  in the current directory

ls -R

Also shows files in subdirectories

ls -a

Also displays hidden files

ls -al

Lists files and directories with detailed information

cd or cd ~

Go to the HOME directory

cd ..

Move up a level


To navigate to a specific directory

cd /

Switch to the root directory

cat > filename

Create a new file

cat filename

Displays the contents of the file

cat file1 file2 > file3

Combines two files and saves the result

mv file “new file path”

Moves files to a new location


Renames a file to a new name


Allows users to run programs with root

rm filename

Delete a file


Provides background information about the team


Provides a list of all previous commands


Cleaning the terminal

mkdir directoryname

Creates a new directory in the current


Delete a catalog


Rename the catalog

pr -x

Splits a file into x columns

pr -h

Assigns a file header

pr -n

Marks the file with line numbers

lp -nc , lpr c

Prints “c” copies of a file

lp-d lp-P

Specifies the name of the printer


Command to install and update packages

mail -s ‘subject’

Command to send an email

mail -s “Subject”

Command to send an email with an attachment

Permission commands for files

ls -l

To show the file type and access rights


Permission to view


Permission to record


Execute the authorization


No authorization

Chown user

To change the ownership of a file/directories

Chown user:group filename

change the user and group for a file or directory

Team Change environment


To display the change value


Displays all environmental variables

VARIABLE_NAME= variable_value

Create a new variable


Deleting a variable

export Variable=value

Set the value of the environment variable

User management commands in linux

sudo adduser username

Add a new user

sudo passwd -l ‘username’

Change user password

sudo userdel -r ‘username’

Change user password

sudo usermod -a -G GROUPNAME USERNAME

Add a user to a group

sudo deluser USER GROUPNAME

Change the directory to “dirname”


Shows information about all users

finger username

Provides information about a specific user

Command to connect to the network

SSH username@ip-address or hostname

Log in to a remote Linux machine via SSH

Ping hostname=”” or =””

Ping and analyze network


Display files in the current directory r

cd “dirname”

Change the directory to “dirname”

put file

Download a “file” from a local to a remote computer

get file

Download a “file” from a remote


Log out of the system

Command for processing


Switching a process to the background


Starting a stopped process in the foreground


Detailed information about all active processes


Display the status of processes

ps PID

Provides status to a specific process


Gives the process identifier (PID) of the process

kill PID

Killing the process


Starts a process with a specified priority


Changes the priority of an already running process


Provides free hard disk space on your system


Provides free RAM on your system

VI Commands for editing


Paste with cursor


Write after the cursor


Write at the end of the line


End insert mode


Undo the last change


Undo all changes for the entire row


Open a new line (switches to insert mode)


Delete a line


Delete 3 lines


Delete the contents of a string after the cursor


Delete the contents of the line after the cursor


Delete the word


Delete 4 words


Change the word


Delete a character near the cursor


Replace a character


Overwrite characters starting with the cursor


Replace one character under the cursor


Replace the entire line and start inserting


Change the case of a single character

Other related articles
Found an error?
If you find an error, take a screenshot and send it to the bot.