...
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 | ||||
---|---|---|---|---|
| ||||
cd
cd ~ |
When you've changed into a directory, how do you know where you are in the file system?
...
# 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 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?
...
- Look for the / (forward slash), under the Mounted on column:
- / (forward slash) is the root of the file system where the operating system is installed
- Note its Size is 98G with 4761G used
- Look for Mounted on entries with large Size numbers:
- Gigabytes (10^9 bytes), Terabytes (10^12 bytes), Petabytes (10^15 bytes)
- Ignore file systems with names like /run, /dev, /snap, /sys, /boot, /tmp, /var – these are system related
- Here we see a number starting with /stor (/stor, /stor/home, /stor/work, etc.)
- Note its large Size: 39T - a sign that it's a file system you want to know about.
...
- file permissions - a 10-character field
- number of sub-components associated with a directory - rarely important
- account name of the file owner
- Unix group associated with the file
- file size
- last modification month
- last modification day
- last modification year, or last modification hour/:minute if within the last year
- file name
...
A file's owner is the Unix account that created the file (here student01, me). That account belongs to one or more Unix groups, and the primary group associated with a file is listed in field 4.
...
- character 1 describes the file type (
- d for directory
- - (dash) for regular file
- l for symbolic link
- the remaining 9 characters are 3 sets of 3-character designations
- characters 2-4: what the owning user account can do
- characters 5-7: what other members of the associated Unix group can do
- characters 8-19: what other non-group members (everyone) can do
...
See the Create, rename, linkto, delete files and Copying files and directories sections of the Some Linux commands page for more information.