rm complains argument list too long

October 20th, 2007 mysurface

There is a limitation of rm command, where you can’t delete a large groups of files with *. For examples, rm -rf something* If there are large amount of files initiate with something, rm will fails and complains /bin/rm: Argument list too long. The solution is to make use of find, xargs and rm. find […]

Posted in Common, find, rm, xargs | Hits: 74642 | 6 Comments »

Remove all .svn directories at once

January 19th, 2007 toydi

When you check out a project code base from a svn repository, each downloaded directory (from top to the deepest) contains a .svn hidden directory that keeps svn’s necessary metadata. If you want to remove them all at once, here’s one way to do it: ~/project_dir $> find -name .svn -print0 | xargs -0 rm […]

Posted in Common, find, rm, xargs | Hits: 100893 | 8 Comments »

Curl multiple URLs

October 23rd, 2006 toydi

A previous post talked about the usage of curl to request a single URL and display its response header fields. It’s good to know that curl also accepts multiple URLs as arguments. To display response header information of several URLs: curl -I http://linuxbyexample.co.nr http://lne.blogdns.com/lbe When there is a long URL list in a file, use […]

Posted in curl, Network, xargs | Hits: 87690 | 5 Comments »

easily extract a column of data from multiple columns

October 2nd, 2006 mysurface

To extract a column of data from multiple column, we can use cut. Usually cut use to extract value from huge trace file or data file such as /etc/passwd. To extract all available user name from /etc/passwd, you can do this cut -d”:” -f1 /etc/passwd Cut extract value line by line, to put all into […]

Posted in cut, Misc, pipeline, Text Manipulation, xargs | Hits: 112247 | 5 Comments »

xargs use stardard output as parameter for another command

October 2nd, 2006 mysurface

xargs is a command line of findutils package. It is not so common for new user, but it is a very useful tools, let me pick an example to show the usage. Bare in mind, xargs is a kind of combo command use together with other command through pipeline. I have a list of links […]

Posted in cat, pipeline, Text Manipulation, wget, xargs | Hits: 80841 | 10 Comments »