Happy Saint Patrick's Day!
Today I pursue the pot of gold hidden somewhere in this Command Line Crash Course, continuing with Lesson 5.
Lesson 5: Change Directory (cd)
This lesson had me move up and down the directories I created yesterday using "cd" and ".." For the most part this was intuitive, until I tried to navigate to the Documents folder, which did not work initially because I was missing part of the path. I wound up using "pwd" and "ls" to find out the exact paths to use, and then found my way to both Downloads and Documents. Yay :-)
Lesson 6: List Directory (ls)
Oops, I jumped ahead! In this lesson I used ls to give me the names of files inside my directories, and used cd to navigate to those directories. I also learned that ls -lR gets you a list of all the directories inside the current working directory, so you don't have to cd down the whole hierarchy. I also confirmed my earlier discovery that ls and pwd are the "I am lost, where am I" commands.
Lesson 7: Remove Directory (rmdir)
This lesson combined ls, cd, and pwd and used them to accurately remove directories using rmdir. In order to use rmdir, you have to be in the directory that contains the directory that would want to remove, and the directory has to be empty.
Lesson 8: Moving Around (pushd, popd)
This lesson was initially confusing because I wasn't sure if pushd/popd was creating/ deleting d or moving between them. Turns out, it's sort of both. Pushd says "go to and remember this location," popd takes you to the previous location. Pushd/popd lets you move easily between two locations, which is valuable because with cd you have to follow a hierarchy instead of skipping around. I also learned that mkdir -p lets you make an entire path at once instead of moving into each directory to make the directory inside it, and that capitalization matters. Terminal understands home and Home as two different places.
No comments:
Post a Comment