The combination of xargs

Assume that you : Have folder "mylist" that contain a lot of files such as "a.php", "uud.php", "ad.py"....
You want to : Add new extension ".du" to any files in this folder
I can do :
~/mylist$ ls | xargs -I f mv f f.du             # god bless -I :o


Or I can do :
~/mylist$ find . -name '*.py' | xargs -I f mv f f.du        # just add new extension for *.py


* aha , i think that a lot of combination could made :)
** next time, it should be rename extension not add it.


(my eng is suck)

Comments

Popular posts from this blog

Difference between apt-get update and apt-get dis-upgrade