Command Line Index Flashcards
$ hostname
iq.home
Prints out to the screen the name of the computer.
$ pwd
/User/SwirlingBlackHoleOfChaos
Print working directory
$ mkdir temp
Creates new directory (make directory), in this case a directory called temp.
$ mkdir “I Have Fun”
Creates a directory with spaces in the name.
$ cd temp
Change directory, in the example to a directory called temp. $ cd . . Means to move to parent directory.
$ ls
Lists out the content of the directory you are currently in. There are several options i.e. ls -lR which give long description and recursively list sub directories.
$ rmdir temp
Remove directory
$ pushd my/current/directory
pushd take the current directory on pushes it on a list then change to the new directory (the one in the parameter “mycurrent/directory” )
$ popd
popd takes the last directory pushed on the list and “pops” it off, then moves you in to the directory just popped off the list.
$ pushd
pushd with no parameters will move you from your current directory into the last directory pushed onto the the list. It’s an easy way to switch between two directories.
$ mkdir -p a/new/directory
mkdir -p will create a new directory, if the directories in the path do not exist mkdir -p will create them.