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

References:

  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‘ 
  4. Youtube: ‘Learning the Linux File System
  5. Youtube: ‘Linux Tips: 10 Useful Linux Commands
  6. Document:  Intro-to-Command

Bitnami