Linux is a Unix-like, open source and community-developed operating system (OS) for computers, servers, mainframes, mobile devices and embedded devices. It is supported on almost every major computer platform, including x86, ARM and SPARC, making it one of the most widely supported operating systems.
hostnamectl
Get system information including, operating system, kernel, and release version.
date
Display the current system date and time
hostname
Display the hostname of the system
ifconfig
Display the IP and Mac Address of the system
w
Display currently logged in users in the system
free -m
Display free and used memory in the system
top
Display all running processes
ls
List all files and directories in the current working directory
ls -al
List all files and directories including, hidden files and other information like permissions, size, and owner
cd
Change the directory to the home directory
cd ..
Change the directory to one level up
cat filename
Display the content of the file
cat file1 file2 > file3
Combine two files named file1 and file2 and store the output in a new file file3
tail filename
Display the last 10 lines of a file
head filename
Display the first 10 lines of a file
mv oldfile newfile
Rename a file
rm filename
Delete a file
mkdir dirname
Create a directory
rm -rf dirname
Remove a directory
history
Print a history list of all commands
clear
Clear the terminal
shutdown -h now
Shut down the system
reboot
Restart the system
pwd
print working directory
exit
close the terminal
ls -l filename
Check the current permission of any file
chmod 777 filename
Assign full(read, write, and execute) permission to everyone
chmod -R 777 dirname
Assign full permission to the directory and all sub-directories
chmod 766 filename
Assign full permission to the owner, and read and write permission to group and others
chmod -x filename
Remove the execution permission of any file
chown username filename
Change the ownership of a file
chown user:group filename
Change the owner and group ownership of a file
chown -R user:group dirname
Change the owner and group ownership of the directory and all sub-directories
w
Display all login users
useradd username
Add a new user account
userdel -r username
Delete a user account
usermod [option] username
Change the user account information including, group, home directory, shell, expiration date
usermod -aG groupname username
Add a user to a specific group
groupadd groupname
Create a new group
groupdel groupname
Remove a group
last
Display information of the last login user
id
Display UID and GID of the current user
ps
Display all active processes
ps -ef | grep processname
Display information of specific process
top
Manage and display all processes in realtime
pstree
Display processes in the tree-like diagram
lsof
List all files opened by running processes
kill pid
Kill a specific process using process ID
killall processname
Kill all processes by name
bg
Display stopped or background jobs
pidof processname
Get the PID of any process