TITLE: Navigating in UNIX
AUTHORS: Anthony Underwood

[DESCRIPTION]
<div class = "text-blocks"><div style = "text-align :; float : ;"><img style = "" src = "https://s3.amazonaws.com/protocols-files/private/01a7878d3c622e9c4d27343721a1b5c5559e4cb768b63015146659aa9ec62085/cns4bgvt7.png" /></div><div class = "text-block">Navigating the file system in UNIX via the command line is not intutive at first glance compared to a point and click windows-style interface. However once you understand the heirachical nature of the file system and how to navigate relative to where you are or from the root of teh file system it becomes almost second nature.</div><div class = "text-block">There are 3 basic commands for navigating the filesystem</div></div>

[STEPS]
?. [Basic Navigation]
Where on earth am I?Short for 'present working directory'. This will show you your current location as an absolute (more on what this means below). For example:/home/anthony/data
?. [Basic Navigation]
What's in my current location?
?. [Basic Navigation]
Get me out of here!This will change your location to the path specified after the cd command. The path can be either absolute or relative. To explain the difference look at the example file tree shown below.An absolute path always starts from the root directory which in UNIX is represented by a /Therefore the absolute path to the data directory of user1 is/home/user1/dataThe absolute path to the bin directory is /usr/binTherefore to change directories to these place no matter where you are youcan typecd /home/user1/data or cd /usr/bin respectively.A relativepath is a location starting from the current working directory and does not start with a /.If you need to go back up a directory you type .. which stands for up a level into the parent directory. Therefore if you are in the directory /home/user1to navigate to the data directory you would type     cd datato navigate to user2 directory you would type     cd ../user2    This navigates up a level in the tree to home and then down into user2If your present working directory is /usr/bin to navigate to the user 1 documents directory you coulduse the absolute path    cd /home/user1/documentsUse the relative path    cd ../../home/user1/documentsback up to usr then to / and then down into home then user and finally documents.Useful commandscd       cd on its own will take you straight to your home directory /home/user1 (/Users/user1 on a mac)cd -    This will take you to the directory you were previously in    cd datato navigate to user2 directory you would type     cd ../user2    This navigates up a level in the tree to home and then down into user2If your present working directory is /usr/bin to navigate to the user 1 documents directory you coulduse the absolute path    cd /home/user1/documentsUse the relative path    cd ../../home/user1/documentsback up to usr then to / and then down into home then user and finally documents.Useful commandscd       cd on its own will take you straight to your home directory /home/user1 (/Users/user1 on a mac)cd -    This will take you to the directory you were previously in    cd ../user2    This navigates up a level in the tree to home and then down into user2If your present working directory is /usr/bin to navigate to the user 1 documents directory you coulduse the absolute path    cd /home/user1/documentsUse the relative path    cd ../../home/user1/documentsback up to usr then to / and then down into home then user and finally documents.Useful commandscd       cd on its own will take you straight to your home directory /home/user1 (/Users/user1 on a mac)cd -    This will take you to the directory you were previously in    cd /home/user1/documentsUse the relative path    cd ../../home/user1/documentsback up to usr then to / and then down into home then user and finally documents.Useful commandscd       cd on its own will take you straight to your home directory /home/user1 (/Users/user1 on a mac)cd -    This will take you to the directory you were previously in    cd ../../home/user1/documentsback up to usr then to / and then down into home then user and finally documents.Useful commandscd       cd on its own will take you straight to your home directory /home/user1 (/Users/user1 on a mac)cd -    This will take you to the directory you were previously in
?. [Basic Navigation]
ReferencesComprehensive tutorialCheatsheet