The rename command…

Ulf Rompe Ulf.Rompe at icem.com
Tue Aug 26 15:14:08 UTC 2008


On Di, 2008-08-26 at 10:42 -0400, Rashkae wrote:
> However, the command would be much more efficient if find was only
> returning filenames that start with "Link To", they way your command
> runs now, *every* file gets passed to rename.  This would work, but is
> wasteful, since rename then fires up perl and run a regexp that will
> only fail.
> find . -type l -name "Link to*" -exec rename -v "s/Länk till //" {} \;

If you care about resources, you may want to consider using "|xargs" in
favor of "-exec" because the latter fires up a perl process for every
file found, while the former starts a single process for all files at
once.

(In fact, the above isn't the whole truth. If the argument list is
getting too long, xargs splits it up and starts several processes.
"man xargs" gives more enlightenment.)

[x] ulf 

-- 
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?





More information about the ubuntu-users mailing list