Archive for *nix

Howto: Uncompress Many Archive Formats in Linux

Can’t remember which arguments you have to use with tar, etc.?

*.tgz use tar -zxvf
*.tar.bz2 use tar -jxvf
*.tar.bzip2 use tar -jxvf
*.zip use unzip
*.tar use tar -xvf
*.bz2 use bunzip2 -d -v
*.gz use gunzip -d -v
*.arj use unarj
*.lha use lha x
*.ace use unace
*.rar use rar x (Note: on on some systems “unrar”, others “unrar x”)
*.cab use cabextract (Note: Some .cab files need unshield (apt-get install unshield))
*.Z use uncompress
*.zoo use zoo -extract
*.chm use chmextract
*.xpi use unzip
*.jar use jar xvf
*.deb use ar xv
*.lzo use lzop -x
*.7z use 7z x

Steven.

/bin/rm: Argument list too long.

After forgetting to add “2>&1″ to the end of my cron job that runs every minute I ended up with a lot of “mail” in my Maildir, about 600,000! So I thought that I could do a simple “rm 11*” (Each file started with a 11)

But I ran into a problem: “Argument list too long.”

So after researching this problem I found out why (It has to do with not being able to fit the supplied argument list and environment into the 128K buffer)

I also found a solution: find . -name ‘11*’ | xargs rm

Three minutes later my Maildir was clear!

Regards,

Steven Roddis

Recent Comments

  • Josir Gomes: Hi Steve, the meta-package ubuntu-desktop is bloated with huge softwares like OpenOffice, Evolution,...
  • hannah: your that good! ha ha, but seriously.
  • Wiras Adi: Yeah, mathematic operation in text-based CAPTCHA is very easy to break. And I don't think that many sites...
  • Gary: Phew! You saved me lots of hassle :-) The only problem I had was that $_SERVER[’HTTP_AUTHORIZATION ’]...
  • Stephen: To touch on the issue Vinay raised, I had to use the -wholename option on the find command to delete files...

Else wheres