Results 1 to 10 of 15
-
21st Sep 2009, 09:59 AM #1OPMember
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 thatvgnheart 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
-
21st Sep 2009, 10:09 AM #2MemberWebsite's:
Wrestle-Zone.net Media-Zone.netDo this:
Code:$ mkdir allrar ; mv *.rar allrar/; rm *.*
-
21st Sep 2009, 10:11 AM #3OPMember
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
-
21st Sep 2009, 10:19 AM #4MemberWebsite's:
Wrestle-Zone.net Media-Zone.netIts the same thing.
-
21st Sep 2009, 10:59 AM #5Member
yep evilgenius is correct
Hostxweb Hosting 99.9% uptime Shared Hosting, Reseller Hosting
yajur | Sales Team
CPanel Hosting • Offsite-Backup • Great Uptime
-
21st Sep 2009, 11:02 AM #6OPMember
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
-
21st Sep 2009, 11:09 AM #7Member
Try
rm *.txt
-
21st Sep 2009, 11:19 AM #8Member
find -type f -name '*.txt' -exec rm -rf {} \;
repeat for other extensions
-
21st Sep 2009, 11:31 AM #9OPMember
ChosenOne it just remove txt files only
-
21st Sep 2009, 11:32 AM #10OPMember
Danny.M i know the command u specified . but want to know the command that i asked .
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Mass prune or delete inactive users?
By kicker-hp_27 in forum vBulletinReplies: 9Last Post: 2nd Mar 2011, 07:22 PM -
need SSH command to change file/folder's Owner
By onel0ve in forum Webmaster DiscussionReplies: 7Last Post: 17th Jan 2011, 06:19 PM -
How to delete mass members
By makfun in forum IP.BoardReplies: 4Last Post: 11th Jan 2011, 04:16 PM -
Delete old mass private messages.
By Pirate in forum Web Application/Script SupportReplies: 8Last Post: 24th Sep 2010, 08:37 PM -
need shell command to search and delete
By vgnheart in forum Server ManagementReplies: 2Last Post: 10th Jun 2009, 06:05 PM
themaLeecher - leech and manage...
Version 5.02 released. Open older version (or...