List directory contents
ls -laUse 'ls -lah' for most comprehensive view
Change directory
cd /path/to/directoryUse 'cd -' to toggle between last two directories
Print working directory
pwdShows the full path of current directory
Copy files and directories
cp -r source destinationMove/rename files and directories
mv oldname newnameRemove files or directories
rm -rf directoryBe careful with rm -rf, it's irreversible!
Change file permissions
chmod 755 file.txtUse numeric (777) or symbolic (u+x) notation
Report process status
ps auxDisplay system processes
topTerminate processes
kill -9 PIDNetwork statistics
netstat -tulpnTest network connectivity
ping -c 4 google.comSecure shell remote login
ssh user@hostnameControl the systemd system and service manager
systemctl status service-nameQuery the systemd journal
journalctl -u service-nameReport file system disk space usage
df -hCreate a new user
useradd -m usernamePackage management
apt install package-nameUse apt-get for scripts, apt for interactive use
Search text patterns in files
grep 'pattern' file.txtUse -R for recursive search including symlinks
Search for files in directory hierarchy
find /path -name '*.txt'Powerful tool for finding files with various criteria
Archive files
tar -czvf archive.tar.gz directory/Common formats: .tar.gz, .tgz, .tar.bz2
Download files from the web
wget https://example.com/fileTransfer data from/to a server
curl -X GET https://api.example.comEstimate file space usage
du -sh *Display memory usage
free -hInteractive process viewer
htopMore user-friendly alternative to top
Command line history
history | grep sshUse !n to execute command number n from history
Output the last part of files
tail -f /var/log/syslogCommonly used for log monitoring
Output the first part of files
head -n 10 file.txtView file content with pagination
less file.txtMore feature-rich than more command
Change file owner and group
chown user:group fileExecute command as superuser
sudo commandUse sudo -i for root shell
Print system information
uname -a