Look through these now and then use them to test yourself after doing the assignment
-
What is the command line?
-
How do you open it on your computer?
-
How can you navigate into a particular file directory?
- Where will
cd .navigate you to? - Where will
cd ..navigate you to? - Where will
cd ~navigate you to? - Where will
cd /navigate you to?
- Where will
-
How can you display the name of the directory you are currently in?
-
How can you display the contents of the directory you are currently in?
-
How can you create a new directory?
-
How can you create a new file?
-
How can you destroy a directory or file?
-
How can you rename a directory or file?
-
Complete this interactive course to get a great handle on the essentials of using a command-line interface and navigating directories - Terminal Tutor
-
Complete the below exercise locally on your own computer.
Unlike Terminal Tutor, your own local terminal can autocomplete file names based on the directory you are in. For example, if you had a directory structure like:
home |- essays |- documents |- doodles |- codeand you were currently at home (
~) all you would need to type iseand then hit tab to autocomplete. If you typeddand hi tab it would list the two possible matching options (documents,doodles) prompting you to type enough for it to know for sure what you mean when you hit tab. Tab autocomplete is a powerful feature when navigating a filesystem through the terminal as it let's you know what is available at any given level and allows you to not have write out entire file/folder names completely. Try to take advantage of it!
In this exercise you will practice creating files and directories and deleting them.
- Navigate to your home directory (
~) - Create a new directory in your home directory and name it
test - Navigate into the
testdirectory - Create a new file called
test.txtusing thetouchcommand - Open this file with VSCode (from the command line using
code test.txt) give it some content, and then save - From within the cli, view the contents of the file you just created (
head,tail,less) - Navigate one level up from the
testdirectory to it's parent directory - Delete the
testdirectory (it contains files now, so you might need to add an option torm!)