Common Commands for Linux

1. File System Navigation:

  1. ls: List directory contents.
  2. cd: Change the current directory.
  3. pwd: Print the current working directory.
  4. mkdir: Create a new directory.
  5. rmdir: Remove a directory.
  6. cp: Copy files and directories.
  7. mv: Move or rename files/directories.
  8. rm: Remove/delete files and directories.
  9. touch: Create an empty file or update file timestamps.
  10. cat: Concatenate and display file content.
  11. head: Output the start of a file.
  12. tail: Output the end of a file.

2. File Manipulation:

  1. nano or vi or vim: Text editors to create or modify files.
  2. grep: Search for specific patterns in files.
  3. find: Search for files and directories.
  4. chmod: Change file permissions.
  5. chown: Change file ownership.
  6. tar: Archive files.
  7. zip/unzip: Compress and extract files in ZIP format.
  8. gzip/gunzip: Compress and decompress files using gzip.

3. System Information

  1. uname: Display system information.
  2. top or htop: Display real-time system processes and their resource usage.
  3. df: Display disk space usage.
  4. du: Display directory space usage.
  5. cat /etc/os-release or cat /proc/version or cat /etc/*-release or cat /etc/issue or cat /var/run/motd: Viewing the Linux system version

4. Networking:

  1. ping: Check connectivity to a remote host.
  2. ifconfig or ip: Display and configure network interfaces.
  3. ssh: Securely connect to a remote machine.
  4. scp: Securely copy files between machines.
  5. wget or curl: Download files from the internet.

5. Process Management:

  1. ps: Display information about running processes.
  2. kill: Terminate processes by ID or name.
  3. killall: Terminate processes by name.
  4. jobs: List background jobs.

6. Package Management (for specific package managers):

  1. apt-get or apt: Package management on Debian-based systems.
  2. yum or dnf: Package management on Red Hat-based systems.
  3. pacman: Package management on Arch Linux.
  1. su -: Switching to the root.
  2. su - username: Switch to another user account.
  3. useradd -m newusername: Create a new user account. (the -m flag creates the user’s home directory).
  4. passwd username: Set or change a user’s password.
  5. userdel username: Remove a user account.
  6. who: Display who is logged in.

Common Commands for Linux
https://www.hardyhu.cn/2023/10/23/Common-Commands-for-Linux/
Author
John Doe
Posted on
October 23, 2023
Licensed under