Abstract
- Also known as Directory Hierarchy
- Logical tree-like structure in which the File System organizes its File and directories
Pathname
- Specify the location of File in the File System Hierarchy
Root Directory
- The top of the File System Hierarchy
File Directory
- A way of grouping File together
Important
In Unix-like systems, file directory itself is also a type of file! The size of the file directory is decided by the files and directories inside it. For APFS, each file or directory will add Byte to its parent directory. That is why empty files take up byte, all the metadata of the empty files is stored with its parent directory.
However, be careful with directory, all newly created directory has 2 child directories,
.
is to the current directory and..
is to the parent directory. Thus, in APFS, all newly created directory has a size of bytes!
Handy tips to create File Directory
mkdir -p
- Tells the
mkdir
command to create parent directories as needed- If you omit this option and the parent directory doesn’t exist, you’ll get an error
mkdir -m
- Used to set the mode (permissions) for the newly created directory
mkdir -pm 0755 /etc/vault.d
Linux File System Hierarchy
/etc/profile.d
- Used for storing shell script files that are automatically sourced when a User logs into the system
- These scripts are used to set environment variables, customize the shell’s behavior, and configure user-specific settings globally for all users
/src
- The name “srv” stands for “service”
- Typically used to store data that is served by the system
- Often used to store data related to various services running on the system, such as websites, FTP servers, and other network services
/dev
- Store all the Special File
Command Line Tools
eza
- A modern, maintained replacement for ls
zoxide
- A smarter cd command. Supports all major shells.
joshuto
- ranger-like terminal file manager written in Rust
- Config Instructions, Image Preview