<<

Description

SYSTEM INFORMATION -a Display system information uname -r Display kernel release information Show how long the system has been running + load hostname Show system hostname hostname -I Display the IP addresses of the last reboot Show system reboot date Show the current date and Show this month's calendar Display is online Who you are logged in as

HARDWARE INFORMATION /proc/cpuinfo Display CPU information cat /proc/meminfo Display memory information free -h Display free and used memory Display and manage the top processes Interactive process viewer (top alternative)

User Information And Management id Display the user and group ids of your current user. last Display the last users who have logged onto the system. groupadd Create a group named "test". useradd - "John Smith" Create an account named john, with a -m john comment of "John Smith" and create the user's home . usermod -aG sales john Add the john account to the sales group userdel john Delete the john account.

FILE AND DIRECTORY COMMANDS

Ls List all files in a long listing -l (detailed) format LS -al Display the present directory Create a directory -r directory Remove the directory and its contents recursively rm Remove (delete) file rm -f file Force removal of a file without prompting for confirmation file1 file2 Copy file1 to file2 file1 file2 Rename or move file1 to file2. -s /path/to/file Create a symbolic to linkname linkname file Create an empty file or update the access and modification times of the file. cat file View the contents of the file file Display the first 10 lines of file. file Display the last 10 lines of file. Display your currently running processes. pid Kill process with the process ID of pid program & Start a program in the background

FILE PERMISSIONS

777 rwx rwx rwx chmod 775 filename rwx rwx r-x chmod 755 filename rwx r-x r-x

NETWORKING -a Display all network interfaces and IP address ping host Send ICMP request to host whois domain Display whois information for a domain domain Display DNS information for a domain wget Download http://domain.com/file http://domain.com/file

ARCHIVES (TAR FILES) tar cf archive.tar Create tar named archive.tar directory containing directory. tar xf archive.tar Extract the contents from archive.tar. tar czf archive.tar.gz Create a compressed tar file directory name archive.tar.gz.

SEARCH pattern file Search for a pattern in a file grep -r pattern Search recursively for pattern in directory directory name files and directories by name

find /home/john -name Find files in /home/john that start 'prefix*' with "prefix".

find /home -size +100M Find files larger than 100MB in /home

SSH LOGINS

ssh host Connect to the host as your local username.

scp file.txt Secure copy file.txt to the /tmp server:/tmp folder on serve

.. To go up one level of the directory .

cd Go to the $HOME directory

cd /etc Change to the /etc directory

history Show recently used commands

Source: Linux Training Academy - Linux Commands Cheat Sheet https://www.linuxtrainingacademy.com/linux-commands-cheat-shee t/