Linux commands

Mastering Basic Linux Commands for Beginners: A Comprehensive Guide

Linux commands

Here I have listed basic linux commands that are used in day to day life. The commands are divided into 7 parts, basic linux commands, process commands, user management commands, hardware commands, network commands, system information commands, file permission commands.

Some basic Linux commands

Commands Description
List all files in the present working directory
ls -R
List files in sub-directories as well
ls -a
List hidden files
ls -al
List al files with detailed information like permission, size, owners etc.
cd or cd ~
Navigates to the HOME directory
cd -
Navigates to previous directory
cd /
Moves to root directory
cat > filename
creates the new file
touch filename
creates a new file
cat file1 file2 file3 > file4
joins two or more files and stores the output in a new file

Process commands

Commands Description
To send a process to the background
To run a stopped process in the background
Details of all active process
Give the status os preocesses of a user
ps PID
Give the status of particular process
kill PID
Kill a process
Start a process with a given priority
Gives free hard disk space on your system
Give free RAM on your system

User Management commands

Commands Description
sudo adduser username
To add a new user to your current linux machine
sudo userdel -r “username”
deluser removes a user from a specific group

Hardware commands

Commands Description
cat /proc/cpuinfo
Display more infoprmation about CPU
cat /proc/meminfo
Display more information about hardware memory
Display information about USB devices
Display block devices related information
free -m
Displays free and used memory in the system
lspci -tv
Dislpays PCI devices in a tree like diagram
lsusb -tv
Dislpays USB devices in a tree like diagram
Display hardware information from the BIOS

Network commands

Commands Description
whois domain
Retrives more information about a domain name
dig domain
retrives DNS information about a domain name
dig -x host
Performs reverse lookup on a domain
Performs a IP lookup for a domain name
hostname -I
Display local IP address
wget filename
Download a field from online source
netstat -pnltu
Display all active listining ports

System information commands

Commands Description
It is a utility to measure the time taken by a programe to execute
The files under /proc displays system infromation
Displays the information about the space on the mounted file-system
Displays informationa bout the logged in user including their login time
Prints the name of the currently logged in user
This command displays the time of the logged-out users.
Displays a list of the users and the time/day of their login
It displays the username of the logged in user
Displays memory status
It is used to display the how long the computer has been up and running

File permissions commands

Commands Description
ls -l
To show file type and access permissions
chown -hR root /u
Change the owner of /u and subfiles to "root"
chown root /u
Change the owner of /u to "root"
chown root:staff /u
Likewise, but also change its group to "staff"
chmod +x filename
To make a programme executable
Scroll to Top