Cheat Sheet - Commonly used Linux commands - Part 2

Cheat Sheet - Commonly used Linux commands - Part 2

  1. iwconfig: Displays information about wireless network interfaces. Example: iwconfig shows the configuration of wireless network interfaces.

  2. chmod: Changes the permissions of files and directories. Example: chmod 755 file.txt changes the permissions of file.txt.

  3. chown: Changes the owner of files and directories. Example: chown user:group file.txt changes the owner and group of file.txt.

  4. chroot: Changes the root directory for a command. Example: chroot /newroot /bin/bash runs the /bin/bash command with /newroot as the root directory.

  5. tar: Archives files into a tarball. Example: tar -cvf archive.tar file1 file2 creates an archive named archive.tar containing file1 and file2.

  6. gzip: Compresses files. Example: gzip file.txt compresses file.txt into file.txt.gz.

  7. gunzip: Decompresses files. Example: gunzip file.txt.gz decompresses file.txt.gz into file.txt.

  8. ps: Displays information about running processes. Example: ps aux shows a detailed list of all processes.

  9. kill: Terminates processes. Example: kill PID terminates the process with the specified PID.

  10. top: Displays real-time system information. Example: top shows a dynamic view of system processes and resource usage.

  11. df: Shows disk space usage. Example: df -h displays disk space usage in a human-readable format.

  12. du: Displays disk usage of files and directories. Example: du -sh directory shows the total disk usage of the directory in a human-readable format.

  13. free: Shows system memory usage. Example: free -m displays memory usage in megabytes.

  14. ln: Creates links to files. Example: ln -s target link creates a symbolic link named link pointing to the target.

  15. watch: Executes a command repeatedly and displays the output. Example: watch -n 1 ls -l executes ls -l every 1 second and displays the output.

  16. lsof: Lists open files and the processes that opened them. Example: lsof /path/file shows the processes that have the specified file open.

  17. ssh-keygen: Generates SSH keys for secure authentication. Example: ssh-keygen -t rsa generates an RSA SSH key pair.

  18. scp: Securely copies files between different hosts. Example: scp file.txt user@remotehost:/path copies file.txt to the specified path on the remote host.

  19. rsync: Synchronizes files and directories between two locations. Example: rsync -avz source/ destination/ synchronizes the contents of the source directory with the destination directory.

  1. awk: A powerful text processing tool for extracting and manipulating data within files. Example: awk '{print $1}' file.txt prints the first column of data in file.txt.

  2. sed: A stream editor for filtering and transforming text. Example: sed 's/old/new/g' file.txt replaces all occurrences of "old" with "new" in file.txt.

  3. find: Searches for files and directories based on specified criteria. Example: find /path -name "file*.txt" searches for files starting with "file" and ending with ".txt" in the specified path.

  4. locate: Quickly finds files by name. Example: locate file.txt locates the file named file.txt.

  5. history: Displays a list of previously executed commands. Example: history | tail -n 10 shows the last 10 commands from the history.

  6. useradd: Adds a new user to the system. Example: useradd newuser adds a user named newuser.

  7. userdel: Deletes a user from the system. Example: userdel olduser deletes the user named olduser.

  8. passwd: Allows users to change their passwords. Example: passwd prompts the user to change their password.

  9. su: Switches to another user account. Example: su - username switches to the account of the specified username.

  10. sudo: Executes commands with superuser privileges. Example: sudo command executes the specified command with elevated permissions.

  11. chroot: Changes the root directory for a command. Example: chroot /newroot /bin/bash runs the /bin/bash command with /newroot as the root directory.

  12. tar: Archives files into a tarball. Example: tar -cvf archive.tar file1 file2 creates an archive named archive.tar containing file1 and file2.

  13. gzip: Compresses files. Example: gzip file.txt compresses file.txt into file.txt.gz.

  14. gunzip: Decompresses files. Example: gunzip file.txt.gz decompresses file.txt.gz into file.txt.

  15. ps: Displays information about running processes. Example: ps aux shows a detailed list of all processes.

  16. kill: Terminates processes. Example: kill PID terminates the process with the specified PID.

  17. top: Displays real-time system information. Example: top shows a dynamic view of system processes and resource usage.

  18. df: Shows disk space usage. Example: df -h displays disk space usage in a human-readable format.

  19. du: Displays disk usage of files and directories. Example: du -sh directory shows the total disk usage of the directory in a human-readable format.

  20. free: Shows system memory usage. Example: free -m displays memory usage in megabytes.

Certainly! Here are 20 more commonly used Linux commands:

  1. awk: A powerful text processing tool for extracting and manipulating data within files. Example: awk '{print $1}' file.txt prints the first column of data in file.txt.

  2. sed: A stream editor for filtering and transforming text. Example: sed 's/old/new/g' file.txt replaces all occurrences of "old" with "new" in file.txt.

  3. find: Searches for files and directories based on specified criteria. Example: find /path -name "file*.txt" searches for files starting with "file" and ending with ".txt" in the specified path.

  4. locate: Quickly finds files by name. Example: locate file.txt locates the file named file.txt.

  5. history: Displays a list of previously executed commands. Example: history | tail -n 10 shows the last 10 commands from the history.

  6. useradd: Adds a new user to the system. Example: useradd newuser adds a user named newuser.

  7. userdel: Deletes a user from the system. Example: userdel olduser deletes the user named olduser.

  8. passwd: Allows users to change their passwords. Example: passwd prompts the user to change their password.

  9. su: Switches to another user account. Example: su - username switches to the account of the specified username.

  10. sudo: Executes commands with superuser privileges. Example: sudo command executes the specified command with elevated permissions.

  11. chroot: Changes the root directory for a command. Example: chroot /newroot /bin/bash runs the /bin/bash command with /newroot as the root directory.

  12. tar: Archives files into a tarball. Example: tar -cvf archive.tar file1 file2 creates an archive named archive.tar containing file1 and file2.

  13. gzip: Compresses files. Example: gzip file.txt compresses file.txt into file.txt.gz.

  14. gunzip: Decompresses files. Example: gunzip file.txt.gz decompresses file.txt.gz into file.txt.

  15. ps: Displays information about running processes. Example: ps aux shows a detailed list of all processes.

  16. kill: Terminates processes. Example: kill PID terminates the process with the specified PID.

  17. top: Displays real-time system information. Example: top shows a dynamic view of system processes and resource usage.

  18. df: Shows disk space usage. Example: df -h displays disk space usage in a human-readable format.

  19. du: Displays disk usage of files and directories. Example: du -sh directory shows the total disk usage of the directory in a human-readable format.

  20. free: Shows system memory usage. Example: free -m displays memory usage in megabytes.

Did you find this article valuable?

Support CloudOpsAcademy - Prashanth Katkam by becoming a sponsor. Any amount is appreciated!