Basic Linux Commands:

Understanding Linux and the basic Linux commands are critical prereqs for a cyber competition. We recommend the following free ‘Linux of Noobs’ hands-on course to learn basic linux commands. Below are examples of important Linux commands for accessing, navigating, creating/manipulating files and using Linux resources.

Examples of commands used in Competion Challenges:

  1. Navigate directories and subdirectories – ‘cd /[target directory]
  2. Find Files – ‘find [filename]
  3. Display files – ‘cat [filename]
  4. Search for data in files – grep [data string] [filename]
  5. Compare files – ‘cmp [filename1] [filename2]
  6. Determine file type – ‘file [filename]
  7. Unzip files – gzip or bzip [filename]
  8. Change file mode or ownership – ‘chmod [filename] and ‘chown [filename]
  9. list files and subdirectories within a directory and understand the privledges: ‘ls /[current dir]

Key Commands:

  • Access / Help :
    • ssh               log into a remote machine 
    • curl              transfer data from/to server
    • man             Help details 
  • Navigating:
    • pwd             Print Working Directory
    • ls                  Print directory
    • cd                 Change Directory
    • whoami      Display the current user
    • history         List previous commands
    • locate          find files and directories
  • Elevating User Privilege
    • su                 change user or superuser
    • sudo            temporarily superuser
    • chmod         modify file access rights
    • chown         change file ownership
    • chgrp           change group ownership
  • File Management
    • File               file type.   (e.g. ‘ASCII text’)
    • cat               Print file contents
    • zip               Create and extract zip
    • touch           Create a blank file 
    • Grip             Search for strings in a file
    • WC               Count words, lines or chars
    • Sort              Sort the content of a file  
    • cp                 Copy files and directories
    • mv               Move or rename dir or file 
    • rm               Remove dir or files  
    • mkdir           Make Directory  
    • rmdir           Remove Directory   
    • head            print first few lines 
    • tail               prints last 10 lines( default)
    • md5sum      Check for file tamper
  • Environment/Network:
    • free              free and used RAM
    • uname         basic system info including kernel name, version, and release.
    • top              running and active real-time processes
    • netstat         network packets statistics
    • tcpdump      capture or filter TCP/IP packets
    • ifconfg         displaying current network configuration information
  • Updates / Upgrades:
    • sudo apt update -y (Make sure all system updates are applied)
    • sudo apt upgrade -y (Make sure system upgrades are applied)

Linux File System

  1. PicoCTF Learning Guide: Linux and Command Prompt – Basics and How to: (5 pages)
  2. Education: ‘Linux of Noobs’
  3. Youtube: ‘Intro to Linux and basic commands for beginners‘ (18:45)
  4. Youtube: NCL Summer Live – Linux Command Line – Sep 14 2021 (01:07:14)
  5. Youtube: ‘Learning the Linux File System‘ (25:08)
  6. Youtube: ‘Linux Tips: 10 Useful Linux Commands‘ (34:34)
  7. Youtube: Capture the Flag: SSH Basics (05:05)
  8. Document:  Intro-to-Command Line
  9. Bash Shell Reference (manual)Univ Washington
  10. Nano Editor Cheet Sheet 
  11. Youtube: Linux Terminal 201: Using the Find Command Pt 1 – HakTip 15  (09:03)
  12. Youtube: Linux Terminal 201: Using the Find Command Pt 2 – HakTip 16  (10:27)
  13. Youtube: Linux Terminal 201: Networking Commands You Should Know! – HakTip 152 (09:51)
  14. Youtube: Linux Terminal 201: How To Use Man Pages – HakTip 155 (xx:xx)
  15. Youtube: Linux Terminal 201: Searching and Locating Files – HakTip 157 (xx:xx)
  16. Youtube: Linux Terminal 201: How To Use Grep! – HakTip 158 (8:31)
  17. Youtube: Linux Terminal 201: Using Brackets with Grep – HakTip 160 (8:01)
  18. Youtube: HakTip – Linux Terminal 101 – File Manipulation (6:25)
  19. Youtube:  How to Use Cat, Sort, and Uniq: Linux Terminal 201 – HakTip 0167   (14:13)
  20. Youtube: How to Use Cut, Paste, and Join: Linux Terminal 201 – HakTip 168 (09:08)
  21. Youtube: HakTip – Linux Terminal 101 – I/O Redirection of Standard Outputs (07:25)
  22. Youtube: HakTip – Redirecting Standard Terminal Errors in Linux (3:25)
  23. Youtube: Linux Terminal 201: ifconfig vs ip – HakTip 154 (xx:xx)