hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Hosting Security and Technology : Deleting muliple files SSH? Easier way?
Reply

Forum Jump

Deleting muliple files SSH? Easier way?

Reply Post New Thread In Hosting Security and Technology Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old
Web Hosting Master
 
Join Date: Dec 2002
Location: UK
Posts: 836

Deleting muliple files SSH? Easier way?


Hi

Been searching all over cant seem to find the answer for this

In my home directory i have a load of .tar.gz files which i used for restoring accounts there are atleast around 100 i'd say

Does anyone know what command to issue to delete all files in the /home directory with a .tar.gz extension

i can do them one by one but gonan take ages wondering if there is na easier way?



Sponsored Links
  #2  
Old
Disabled
 
Join Date: Jun 2005
Posts: 587
You can use following command.. Will definitely help you.
Quote:
rm -rf *.tar.gz

  #3  
Old
Web Hosting Master
 
Join Date: Dec 2002
Location: UK
Posts: 836
thank your sir

worked fine!

Sponsored Links
  #4  
Old
Web Hosting Master
 
Join Date: Apr 2009
Posts: 829
BTW you can use midnight commander (mc) to simply highlight and delete un-needed files, sometimes it is easier then to use pattern

  #5  
Old
Web Host Extraordinaire!!!
 
Join Date: Dec 2007
Location: Indianapolis, Indiana USA
Posts: 15,075
Quote:
Originally Posted by Crashus View Post
BTW you can use midnight commander (mc) to simply highlight and delete un-needed files, sometimes it is easier then to use pattern
Eh? rm -rf *.tar.gz is easy as pie and only takes a split second to do.

__________________
Michael Denney - MDDHosting, LLC - Professional Hosting Solutions
LiteSpeed Powered - Shared, Reseller, Semi-Dedicated, and VPS
For high-end shared accounts ideal for business, check out our Semi-Dedicated offerings!
http://www.mddhosting.com/ - Providing Quality Services since 2007

  #6  
Old
Web Hosting Master
 
Join Date: Apr 2009
Posts: 829
*

Quote:
Originally Posted by MikeDVB View Post
Eh? rm -rf *.tar.gz is easy as pie and only takes a split second to do.
And what if you need to delete 5-10 files which have *mike* or *dvb* or *webhostingtalk* in their names with *tar or *gz or *bz or *sql in their extensions with all these files mtime more then 1 day?

Would you still use patterns for these? Or maybe simply check them in MC and press F8?

  #7  
Old
Web Host Extraordinaire!!!
 
Join Date: Dec 2007
Location: Indianapolis, Indiana USA
Posts: 15,075
I have no idea what "mc" is and I've never used it. Chances are you could easily delete the files in the time it would take to even install "mc".

As far as deleting files with those attributes, a bit of simple regex could do it or you could just type out a few commands and be done with it.

The point I was trying to make is that they OP had a simple request with a simple solution that doesn't require anything more than a single command.

If they were asking how to delete an array of files with different names and extensions then perhaps your solution would be a good fit.

__________________
Michael Denney - MDDHosting, LLC - Professional Hosting Solutions
LiteSpeed Powered - Shared, Reseller, Semi-Dedicated, and VPS
For high-end shared accounts ideal for business, check out our Semi-Dedicated offerings!
http://www.mddhosting.com/ - Providing Quality Services since 2007

  #8  
Old
Web Hosting Master
 
Join Date: Apr 2009
Posts: 829
Quote:
Originally Posted by MikeDVB View Post
I have no idea what "mc" is and I've never used it. Chances are you could easily delete the files in the time it would take to even install "mc".

As far as deleting files with those attributes, a bit of simple regex could do it or you could just type out a few commands and be done with it.

The point I was trying to make is that they OP had a simple request with a simple solution that doesn't require anything more than a single command.

If they were asking how to delete an array of files with different names and extensions then perhaps your solution would be a good fit.
mc is a clone of norton commander under unix. I'm glad OP figured out how to achieve his needs but I was hoping my advice will be handy for him in the future, thats all.

  #9  
Old
Web Host Extraordinaire!!!
 
Join Date: Dec 2007
Location: Indianapolis, Indiana USA
Posts: 15,075
Quote:
Originally Posted by Crashus View Post
mc is a clone of norton commander under unix. I'm glad OP figured out how to achieve his needs but I was hoping my advice will be handy for him in the future, thats all.
I see - tools like those do have their place but I prefer to work using the built in utilities in Linux for a couple of reasons -> they're always available no matter what system I'm in -> I don't have to install them before I can do what I need to do.

Maybe it will be helpful to somebody in the future.

__________________
Michael Denney - MDDHosting, LLC - Professional Hosting Solutions
LiteSpeed Powered - Shared, Reseller, Semi-Dedicated, and VPS
For high-end shared accounts ideal for business, check out our Semi-Dedicated offerings!
http://www.mddhosting.com/ - Providing Quality Services since 2007

  #10  
Old
Web Hosting Master
 
Join Date: Apr 2009
Posts: 829
Quote:
Originally Posted by MikeDVB View Post
I see - tools like those do have their place but I prefer to work using the built in utilities in Linux for a couple of reasons -> they're always available no matter what system I'm in -> I don't have to install them before I can do what I need to do.

Maybe it will be helpful to somebody in the future.
It's like buying a car to drive yourself 2 kilometers, sometimes it is very-very handy and cool and sometimes you can stuck in a traffic for half-day.

I hope you will like mc if you ever will try it

  #11  
Old
Web Host Extraordinaire!!!
 
Join Date: Dec 2007
Location: Indianapolis, Indiana USA
Posts: 15,075
I've never had problems with regular expressions being a developer for well over 15 years so I'll probably just stick to doing things the way I've always done them.

__________________
Michael Denney - MDDHosting, LLC - Professional Hosting Solutions
LiteSpeed Powered - Shared, Reseller, Semi-Dedicated, and VPS
For high-end shared accounts ideal for business, check out our Semi-Dedicated offerings!
http://www.mddhosting.com/ - Providing Quality Services since 2007

  #12  
Old
Web Hosting Master
 
Join Date: Apr 2009
Posts: 829
Quote:
Originally Posted by MikeDVB View Post
I've never had problems with regular expressions being a developer for well over 15 years so I'll probably just stick to doing things the way I've always done them.
You've never used mc for 15 years? You're probably very strict person, which is good from other side.

I'm glad you're ok with it

  #13  
Old
Web Host Extraordinaire!!!
 
Join Date: Dec 2007
Location: Indianapolis, Indiana USA
Posts: 15,075
Quote:
Originally Posted by Crashus View Post
You've never used mc for 15 years? You're probably very strict person, which is good from other side.

I'm glad you're ok with it
I've never used it, ever. Never had a need for it.

__________________
Michael Denney - MDDHosting, LLC - Professional Hosting Solutions
LiteSpeed Powered - Shared, Reseller, Semi-Dedicated, and VPS
For high-end shared accounts ideal for business, check out our Semi-Dedicated offerings!
http://www.mddhosting.com/ - Providing Quality Services since 2007

  #14  
Old
Web Hosting Master
 
Join Date: Apr 2003
Location: NC
Posts: 2,970
Same here, I have never messed with MC. The shell works fine and once you are used to it why bother with any sort of gui?

Just be careful when you are using *'s, an extra space can ruin your day in a matter of seconds

__________________
John W, CISSP
MS Information Security and Assurance
www.yawig.com - Managed VPS and Dedicated Servers with VIP Service
www.eth0.us - Server Admin Info

  #15  
Old
Web Hosting Master
 
Join Date: Apr 2003
Location: San Jose, CA.
Posts: 1,622
Am I the only one who thinks that if the OP can't use one of the most basic commands and apply simple arguments to it... that they shouldn't be the one trying to remove account backups or be allowed to use a shell account?

Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
Looking for software to help make ssh/rdesktop easier jaymef Hosting Software and Control Panels 2 11-29-2005 12:56 PM
Deleting a Directory in SSH openXS Dedicated Server 5 09-22-2005 03:12 AM
Tired of SpeedTest Files? Want a easier way? Sheps Other Web Hosting Related Offers 16 06-05-2005 12:10 AM
Deleting SSH user AA2004 Dedicated Server 7 05-17-2004 03:27 AM
Deleting Directory using SSH dropscripts Hosting Security and Technology 3 10-27-2003 10:52 PM

Related posts from TheWhir.com
Title Type Date Posted
Turnkey Internet Adds New Features to Cloud-Hosted Virtual Desktop Web Hosting News 2013-08-21 14:45:11
Egnyte Synchronizes Google Drive with Private Cloud Storage Web Hosting News 2013-07-17 12:36:21
Yahoo Integrates Email Client with Dropbox Cloud Storage Web Hosting News 2013-04-04 14:31:40
Google Drive Adds File Hosting, Improves Third-Party App Integration Web Hosting News 2013-02-08 12:46:31
Kim Dotcom Claims Megaupload Search Warrants Unlawfully Obtained by US Government Web Hosting News 2013-01-04 11:24:29


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
WHT Host Brief Email:

We respect your privacy. We will never sell, rent, or give away your address to any outside party, ever.

Advertisement:
Web Hosting News:
WHT Membership
WHT Membership



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?