Beginner Linux Cheatsheet -Basic Commands for linux

Here is a brief Linux cheat sheet that covers some commonly used commands and concepts:

Navigation

  • pwd: Print current working directory
  • ls: List contents of current directory
  • cd: Change directory
  • cd ..: Move up one directory level
  • mkdir: Create a new directory
  • rmdir: Remove a directory
  • rm: Remove a file
  • cp: Copy a file or directory
  • mv: Move or rename a file or directory

File Operations

  • cat: Display contents of a file
  • less: Display contents of a file one page at a time
  • head: Display first few lines of a file
  • tail: Display last few lines of a file
  • touch: Create an empty file or update the modification time of an existing file
  • chmod: Change permissions of a file or directory
  • chown: Change ownership of a file or directory

System Information

  • uname: Print system information
  • uptime: Print system uptime
  • df: Show disk usage
  • free: Show memory usage
  • top: Display system processes and their resource usage

Networking

  • ping: Test network connectivity to a host
  • traceroute: Show the network path to a host
  • ifconfig: Display network interface information
  • netstat: Display network connections and their status

Package Management

  • apt-get: Install, remove, or update packages on Debian-based systems
  • yum: Install, remove, or update packages on Red Hat-based systems
  • pacman: Install, remove, or update packages on Arch-based systems

Users and Groups

  • useradd: Add a new user
  • usermod: Modify an existing user
  • passwd: Change a user's password
  • groupadd: Add a new group
  • groupmod: Modify an existing group
  • userdel: Delete a user
  • groupdel: Delete a group

Miscellaneous

  • history: Show command history
  • sudo: Run a command with administrative privileges
  • grep: Search for a pattern in a file or output
  • tar: Create or extract a compressed archive
  • ssh: Connect to a remote system via SSH

This cheatsheet only scratches the surface of what's possible with Linux, but it should give you a good starting point for working with the command line.