Basic Commands
Let's get going. Open a terminal window. In MacOS you can hit Cmd + Space
and type Terminal
to open it. In Windows you can hit Win + R
and type cmd
to open the command prompt.
Navigating the terminal
List all files in the current directory
Change directories
What is the home directory and where is it located?
The home directory is represented by ~
in MacOS and Linux.
For example, /Users/username
in MacOS and /home/username
in Linux.
In Linux, if you are using the root user, the home directory is /root
.
File and Directory Operations
Create a new directory
Deleting files and directories
Copying files and directories
Moving files and directories
Viewing file contents
Editing text files
Tips
Autocomplete file names
Press Tab
to autocomplete file names in the terminal.
Clear the terminal
You can also use Ctrl + L
to clear the terminal.
Previous commands
Use the up and down arrow keys to navigate through previous commands.
Manual pages
Use the man
command to view the manual pages for a command.