All pages
Powered by GitBook
1 of 3

Loading...

Loading...

Loading...

The Unix Tree

The UNIX file system consists of files and directories organized in a hierarchical structure. When visualized, this hierarchical structure looks like a tree, with roots and many branches.

tree -L 1 / command, showing the Unix filesystem tree:

/
├── bin
├── boot
├── dev
├── etc
├── home
├── lib
├── lib64
├── mnt
├── nfs
├── opt
├── proc
├── root
├── run
├── srv
├── sys
├── tmp
├── usr
└── var

19 directories, 0 files

Every file or directory in a UNIX operating system is somewhere on this "tree." / is referred to as "root," because it's the root of the tree which every other file or directory is inside.

For example, every UNIX user's home directory is in home, which is in /. In other words, every user's home directory is in /home.

Unix has some shortcuts for referring to directories.

  • . stands for "my current directory."

  • .. stands for "my parent directory," a.k.a. the directory one branch higher in the tree

  • ~ stands for "my home directory."

Example of Unix directory shortcuts:

/
├── home
│   ├── asoberan ( ~ )
│   │   └──Documents ( .. )
│   │      └──unix_class (I am here) ( . )
│   ├── duan
│   └── yourusername
├── etc
├── bin
├── tmp
...

The organization of the filesystem is not set in stone. However, there is a standard that many UNIX operating systems follow called the Filesystem Hierarchy Standard (FHS). The FHS defines a standard filesystem layout for greater uniformity and easier documentation across UNIX-like operating systems.

Some of what the FHS dictates includes:

  • / must have everything to boot, restore, recover, or repair a system.

  • /etc holds configuration files for the system and programs present on the system. For example, if I install the SSH server, I can reasonably expect configuration files for it to be found at /etc/ssh/

  • /home are user's home directories

  • /tmp holds temporary files that can be deleted on reboot

  • /bin holds essential programs that are needed for system recovery

  • /usr/bin holds non-essential programs

Thanks to the FHS, you can expect most UNIX-like operating systems to look like this.

The Unix Filesystem

Network Filesystems

NFS

The UNIX filesystem does not have to be present on the local hard drive. UNIX supports filesystems that are present over the network, called Network Filesystems (NFS), so that you can mount a directory from another computer and traverse it just as if it were a normal directory on your local computer.

Our Luria cluster uses this technology to mount our many storage servers, which run NFS servers. Every storage server is mounted at /net.

tree -L 1 / command, showing the different storage servers mounted at /net:

[asoberan@luria]$ tree -L 1 /net
/net
├── bmc-lab1
├── bmc-lab2
├── bmc-lab2.mit.edu
├── bmc-lab3
├── bmc-lab4
├── BMC-LAB4
├── bmc-lab5
├── bmc-lab6
├── BMC-LAB6
├── bmc-lab7
├── bmc-lab8
├── bmc-pub10
├── bmc-pub14
├── bmc-pub15
├── bmc-pub16
├── bmc-pub17
├── bmc-pub9
├── gelbart
├── ostrom
└── rowley

21 directories, 0 files

From our perspective, these look like any other directory on Luria, but they're present on completely different computers.

SMB

Another protocol for sharing filesystems over the network is SMB, which is supported on UNIX systems through Samba. In addition to NFS, our storage servers run Samba servers, which allow you to mount them on your local laptop or PC. For instructions on doing so, refer to the page linked below:

Active Data Storage