In this tutorial you’ll learn basic and the most used Linux commands. This Linux Command Cheatsheet For Beginners will help you gain the necessary understanding of daily task execution through the terminal.
Linux is the preferred Operating system among professional developers because it makes very efficient use of the system’s resources.

The commands discussed below may not help you become a pro in a day, but practicing all and learning new things along with implementing everything in a positive manner will make you an efficient Linux user.
1. File Management
ls | Lists all the files in the current directory |
ls -l | Shows files along with permissions |
ls -al | Shows a list of all the files including hidden Files |
ls -lt | Sorting the listing by time modification |
pwd | Shows the Present Working Directory |
cd | Prints Current Directory |
cd .. | Change the directory to the parent directory |
cd – | change to the previous directory |
cd dir_name | Change the directory to “dir_name” |
mkdir dir_name | Make a directory with “dir_name” |
cat > filename | Creates a new file with ‘filename’ |
cat filename | Displays file content |
cat file1 file2 > file3 | Concatenate or joins two files in one |
touch filename | Create a new file with ‘filename’ |
rm filename | Removes the file |
rm -r dir | Removes a directory named ‘dir’ |
cp file1 file2 | Copy file1 and call it file2 |
cp -r dir1 dir2 | Copy contents of directory ‘dir1’ to ‘dir2’ |
mv file1 file2 | Move file1 to file2 |
echo ‘Hi’ > data.txt | Enters content to a file |
echo ‘There!’ >> data.txt | Append text to existing file in Linux |
nano filename | Opens file in an editor |
vim filename | Enables efficient text editor |
tar -cvf archived.tar /indgeek | Compress files and folders in Linux |
tar -xvf archived.tar | Extracts the tar archive file |
2. Management Commands
sudo | Allows regular users to run with Superuser privileges |
apt-get | Command used to install and update packages |
ps | Displays the current working processes |
man | Opens the help manual of a command |
pidof | Gives the Process ID (PID) of a process |
kill PID | Kill the process with the given PID |
top -u igeek | Display specific User process details |
nice | Starts a process with a given priority |
renice | Changes priority of an already running process |
df | Gives free hard disk space on your system |
free | Gives free RAM on your system |
bg | To send a process to the background |
fg | To run a stopped process in the foreground |
Read More: Basic SQL Cheat Sheet
3. Permissions
Linux permissions grating is a tricky task that you may memorize with simple syntaxes.
Remember providing ‘Read Permission‘ to any user would only allow them to read the file, that specific user won’t be able to write/ modify or execute that file or application.
Users:
Every file and directory on a Linux system can be assigned 3 types of Owners,
- Owner: The Owner is the creator of a specific file or Directory
- Group: A Group can contain multiple users
- Others: A person who has neither created the file nor belongs to a user group who owns the file.
u | user/ owner |
g | group |
o | other |
a | all |
+ | Adds permission |
– | Removes permission |
= | Assigns the permission |
r | Read Permission |
w | Write Permission |
x | Executing permission |
0 | – No permissions |
1 | -x |
2 | -w- |
3 | -wx |
4 | r- |
5 | r-x |
6 | rw- |
7 | rwx |
chmod +rwx filename | Adds all permission to an user |
chmod -rwx filename | Removes all permission from an user |
chmod +w filename | Allows users to modify the file |
chmod +r-x filename | Allows a user to read and execute |
chmod 777 | Completely permits Owner, Groups, others |
chown user | Changs the ownership of a file/directory |
4. System
users | Shows the username of users currently logged in |
w | Displays who is online |
whoami | Displays current logged in user to this system |
finger user | Shows information about the user |
sudo adduser username | Adds a user with a username |
sudo userdel -r ‘username’ | Removes ‘username’ user |
sudo passwd -l ‘username’ | To change the password of a user |
sudo usermod -a -G Gname Uname | Add user to a Group |
uname -a | Shows Kernal information |
uname -m | Shows Architecture information |
cat /proc/cpuinfo | Display CPU information |
cat proc/meminfo | Display memory information |
free -t | Shows total memory used & available |
Also Read: Advantages of using Linux
5. Searching
grep pattern filename | Search for “pattern” in the file |
grep -i “indgeek” geeks.txt | Enables to search for a string case-insensitively |
grep -c “igeek” geeks.txt | Displaying the count or number of matches |
grep -r pattern dir | Search recursively for patterns in dir |
locate filename | Find all instances of file |
grep -v “igeek” geeks.txt | Display the unmatched lines with the searched pattern |
find . -name geeks.txt | Find all the files whose name is geeks.txt in PWD |
find / -type d -name IndGeek | Find directories whose name is IndGeek in / directory |
6. Networking
ssh igeek@192.168.10.3 | Log into the Remote host at a specific address as user ‘igeek’ |
ftp 192.168.10.3 | Connects to remote FTP host |
ping indgeek.com | To ping and analyze network and host connections |
ifconfig -a | Display network information |
netstat | Shows active or listening ports |
whois domain | Get whois information for a domain |
dig domain | Grabs DNS information of a domain |
dig -x host | Reverse lookup host |
wget filename | Downloads file |
wget url | Downloads file from a specific URL |
put file | Upload ‘file’ from local to the remote computer |
get file | Download ‘file’ from remote to local computer |
quit | Logout as a user |