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
brew install eza
echo "alias ls='eza --icons'" >>~/.zshrc
echo "alias ll='eza -lhig --git --icons -a'" >>~/.zshrc
echo "alias tree='eza --tree --icons'" >>~/.zshrc
zoxide
- A smarter cd command. Supports all major shells.
brew install zoxide
brew install fzf
# Append to .zshrc
# eval "$(zoxide init zsh --hook prompt)"
# alias cd='z'
Yazi
- ranger-like terminal file manager written in Rust
brew install yazi ffmpeg sevenzip jq poppler fd ripgrep fzf zoxide imagemagick font-symbols-only-nerd-font
joshuto
Attention
Use Yazi instead.
- ranger-like terminal file manager written in Rust
- Config Instructions, Image Preview
brew install joshuto
# Alias to have joshuto to exit in the current directory it is in
alias joshuto='joshuto --change-directory --output-file $HOME/.joshutoExit; LASTDIR=`bat $HOME/.joshutoExit`; cd "$LASTDIR"'