Download presentation
1
The UNIX File System
2
File System Definition
A file system is a hierarchy of directories, subdirectories, and files that organize and manage the information on hard disks.
3
Directories Directories are created so users and applications can easily find files. Without directories, all files would be in the same location with no organization to them. Similar to using the backseat of your car to hold homework assignments and papers.
4
Hierarchical Directory Structure
Directories are organized in an ‘upside-down’ tree fashion. The root is at the top. Directories may contain other directories and files. Analogous to file drawers and file folders
5
Directories The root directory is often represented as / (the forward slash symbol). Parent directories contain other directories (called children). Child directories are located within other directories (called parent directories).
6
Path Names Each file can be represented by its path name.
The path name simply represents the file’s location in the file system. Example: /home/user2/dir1/coffees/beans
7
Path Components Directory paths allow users to navigate within the file system. Slashes within the path name are delimiters between object names. Object names can be directories, subdirectories or files DOS and Windows uses a backward slash (\) to separate directories. UNIX and Linux use a forward slash (/). A slash (/) in the first position of any path name represents the root directory.
8
Exploring the Root File System
The root directory contains sub-directories that contain files: /bin contains binaries, or executables needed to start the system and perform system tasks available to all users /boot contains files needed by the bootstrap loader as well as kernel images /dev contains system device reference files Continued…
9
Exploring the Root File System
Root subdirectories continued: /etc contains configuration files that the system uses when the computer starts /lib contains kernel modules, security information, and the shared library images /mnt contains mount points for temporary mounts by the system administrator /proc is a virtual file system allocated in memory only; it tracks the running processes on the system Continued…
10
Exploring the Root File System
Root subdirectories continued: /root is the home directory of the root user, or the system administrator /sbin contains essential network programs used only by the system administrator /tmp is a temporary place to store data during processing cycles /var contains subdirectories which have sizes that often change, such as error logs, print jobs, and incoming
11
Absolute Path Names An absolute path name specifies a file or directory in relation to the entire UNIX file hierarchy. directory s
12
Relative Path Names A relative path name describes the location of a file or directory as it relates to the current directory. directory
13
Path Name Types Comparison
If the path name starts with /: It is an absolute path name. Ex: /etc/resolv.conf If the path does not start with /: It is a relative path name. Ex: user01/file1 Absolute path names specify the exact location of a file or directory. In Windows: C:\Windows\System32\file.dll Relative path names specify where a file or directory is in relation to the current spot in the file system. In the Windows folder: System32\file.dll
14
Useful File System Commands
pwd (print working directory) Displays current directory location cd (change directory) Change to a specified directory ls (list) Display contents of directory
15
cd (by itself) places user in home directory
Using cd cd /home Absolute Path In /home, cd user01/dir1 Relative Path cd (by itself) places user in home directory
16
cd Shortcuts cd .. Moves the user up one directory to the parent directory cd ../tmp cd . Keeps the user in the current directory cd ./coffees cd ~ Moves the user to the home directory cd ~/file1
17
ls displays the directory contents.
The ls Command ls displays the directory contents. ls can be used by itself to list the contents of the current directory. ls can be used with a directory path to display the contents of that directory. ls ls /home
18
The ls –a Command Use ls –a to list all files and directories, including hidden files, . and .. directories.
19
The ls –l Command Use ls –l to display long directory listings.
20
The * and ? are also referred to as wildcard characters.
Metacharacters Metacharacter are characters that have special meanings to UNIX and Linux commands. Examples: *, <, >, | (pipe), !, [, ], ? and others The * and ? are also referred to as wildcard characters.
21
The * Wildcard * is used to represent one or more characters
22
The ? Wildcard ? is used to represent one character
23
The [ ] Metacharacters Using [ ], anything inside the brackets will be matched
24
The ; Metacharacter ; is used to separate multiple commands on one line
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.