I want to iterate over each line in the output of: ls -l /some/dir/*
ls -l /some/dir/*
Right now I\'m trying: for x in $(ls -l $1); do echo $x; done
for x in $(ls -l $1); do echo $x; done
You can also try the find command. If you only want files in the current directory:
find
find . -d 1 -prune -ls
Run a command on each of them?
find . -d 1 -prune -exec echo {} \;
Count lines, but only in files?
find . -d 1 -prune -type f -exec wc -l {} \;