Command Line Interface cheatsheet

Posted by Alice Brunel on September 17, 2019

Abbreviation

  • CLI: Command Line Interface
  • GUI: Graphical User Interface

These two type of interfaces allow the user to use the complete functionalities of a computer, by using a SHELL program. The SHELL is a program started by the terminal (CLI or GUI) and which will prompt the user for input and return the output. Bash is the shell used by Unix systems (in Mac OS and Linux).

Useful commands (Windows / MacOs)

whoami
    |_    shows which account you are logged in
cd or pwd
    |_    prints current directory
cd..
    |_    moves up to one directory
cd.
    |_    moves to current directory
dir or ls
    |_    prints the list of the files within the current directory
dir pathname\directory
    |_    prints the list of the files within another directory
move or mv /directorypath
    |_    moves the files to the specified directory
move or mv name.ext newname.ext
    |_    renames the file (move and rename can be combined)
copy or cp
    |_    copies and create a same file
copy -r
    |_    copies a full directory
mkdir nameofdirectory
    |_    makes a new directory
del or rm
    |_    removes permanently a file
type or cat
    |_    reads a file and print the content on the command line
echo "text"
    |_    prints text