Versions Compared

Key

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

Table of Contents

Navigating the file system

So far all the files we've been dealing with have been in your Home directory, which is your personal directory. All Unix systems will provide you with a Home directory of your own.


About File Systems 

Pathname wildcards ("globbing")

Since another goal of Unix is to type as little as possible, there are several metacharacters that serve as wildcards to represent sets of characters when typing file names. Using these metacharacters is called globbing (don't ask me why (smile)) and the pattern is called a glob.

...

Code Block
languagebash
ls *.txt        # lists all files with names ending in ".txt"
ls [a-z]*.txt   # does the same but only lists files starting with a lowercase letter
ls [ABhi]*      # lists all filenames whose 1st letter is A, B, h, or i
ls *.{txt,tsv}  # lists filenames ending in either .txt or .tsv

Exercise 2-6

Design a wildcard that will match the files haiku.txt and mobydick.txt but not jabberwocky.txt.

...