Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Updated to fix a glitch that caused the directory listing location to output multiple
- # lines when viewing a directory with spaces in it.
- # Custom directory listing function for great justice and my own amusement.
- function ll () {
- # Suss out the directory we're trying to list
- if [ -d ${@:-1} ]
- then location=${@:-1}
- else location=`pwd`
- fi
- # Put together our directory listing, with custom headers.
- # Include additional arguments passed in from the function call.
- # Pipe the output through more
- {
- printf '\x1b\x5b34m<index \x1b\x5b32mlocation\x1b\x5b35m=\x1b\x5b33m\"%s\"\x1b\x5b34m>\x1b\x5b00m\n' "$location" &&
- ls -FGhlpv --group-directories-first --color=always $@ &&
- printf '\x1b\x5b34m</index>\x1b\x5b00m\n';
- } |more
- }
Advertisement
Add Comment
Please, Sign In to add comment