Table of Contents |
---|
...
About File Systems
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.
Files and directories in your Home directory are part of the overall file system hierarchy – a tree of directories and their files/sub-directories.
To see the partial file system hierarchy of your Home directory, you can use the tree command. (Note that tree is not always available on Linux systems; it is an add-on tool that must be installed separately).
Just calling tree will produce output similar to this:
This display shows the hierarchical structure of files and sub-directories. At top-level, there are a number of files that we pre-positioned for you (haiku.txt, mobydick.txt, etc.) along with some we created (out.txt, newfile.txt, etc.). About File Systems There are also two sub-directories: bedfiles and docs, each with several files in them. And notice how tree colors the directories differently to make them stand out.
Of course there are other areas of the file system hierarchy a tree of. For example, the /stor/work/CBRS_unix directory.
Code Block | ||
---|---|---|
| ||
tree /stor/work/CBRS_unix |
Produces output similar to this:
There are two sub-directories under the /stor/work/CBRS_unix directory: fastq and unix, each with their own sub-directories and files. Again, notice how tree colors file with the extension .gz differently. These are FASTQ files produced by a Next Generation Sequencing (NGS) run in our Genome Sequencing and Analysis (GSAF) core facility.
So if you're on a new system, how do you know what file systems are available to you? The df (disk free) command will list all the available file systems. As its name suggests, it also shows file system sizes, so it's always good to use df -h (human readable) so we see sizes in more readable form. Also, there can be many many file systems available on any given system, so always pipe the output to more.
Code Block | ||
---|---|---|
| ||
df -h | more |
This produces a rather busy display like this one:
Fortunately, you can ignore most of it. Focus on the Mounted on and Size columns.
- Under the Mounted on column:
- / (slash) is the root of the file system where the operating system is installed.
Navigating the file system
Pathname wildcards ("globbing")
...