These are some useful Linux Terminal Commands for productivity:

Commands using ls etc.

useto
ls -ltrlist files in reverse modification history order with details.
`ls -ltrtail -n 5`
`lshead -n 5`
rename 's/original/new/' *To rename all filenames and directories containing “original” string to “new” string. To recursively do this in sub-directories, use **/*. See: here and here
for dir in */; do mkdir -- "$dir"/{tmp1,foo,bar,qux}; doneTo create directories within sub-directories in one go!
ls -alist all files, including hidden ones!

For opening image files from Terminal

Opening files directly through the Terminal is both easy and fast. Additionally, these commands are useful to view resulting files when using subprocess.run in Python to run Terminal commands.

useto
evince filenameopen PDF files and PS document files.
eog filenameopen image files in normal image formats like JPEG, JPG, PNG etc.
ds9 filenameopen FITS format image files. Requires DS9
fv filenameopen FITS format event lists and datasets. Requires initiation of NASA’s heasarc

To Check File Size in directories and sub-directories

du -h d 1 | sort -hu

Ref : https://www.linuxteck.com/9-basic-du-command-in-linux-with-examples/

Custom git and ls aliases

These customization commands have been put in the ~/.zshrc or the bash script at ~/.bashrc, and enable more efficient git status checks etc.

# git aliases
alias gs="git status"
alias gb="git branch"

# ls aliases via li
alias ll="eza -l -g --icons"
alias li="eza --icons"
alias lt="eza --tree --icons -a -I '.git|__pycache__|.mypy_cache|.ipynb_checkpoints'"

alias lid="eza --icons -d */"
alias lin="eza --icons --sort newest"
alias lidn="eza --icons -d */ --sort newest"
alias lind="eza --icons --sort newest -d */"
alias lf="eza --icons *.py --sort newest"
alias lld="eza -l -g --icons -d */"
alias llin="eza -l -g --icons --sort newest"
alias llf="eza -l -g --icons *.py --sort newest"

Note: lf if used for python files, instead of lpy, b’cuz the latter is a bit cumbersome to type out fast.

Note: Remember to source the bashrc file after any modifications.

Notes: use eza on a macos system if exa is decrepit.