Created
January 26, 2012 16:55
-
-
Save bak1an/1683758 to your computer and use it in GitHub Desktop.
do ls for every directory in given path
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Example of usage && output: | |
# $ls_path.sh /home/bak1an/Music | |
# drwxr-xr-x 6 root root 4.0K May 30 2011 /home | |
# drwxr-xr-x 226 bak1an bak1an 24K Jan 26 16:08 /home/bak1an | |
# drwxr-xr-x 112 bak1an bak1an 12K Nov 7 17:51 /home/bak1an/Music | |
path="$1"; | |
while [[ $path ]]; do | |
echo -ne "$path\0"; | |
path=${path%/*}; | |
done | xargs -0 ls -ldh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment