ls
cd dir_name
mkdir rohan
rmdir rohan
pwd
cp example.txt backup/
mv - move or rename files or directories
mv example.txt backup/
rm - remove files or directories
rm example.txt
touch - create a new empty file or update the timestamp of an existing file
touch shayan.txt
cat - concatenate and display files
cat example.txt
man - manual for a command
man ls
htop - an interactive process viewer and system monitor
htop
chmod - change the permissions of a file or directory
chmod 700 file.txt
chown - change the owner of a file or directory
chown new_owner example.txt
tar - create or extract compressed archive files
tar cf archive.tar file1 file2 file3
gzip - compress files
gzip file.txt
gunzip - decompress compressed files
gunzip file.txt.gz
ssh - connect to a remote server securely
ssh username@server_address
scp - securely copy files between systems
scp myfile.txt user@remotehost:/home/user/
ping - test network connectivity
ping 8.8.8.8
ifconfig - display or configure network interfaces
ifconfig
netstat - display network connection information
netstat
route - view or configure network routing tables
route [options] [add/delete/show]
top - display system resource usage and processes
top
ps - display information about running processes
ps aux
kill - terminate a process
kill [PID]
systemctl - control system services and settings
systemctl start nginx
systemctl status nginx
systemctl stop nginx
service - control system services
service apache2 start
useradd - add a new user to the system
useradd harry
passwd - change the password for a user
passwd harry
userdel - delete a user from the system
userdel harry
su - switch user to become another user
su john
sudo - execute a command as another user or with elevated privileges
sudo
uptime - display system uptime and load average
uptime
df - display disk space usage
df
du - display disk usage by file or directory
du
mount - mount a file system
sudo mount /dev/sdb1 /mnt/usb
umount - unmount a file system
sudo umount /mnt/usb
date - display or set the system date and time
date
whoami - display the current user name
whoami
which - locate a program or command in the system path
which ls
finger - displays all the information about a user
finger harry
uname - display system information
uname uname -a
history - display a list of previously executed commands
history
echo - display text or variables to the console
echo 'I need Tshirt from codeswear!'
tee - redirect output to both a file and the console
ls | tee file.txt
locate - locate any file on the system
locate file.txt
sort - sort lines of text in a file or input
cat file.txt
sort file.txt
uniq - remove duplicate lines from a file or input
cat file.txt
uniq file.txt
head/tail - display the first/last few lines of a file or input
head file.txt
tail file.txt