Common shell commands#

File and Directory Management#

  • ls - List directory contents.

  • cd - Change the current directory.

  • pwd - Print the current working directory.

  • mkdir - Create a new directory.

  • rmdir - Remove an empty directory.

  • rm - Remove files or directories.

  • cp - Copy files or directories.

  • mv - Move or rename files or directories.

  • touch - Create an empty file or update a file’s timestamp.

File Viewing and Editing#

  • cat - Concatenate and display file contents.

  • less - View file contents one screen at a time.

  • more - View file contents (similar to less).

  • nano - Open a simple text editor.

  • vim - Open the Vim text editor.

File Permissions and Ownership#

  • chmod - Change file permissions.

  • chown - Change file ownership.

Process Management#

  • ps - Display information about running processes.

  • top - Show real-time system processes.

  • kill - Terminate a process by PID.

Networking#

  • ping - Test network connectivity.

  • curl - Transfer data from or to a server.

  • wget - Download files from the web.

Searching and Filtering#

  • grep - Search for patterns in files.

  • find - Search for files and directories.

  • awk - Pattern scanning and processing.

  • sed - Stream editor for filtering and transforming text.

System Information#

  • whoami - Show the current user.

  • uname - Display system information.

  • df - Show disk space usage.

  • du - Show directory or file size.

Archiving and Compression#

  • tar - Archive files.

  • gzip - Compress files.

  • gunzip - Decompress files.

Miscellaneous#

  • echo - Print text to the terminal.

  • history - Show command history.

  • alias - Create shortcuts for commands.

  • man - Display the manual for a command.