Posts

Showing posts from June, 2012

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)

Create file with size for testing purpose

Have you guys even need to have some file with size and its content not neccessary! Here it is $  dd if=/dev/zero of=output.dat bs=1024 count=10240 now we get file -- name : output.dat -- size :1024 * 10240 -> ~10mb Thanks for ( http://linuxcommando.blogspot.com/2008/02/create-file-of-given-size.html )