Skip to content

Basic Commands


Generally speaking you execute a command with some arguments and flags.


An argument is just some string given to the binary. For example in the command to change to your Documents directory cd Documents, Documents is the argument.

Flags (or OPTIONS)

Flags are used to modify the behavior of a command. For example ls -a, -a tells the ls executable to list all files in the directoy, including hidden ones. Flags are also called OPTIONS.



Change Directory, changes your "working directory" to the specified folder. For example cd Documents changes to your documents folder


Print Working Directory. Outputs your current working directory to console. Something like /home/user/Documents/.


LiSt files. Lists the files in your current directory. Use the -a flag to see hidden folders.


Echos the string given as an argument.

More resources

Under The Hood


A command is really just an executable found in your $PATH. PATH is the envoirment variable that holds where to look for executables. You can see the value of this by executing echo $PATH.

Envoirment Variables

Envoirment Variables are variables used to pass into executables. PATH is an envoirmental variable, so is HOME. You can see them all with env, and set them with export NAME=VALUE.

Getting Home

~ in most shells is replaced with your home directory (normally /home/USERNAME). You can get the absolute path of your home directory with echo $HOME, or just go home with a quick cd (no arguments needed).