Nice little BASH one-liner to iterate through a directory

for afile in /home/auser/adirectory/*; do echo $afile; done

Useful for all kinds of things. And I can never remember how the syntax changes between doing a for statement in a bash script and doing it as a one-liner on the command line.

Post a Comment

Your email is never published nor shared. Required fields are marked *