






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







find /home - size +100M Find files larger than 100MB in /home whereis program Display the location of the binary, source, and manual page files of program which program Display the path of the executable that would run if the program is executed ssh host Connect to host as your local username ssh user@host Connect to host as user ssh - p port user@host Connect to host using port ssh-keygen Create a new SSH key pair ssh-copy-id user@host Copy SSH key to the remote host to enable passwordless logins for user scp file.txt server:/tmp Secure copy file.txt to the /tmp folder on server scp server:/var/www/*.html /tmp Copy *.html files from server to the local /tmp folder scp - r server:/var/www /tmp Copy all files and directories recursively from server to the current system's /tmp folder rsync - a /home /backups/ Synchronize /home to /backups/home
rsync - avz /home server:/backups/ Synchronize files/directories between the local and remote system with compression enabled ftp host Connect to FTP server on the remote host df - h Show free and used space on mounted filesystems df - i Show free and used inodes on mounted filesystems fdisk - l Display disk partitions sizes and types du - ah Display disk usage for all files and directories in human readable format du - sh Display total disk usage of the current directory du - a directory Display size of all files in directory findmnt List all mounted file systems with details cd .. To go up one level of the directory tree (Change into the parent directory) cd Go to the $HOME directory cd /etc Change to the /etc directory alias goto='cd /etc/' Create goto alias for command cd /etc/ passwd Change the current user's password sudo - i
last reboot Show system reboot history date Show the current date and time cal Show this month's calendar w Display who is online whoami Who you are logged in as dmesg Display messages in kernel ring buffer cat /proc/cpuinfo Display CPU information cat /proc/meminfo Display memory information free - h Display free and used memory (-h for human readable) lspci - tv Display PCI devices lsusb - tv Display USB devices dmidecode Display DMI/SMBIOS (hardware info) from the BIOS hdparm - i /dev/sda Show info about disk sda hdparm - tT /dev/sda Perform a read speed test on disk sda badblocks - s /dev/sda
Test for unreadable blocks on disk sda lshw Display information about CPU, memory, storage, and network interfaces lsblk Display information about all storage devices top Display and manage the top processes htop Interactive process viewer (top alternative) mpstat 1 Display processor related statistics vmstat 1 Display virtual memory statistics iostat 1 Display I/O statistics tail - 100 /var/log/messages Display the last 100 syslog messages tcpdump - i eth Capture and display all packets on interface eth tcpdump - i eth0 'port 80' Monitor all traffic on port 80 (HTTP) lsof List all open files on the system lsof - u user List files opened by user watch df - h Execute 'df - h', showing periodic updates pidstat Display statistics about processes running
Copy source_directory recursively to destination mv file1 file Rename or move file1 to file touch file Create an empty file or update the access and modification times of file cat file View the contents of file less file Browse through a text file head file Display the first 10 lines of file tail file Display the last 10 lines of file tail - f file Display the last 10 lines of file and 'follow' the file as it grows ps Display your currently running processes ps - ef Display all the currently running processes on the system ps - ef | grep processname Display process information for processname kill pid Kill process with process ID of pid killall processname Kill all processes named processname program & Start program in the background bg Display stopped or background jobs
fg Brings the most recent background job to foreground fg n Brings job n to the foreground nohup processname Runs a process even after user logs out chmod 777 filename Change file permissions to read, write, and execute for user, group, and world (use sparingly!) chown john /path/to/file Change ownership of /path/to/file to john chgrp sales /path/to/file Change group ownership of /path/to/file to group sales ip a Display all network interfaces and IP address ip addr show dev eth Display eth0 address and details ethtool eth Query or control network driver and hardware settings ping host Send ICMP echo request to host whois domain Display whois information for domain dig domain Display DNS information for domain dig - x IP_ADDRESS Reverse lookup of IP_ADDRESS host domain Display DNS IP address for domain hostname - i
rpm - i package.rpm Install package from local file named package.rpm yum remove package Remove/uninstall package for RHEL based systems yum update package Update package with name package for RHEL based systems tar zxvf sourcecode.tar.gz Extract software from source code apt-get update Update package list for Debian based systems apt-get upgrade Upgrade all installed packages to their newest version for Debian based systems apt-get install package Install package with name package for Debian based systems apt-remove package Remove package with name package for Debian based systems grep pattern file Search for pattern in file grep - r pattern directory Search recursively for pattern in directory locate name Find files and directories by name find /home/john - name 'prefix*' Find files in /home/john that start with 'prefix'