Open Source Comes to Campus/UMD/Laptop setup/OSX command line: Difference between revisions

no edit summary
imported>Jesstess
No edit summary
imported>Jesstess
No edit summary
 
Line 77:
* An absolute path contains the full set of directories from the root of the file system up to your target file or directory. On OS X, an absolute path starts with <tt>/</tt>.
* You can <tt>cd</tt> to an absolute path from anywhere on the filesystem.
* This is an example absolute path: <tt>/homeUsers/jesstess/projects</tt>
 
<b>Relative paths</b>
* A relative path is calculated relative to your "current working directory" -- the directory you are currently in at a command prompt, as displayed by <tt>pwd</tt>.
* This is an example relative path: <tt>projects</tt>. That path only has meaning given a current working directory. If your current working directory were <tt>/homeUsers/jesstess</tt>, then <tt>cd projects</tt> would take you to <tt>/homeUsers/jesstess/projects</tt> assuming that such a directory existed. If you were in <tt>/homeUsers/brad/Desktop</tt>, then <tt>cd projects</tt> would take you to <tt>/homeUsers/brad/Desktop/projects</tt>.
 
===Tips===
 
* You can use Tab to auto-complete directory and file names. So from inside the root directory <tt>/</tt>, if you type <code>cd hoUs</code> and hit Tab, the command prompt will auto-complete the directory name, and you can then hit enter to change into the <code>/homeUsers</code> directory.
* The command prompt maintains a command history. You can use the up arrow to cycle through old commands.
 
Line 95:
# After starting a new command line prompt, how would you get to the root directory?
# How do you check what files and directories are in your current working directory?
# If you are in directory <tt>/homeUsers</tt>, and you want to get to <tt>/homeUsers/jesstess/projects</tt>, how would you do that?
# What are 2 ways to avoid typing out a full navigation command? (hint: one requires that you've run the command before)
# What is the difference between <tt>cd projects</tt> and <tt>cd /projects</tt>?
Anonymous user