uname -a– display kernel and OS infolsb_release -a– Ubuntu version detailshostnamectl– show hostname and hardware info
ls -la– list all files with permissionscd /path/to/dir– change directorypwd– print working directorytree– directory tree (install withsudo apt install tree)
cp source dest– copy filesmv source dest– move/rename filesrm file– delete file (use-rfor directories)chmod 755 file– change permissionschown user:group file– change ownership
sudo apt update– refresh package listssudo apt upgrade– upgrade installed packagessudo apt install package_name– install a packagesudo apt remove package_name– remove a packageapt search keyword– search for packages
top/htop– view running processesdf -h– disk space usagefree -h– memory usagesystemctl status service– check service status
ip a– show network interfacesping hostname– test connectivitynetstat -tulpn– list listening portssudo apt install net-tools– providesnetstat
adduser username– create new userdeluser username– delete userusermod -aG sudo username– add to sudo group
sudo systemctl start servicesudo systemctl stop servicesudo systemctl enable servicesudo systemctl disable service
cat file– display file contentsgrep 'pattern' file– search within filessudo shutdown -h now– immediate shutdownsudo reboot– reboot system
Tip: Most commands have
--helpfor usage details, and you can use the man pages (man <command>).