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: 78331 | 6 Comments »

How to manipulate files with name like ‘-life.mp3’

March 21st, 2007 mysurface

Sometimes, you may find some file you can’t delete because of the filename begins with minus(-). LBE have that example on the post “Remove file start with special character”, as simple as this rm ./-life.mp3 The same way you can manipulate those files by mv, cp etc. The important highlights here is ./ dot(.) is […]

Posted in Common, mplayer, mv, rm | Hits: 56580 | 4 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: 104831 | 8 Comments »

Remove file start with special character

December 5th, 2006 mysurface

In linux, file can be any name, including “–testing”. If you have a file with this name, how you delete it? Command line bellow will fail, rm –testing The correct one is rm ./–testing This works for mv, cp etc. So you can actually create a file with name “–testing” using touch. touch ./–testing Related […]

Posted in Common, mv, rm, touch | Hits: 71960 | 9 Comments »

remove directory

September 26th, 2006 mysurface

rmdir is like a reverse of mkdir, it removes the empty directory. To remove an empty directory call hello, just rmdir hello And you can remove parent directory as well like rmdir -p lvl1/lvl2/hello It will removes the directory lvl1 then sub dir lvl2 and sub sub dir hello But to use rmdir, the directory […]

Posted in Common, Misc, rm, rmdir | Hits: 40851 | 5 Comments »