Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Of course there are other areas of the file system hierarchy a tree of. For example, the /stor/work/CBRS_unix directory.

...

Note that in Unix, and on Macs, directories are separated by forward slash ( / ) characters, unlike Windows where the backslash ( \ ) is used. And the root of all the file systems is that 1st forward slash ( / ).

...

  • cd <optional directory_name>
    • with no argument, always changes to your Home directory.

There are also some "special" built-in directory names:

    • the special character ~ (tilde) means your Home directory
  • . (single period) means the current directory
  • .. (two periods) means the parent of the current directory (directory above it)
    • So ls .. means "list contents of the parent directory"
  • - (dash) means whatever directory you were in before this one

So these two expressions do the same thing – take you to your Home directory from wherever you are in the file system.

...

    • .
Code Block
languagebash
titleGo Home!
cd
cd ~

...

       # make sure you're in your Home directory
cd data  # change into the data sub-directory
cd ~     # return to your Home directory using ~
cd data  # change into the data sub-directory again
cd       # return to Home

When you've changed into a directory, how do you know where you are in the file system?

  • On our system, we've arranged that the command prompt "follows you" around the file system.On other systems you can use the pwd (present working directory) command to see the full pathname of the directory you're inthe file system.
  • On other systems you can use the pwd (present working directory) command to see the full pathname of the directory you're in

There are other "special" built-in directory names:

  • . (single period) means the current directory
  • .. (two periods) means the parent of the current directory (directory above it)
    • So ls .. means "list contents of the parent directory"
  • - (dash) means whatever directory you were in before this one

Exercise 4-1

What is the full pathname of your Home directory?

...