Common Commands for Linux
1. File System Navigation:
ls: List directory contents.cd: Change the current directory.pwd: Print the current working directory.mkdir: Create a new directory.rmdir: Remove a directory.cp: Copy files and directories.mv: Move or rename files/directories.rm: Remove/delete files and directories.touch: Create an empty file or update file timestamps.cat: Concatenate and display file content.head: Output the start of a file.tail: Output the end of a file.
2. File Manipulation:
nanoorviorvim: Text editors to create or modify files.grep: Search for specific patterns in files.find: Search for files and directories.chmod: Change file permissions.chown: Change file ownership.tar: Archive files.zip/unzip: Compress and extract files in ZIP format.gzip/gunzip: Compress and decompress files using gzip.
3. System Information
uname: Display system information.toporhtop: Display real-time system processes and their resource usage.df: Display disk space usage.du: Display directory space usage.cat /etc/os-releaseorcat /proc/versionorcat /etc/*-releaseorcat /etc/issueorcat /var/run/motd: Viewing the Linux system version
4. Networking:
ping: Check connectivity to a remote host.ifconfigorip: Display and configure network interfaces.ssh: Securely connect to a remote machine.scp: Securely copy files between machines.wgetorcurl: Download files from the internet.
5. Process Management:
ps: Display information about running processes.kill: Terminate processes by ID or name.killall: Terminate processes by name.jobs: List background jobs.
6. Package Management (for specific package managers):
apt-getorapt: Package management on Debian-based systems.yumordnf: Package management on Red Hat-based systems.pacman: Package management on Arch Linux.
7. User-related:
su -: Switching to theroot.su - username: Switch to another user account.useradd -m newusername: Create a new user account. (the-mflag creates the user’s home directory).passwd username: Set or change a user’s password.userdel username: Remove a user account.who: Display who is logged in.
Common Commands for Linux
https://www.hardyhu.cn/2023/10/23/Common-Commands-for-Linux/