Here are some basic Linux commands to get you up and running, or a quick cheat sheet. Great for when working on a Raspberry Pi or any other single board computers which use Linux commands such as Beagleboard / Beaglebone, Asus Tinker Board and many others.



  • ls – directory listing (list all files/folders on current directory)
  • ls -l – directory listing, with the file details in a formatted way, easier to read
  • ls -la – directory listing the same as ls -l but this will also display hidden files
  • cd dir – change directory to dir (dir will be directory name)
  • cd .. – change to the parent directory
  • cd ../dir – change to dir in the parent directory (dir is replaced with a specific directory)
  • cd – change to the home directory
  • pwd – show current directory
  • mkdir dir – create a directory dir (replace dir with your chosen name)
  • rm file – delete a file
  • rm -f dir – force remove a file
  • rm -r dir – delete directory dir
  • rm -rf dir – remove directory dir
  • rm -rf / – if run by a superuser, will delete every file on the system (DO NOT DO THIS)
  • cp file1 file2 – copy file1 to file2
  • mv file1 file2 – rename file1 to file2
  • mv file1 dir/file2 – move file1 to dir as file2
  • touch file – create or update file
  • cat file – output contents of a file
  • cat > file – write standard input into a file
  • cat >> file – append standard input into a file
  • tail -f file – output contents of a file as it grows


  • ping host – ping host
  • whois domain – get whois for a domain
  • dig domain – get DNS for domain
  • dig -x host – reserve lookup host
  • wget file – download file
  • wget -c file – continue a stopped download
  • wget -r url – recursively download files from a URL
  • curl url – outputs the webpage from a URL
  • curl -o hello.html URL – writes the page to hello.html
  • ssh user@host – connect to host as user
  • ssh -p port user@host – connect using port
  • ssh -D user@host – connect & use bind port


  • ps – display currently active processes
  • ps aux – detailed outputs
  • kill pid – kill process with process id (pid)
  • killall proc – kill all processes named proc


  • date – show current date / time
  • uptime – show uptime
  • whoami – current logged in user
  • w – display who is online
  • cat /proc/cpuinfo – displays CPU information
  • cat /proc/meminfo – displays memory information
  • free – show memory and swap usage
  • du – show directory space usage
  • du -sh – displays readable sizes in GB
  • df – show disk usage
  • uname -a – show all kernel information. Alternatively, if you only want specific information, you can change the “-a” switch to any of these for different information: “-m, -r, -v, -n”
  • sudo lshw – calls the lshw tool which gathers vast information about the computer’s hardware such as CPU, disks, memory, USB controllers etc
  • lscpu – display CPU information
  • lsusb – displays USB controllers information
  • lspci – displays PCI devices information


  • tar cf file.tar files – tar files into file.tar
  • tar xf file.tar – untar into a current directory
  • tar tf file.tar – show contents of archive
    • Switches:
      • c – create an archive
      • t – table of contents
      • x – extract
      • z – use zip/gzip
      • f – specify a filename
      • j – bzip2 compression
      • w – ask for confirmation
      • k – do not overwrite
      • T – files from a file
      • v – verbose


  • chmod octal file – change permissions of a file
    • 4 – read (r)
    • 2 – write (w)
    • 1 – execute (x)

order owner/group/world

  • chmod 777 -rwx for everyone
  • chmod 755 – rw for the owner, rx for group world


  • grep pattern files – search in files for a pattern
  • grep -r pattern dir – search for pattern recursively in dir
  • locate file – find all instances of a file
  • whereis app – show possible locations of app
  • man command – show manual page for a command
Someone in STRATHFIELD SOUTH bought a
Arduino Nano 3.0 Atmel ATmega328 Mini-USB Board + 1 Item
about 3 hours ago
Someone in MT WAVERLEY bought a
Raspberry Pi 3 Model B+
about 3 hours ago
Someone in MELBOURNE bought a
5mW 650nm Red Line Laser Module Focus Adjustable Laser Head 5V Industrial Grade + 1 Item
about 4 hours ago
Someone in OAKLANDS PARK bought a
about 6 hours ago
Someone in GLENWOOD bought a
AM/FM Portable Radio with USB MP3 Player LED Torch 10 Hour Battery Life
about 9 hours ago
MT3608 Step-Up Adjustable DC-DC Switching Power Module Boost Converter
Someone in ALKIMOS bought a
MT3608 Step-Up Adjustable DC-DC Switching Power Module Boost Converter
about 13 hours ago
Someone in MAYFIELD WEST bought a
ST-Link V2 ST-Link Mini STM In-Circuit Programmer and Debugger for STM8 and STM32 – with Cover + 2 Items
about 16 hours ago
Someone in TURRAMURRA bought a
Arduino Nano 3.0 Atmel ATmega328 Mini-USB Board
about 19 hours ago
Someone in MAROUBRA bought a
Raspberry Pi 3 Model B+
about 1 day ago
DHT22 Digital Temperature & Humidity Sensor
Someone in DARRA bought a
DHT22 Digital Temperature and Humidity Sensor AM2302 + 1 Item
about 22 hours ago
Share This