jay_lltv

cd bash function

Jan 2nd, 2026
6,345
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.25 KB | Source Code | 0 0
  1. # Show a directory listing when using 'cd'
  2. function cd() {
  3.     new_directory="$*";
  4.     if [ $# -eq 0 ]; then
  5.         new_directory=${HOME};
  6.     fi;
  7.     builtin cd "${new_directory}" && /bin/ls -lhF --time-style=long-iso --color=auto --ignore=lost+found
  8. }
Advertisement
Add Comment
Please, Sign In to add comment