Terminal Basics Exercises
Write the following terminal commands to perform the following tasks:
Part I
- make a directory called
first
- change directory to the
first
folder - create a file called
person.txt
- change the name of
person.txt
toanother.txt
- make a copy of the
another.txt
file and call itcopy.txt
- remove the
copy.txt
file - make a copy of the first folder and call it
second
- delete the
second
folder
Part II
- What does the
help
command do? Type inhelp rm
. How do you scroll and get out? - Look at the
help
page forls
. What does the-l
flag do? What does the-a
flag do? - Type the following command to download and save the contents of google.com:
curl https://www.google.com > google.html
- Use
less
to look at the contents ofgoogle.html
. - Look at the
help
page forless
. Read the section on/pattern
. Search for the text hplogo in the google.html file. - How do you jump between words in the terminal?
- How do you get to the end of a line in terminal?
- How do you move your cursor to the beginning in terminal?
- How do you delete a word (without pressing backspace multiple times) in terminal?
- What is the difference between a
terminal
andshell
? - What is an
absolute path
? - What is an
relative path
? - What is a
flag
? Give three examples of flags you have used. - What do the
r
andf
flags do with therm
command?
You can find the solutions here