Versions Compared

Key

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

...

Here the big important file systems are /home1 (7.0T), /scratch (8.1P) and /work (6.8P). There's also /admin (3.5T) but its name suggests that normal users won't be able to access it.

Navigating the file system

Now that we know there are other places, how do we get there? Enter the cd (change directory) command:

...

  • ~ (tilde) means my 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 ~

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 where you are
Exercise 4-1

Change into the /stor/work/CBRS_unix directory then back to your Home directory. Then use the - (dash) to go back to /stor/work/CBRS_unix without typing it in, then Home again using ~ (tilde). How does the command prompt change?

Expand
titleAnswer...


Code Block
languagebash
cd /stor/work/CBRS_unix
cd                          # Back home
cd -                        # Last directory (here /stor/work/CBRS_unix)
cd ~                        # And home again

The command prompt "follows you", displaying /stor/work/CBRS_unix when you're in that directory, and ~ when you're in your Home directory.

Tab key completion

The Tab key is your best friend! Hit the Tab key once or twice - it's almost always magic!

Hitting Tab invokes shell completion, instructing the shell to try to guess what you're doing and finish the typing for you. On most modern Linux shells you use Tab completion by pressing:

  • single Tab – completes file or directory name up to any ambiguous part
    • if nothing shows up, there is no unambiguous match
  • Tab twice – display all possible completions
    • you then decide where to go next

Let's

Code Block
languagebash
cd
cd ~

x





Pathname wildcards ("globbing")

...