Activity Stream
48,167 MEMBERS
62661 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1.     
    #1
    Member

    Default mass file delete command

    I am using CentOS 5.3

    I am having one folder which contain nearly 1500 files. there are files with txt,gif,rar,jpg extensions. I want to keep rar files and delete all other files.

    some pls give me shell command to do that
    vgnheart Reviewed by vgnheart on . mass file delete command I am using CentOS 5.3 I am having one folder which contain nearly 1500 files. there are files with txt,gif,rar,jpg extensions. I want to keep rar files and delete all other files. some pls give me shell command to do that Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Member
    Website's:
    Wrestle-Zone.net Media-Zone.net
    Do this:
    Code: 
    $ mkdir allrar ; mv *.rar allrar/; rm *.*
    It makes a new directory and moves all .rar files in it. and removes all files in the parent directory

  4.     
    #3
    Member
    i dont want to create new folder. what i look for is a for loop command which searchs for all files except those rar and deletes

  5.     
    #4
    Member
    Website's:
    Wrestle-Zone.net Media-Zone.net
    Its the same thing.

  6.     
    #5
    Member
    yep evilgenius is correct
    Hostxweb Hosting 99.9% uptime Shared Hosting, Reseller Hosting
    yajur | Sales Team
    CPanel Hosting • Offsite-Backup • Great Uptime

  7.     
    #6
    Member
    i dont want to create a new folder like he mentioned " allrar"

    the command must just search for all files except rar and delete files. i.e, it wont do any action on rar files like move or copy

  8.     
    #7
    Member
    Try
    rm *.txt

  9.     
    #8
    Member
    find -type f -name '*.txt' -exec rm -rf {} \;

    repeat for other extensions

  10.     
    #9
    Member
    ChosenOne it just remove txt files only

  11.     
    #10
    Member
    Danny.M i know the command u specified . but want to know the command that i asked .

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Mass prune or delete inactive users?
    By kicker-hp_27 in forum vBulletin
    Replies: 9
    Last Post: 2nd Mar 2011, 07:22 PM
  2. need SSH command to change file/folder's Owner
    By onel0ve in forum Webmaster Discussion
    Replies: 7
    Last Post: 17th Jan 2011, 06:19 PM
  3. How to delete mass members
    By makfun in forum IP.Board
    Replies: 4
    Last Post: 11th Jan 2011, 04:16 PM
  4. Delete old mass private messages.
    By Pirate in forum Web Application/Script Support
    Replies: 8
    Last Post: 24th Sep 2010, 08:37 PM
  5. need shell command to search and delete
    By vgnheart in forum Server Management
    Replies: 2
    Last Post: 10th Jun 2009, 06:05 PM

Tags for this Thread

BE SOCIAL