akoimeexx

My Favorite Alias (updated)

Jul 15th, 2011
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.28 KB | None | 0 0
  1. ##
  2. # Super Directory Listing
  3. ##
  4.  
  5. # Ridiculous amounts of crap going on just for a directory listing
  6. alias ll="{ printf '\x1b[34m<index \x1b[32mlocation\x1b[35m=\x1b[1;33m\"' && pwd -P | tr -d '\n' && printf '\"\x1b[34m>\x1b[00m\n' && ls -aBFhopv --color=always --group-directories-first --hide=.svn --time-style=iso && printf '\x1b[34m</index>\x1b[00m'; } |more -ds"
  7.  
  8. ##
  9. # The Breakdown...
  10. #
  11. # # Start our command block
  12. # {
  13. #   # Print out <index location=", provide blue, green, magenta, and yellow color
  14. #   # similar to syntax highlighting in some IDEs
  15. #   printf '\x1b[34m<index \x1b[32mlocation\x1b[35m=\x1b[1;33m\"' &&
  16. #  
  17. #   # Print out ACTUAL current directory, strip the newline with tr -d
  18. #   pwd -P | tr -d '\n' &&
  19. #  
  20. #   # Print out ">, provide yellow and blue color. Clear color settings to default
  21. #   # with \x1b[00m, print a newline
  22. #   printf '\"\x1b[34m>\x1b[00m\n' &&
  23. #  
  24. #   # List our directory contents, with a TON of options. Change to suit your taste
  25. #   ls -aBFhopv --color=always --group-directories-first --hide=.svn --time-style=iso &&
  26. #  
  27. #   # Print a closing </index>, in blue. Reset colors afterwards
  28. #   printf '\x1b[34m</index>\x1b[00m';
  29. #
  30. # # Close our command block, pipe the results through more for long directory listing goodness
  31. # } |more -ds
  32. ##
Advertisement
Add Comment
Please, Sign In to add comment