My 5 cents:
-
When piping output of
find
toxargs
, always use-print0
option offind
and-0
option ofxargs
. This allows processing files with any allowed characters in names (spaces, new lines etc.). (However I prefer-exec
.) -
There's an
i
command to insert a line insed
, it is better to use it instead ofs/^/...\n/
. It makes code more readable (if we can talk about readability ofsed
code, huh). -
If you want to split a delimiter separated line and print some field, you need
cut
. Keepawk
for more complicated tasks.