renaming a file....
Todd Zullinger
tmz at pobox.com
Fri Dec 29 02:21:42 UTC 2006
bruce wrote:
> i can rename a file in the current dir
>
> is there a way to be in a parent dir, and rename a file in a child
> dir?
>
> i can use the find cmd, and generate the files i want to rename.
> however, my attempts at using the find . -name "foo" | xargs
> rename... doesn't seem to work, as the rename is coming back saying
> that the file doesn't exist..
>
> it seems that the rename is operating on files in the current dir,
> as opposed to the files from the 'find'....
Can you post the command and the output?
This works here:
$ mkdir dir; touch dir/abcCat.{txt,py}
$ ls dir/
abcCat.py abcCat.txt
$ find dir/ -name 'abcCat.*' | xargs rename . _dog.
$ ls dir/
abcCat_dog.py abcCat_dog.txt
--
Todd OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp
======================================================================
When a man says he approves of something in principle, it means he
hasn't the slightest intention of carrying it out in practice.
-- Prince Otto
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 542 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20061228/50a761ed/attachment-0001.sig>
More information about the fedora-list
mailing list