# 3. Command line overview
# 3.1. What it is
Command line is the text input and output environment that allows us to process commands on the computer. We refer to these terminal instances as "windows"
# 3.2. Common commands
This will output your current working directory:
pwd
This will output whatever is passed into the terminal:
echo Hello World
This will output the contents of the directory you are in:
ls
We can also pass in the -a
flag to show hidden files in the directory
ls -a
The cd
command stands for change directory. This allows us to traverse the filesystem via the terminal.
To go up a directory:
cd ..
To go into a directory replace <DirectoryName>
with the actual directory name:
cd <DirectoryName>
The mkdir
command stands for make directory. We can use this to create new folders:
mkdir testFolder
The touch
command is used to create a new file. You can add any extension you want but for this example we are creating a txt file.
touch testfile.txt
The cat
command is used to display the contents of a file.
cat testfile.txt
# Exercise
- Let's create a directory called
Assessor
- Change directory to get into the
Assessor
directory - Output your current working directory
- Create a file called
example.txt
- Open the file
example.txt
and type something in there - Back in the terminal display the contents of the
example.txt
file