Abstract


  • Also known as Directory Hierarchy
  • Logical tree-like structure in which the File System organizes its File and directories

Pathname

Root Directory

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!

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

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'

joshuto

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"'