TIL by Masood

Don't use xargs, use a for loop instead

shell

If you want to run a command on all the files in a folder, use this command:

for f in * ; do echo "$f" ; done

(Replace echo "$f" with whatever command you want to run)

Don't use xargs, since its input format is not support by most common tools, and it doesn't support filenames with whitespaces or special characters

← Home