Abertay Ethical Hacking Society
  • Home
  • Information
    • Constitution
    • Change Logs
      • Website
      • Discord
      • Github
      • Server
    • Meetings
      • 2021-2022
    • Honourary Members
  • Contributing
    • Contributions
      • Using Git
      • Formatting and Best Practise
  • Society Events
    • Securi-Tay
      • History
  • Help Guides
    • Programming / Scripting
      • AWK
      • Bash Scripting
      • C Coding
      • Java Coding
      • LaTeX
      • Markdown
      • Project Ideas
      • Python Scripting
      • Tools
    • Software
      • Operating Systems
        • Installing Arch
        • Installing Kali
        • Linux Commands for Beginners
        • MacOS
      • Tools
        • PGP
          • A guide to using PGP on Android
          • A guide to using PGP on macOS
          • PGP
        • Radare2
        • Nmap
        • Regular Expressions
        • The Browser Exploitation Framework (BeEF)
        • Vim
        • Vimium
        • Zsh
    • Networking
      • Domain Name System (DNS)
      • Remote access to your Abertay network drive
      • Secure Shell (SSH)
      • TLS 1.3
      • Wireshark
      • Subnetting
    • Techniques
      • A guide to creating malicious macro-enabled Excel worksheets
      • Open Source Intelligence (OSINT)
      • Google-Fu
    • Jobs
      • Common Interview Questions
    • Home Lab
      • PiHole
  • Glossary
    • Infosec Terms
    • Computing Terms
    • Hardware Terms
    • General Terms
    • Development Terms
    • Networking Terms
  • Members
    • Profiles
      • AG
      • Isaac
      • Sam
  • Other
    • Other
      • Data Dumps
      • Meetups
      • Meltdown & Spectre
      • Movies
      • Project topic suggestions
      • Recommended Reading
Powered by GitBook
On this page
  • man
  • ls
  • cd
  • sudo
  • mkdir and touch
  • cp and mv
  • grep
  • awk
  • sed
  • less and more
  • | (pipe)
  • xargs
  • test
  • time

Was this helpful?

  1. Help Guides
  2. Software
  3. Operating Systems

Linux Commands for Beginners

A list of the most useful linux commands and what they do (for beginners)

PreviousInstalling KaliNextMacOS

Last updated 3 years ago

Was this helpful?

By

This article will describe some basic commands that you may use on a regular basis in Linux.

man

One of the most important commands to know as a beginner to Linux, this command returns a manual page for any given command. for example, you could type man nmap to return the manual page for the nmap tool.

A typical man page will give you the name of the tool, its general usage syntax (e.g. nmap's is nmap [Scan Type...] [Options] {target specification}), a description of some form (normally a couple of paragraphs), and then the remainder of it will normally be options, switches, ways of altering the behaviour of the tool, and example of how to use it.

Typically, if a command doesn't have a man page, using the -h/--help flag allows the user to view some usage info (such as helpful additional flags etc.)

ls

ls is a standard Linux tool that allows a user to list information about the files in a certain directory. If used without switches (simply typing ls), then the program will just list the names of files, subdirectories, and programs in that directory at that time. If used with switches, however, a user can get much more information out of the directory.

Arguably the most common switches to append to ls would be -a and -l (often grouped together, written as ls -al or ls -la). the -a switch lists all of the hidden entries (filenames beginning with a full stop), and -l "uses a long listing format", which includes significantly more information, such as read-write permissions, owner, date and time of creation, and size.

cd

cd stands for change directory, this is the standard navigation command and allows you to traverse your entire filesystem (provided you have the ability to access it all).

There are various options you can give it, that can all be used in tandem with one another, for example, starting from the home directory, you can cd into Documents by typing cd Documents, then you can return to the home directory either by typing cd ../ (with ../ being the option for go out one directory) or cd ~, where ~ is the symbol specifically for the home directory. Additionally you can specify absolute paths from root by beginning your command with /, for example cd /var/tmp takes you first to root (symbolised as /), then to the var subdirectory, and finally to the tmp subdirectory.

(a little hint: to speed up typing, you can press tab on your keyboard when you've written enough of the word, for example cd Doc[tab] will autocomplete to cd Documents)

sudo

sudo (which stands for SUperuser DO) is the command you use when you want to perform an action as root, (known as administrator in Windows). Most of the time this command will be used when making changes to your system, such as installing a new piece of software or editing a config file.

mkdir and touch

mkdir creates a new directory, and touch creates a new file.

cp and mv

cp copies a file from one location to another, and mv moves it. mv also has the secondary function of renaming a file if the file path specified is the same as the current location of the file in question.

grep

awk

sed

less and more

| (pipe)

xargs

test

time

Isaac
the nmap man page in a stock Ubuntu terminal
ls and ls -al demonstrated in a stock home directory in Ubuntu
changing directories to move all around the filesystem
using the apt package manager to install neofetch, this is a process that requires sudo
making a new directory called "test", cd'ing into it, and making a file called "test.txt"
copying test.txt to another file and then moving the original file (renaming it in this case)