Results 1 to 15 of 15
-
06-04-2010, 04:20 PM #1Web Hosting Master
- Join Date
- Dec 2002
- Location
- UK
- Posts
- 838
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?
-
06-04-2010, 04:23 PM #2Disabled
- Join Date
- Jun 2005
- Posts
- 588
You can use following command.. Will definitely help you.
rm -rf *.tar.gz
-
06-04-2010, 04:28 PM #3Web Hosting Master
- Join Date
- Dec 2002
- Location
- UK
- Posts
- 838
thank your sir
worked fine!
-
06-04-2010, 05:26 PM #4Web Hosting Master
- Join Date
- Apr 2009
- Posts
- 865
BTW you can use midnight commander (mc) to simply highlight and delete un-needed files, sometimes it is easier then to use pattern
-
06-04-2010, 05:35 PM #5Web Hosting Industry Expert
- Join Date
- Dec 2007
- Location
- Indiana, USA
- Posts
- 19,196
█ Michael Denney - MDDHosting.com - Proudly hosting more than 37,700 websites since 2007.
█ Ultra-Fast Cloud Shared and Pay-By-Use Reseller Hosting Powered by LiteSpeed!
█ cPanel • Free SSL • 100% Uptime SLA • 24/7 Support
█ Class-leading support that responds in minutes, not days.
-
06-04-2010, 05:38 PM #6Web Hosting Master
- Join Date
- Apr 2009
- Posts
- 865
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?
-
06-04-2010, 05:41 PM #7Web Hosting Industry Expert
- Join Date
- Dec 2007
- Location
- Indiana, USA
- Posts
- 19,196
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.com - Proudly hosting more than 37,700 websites since 2007.
█ Ultra-Fast Cloud Shared and Pay-By-Use Reseller Hosting Powered by LiteSpeed!
█ cPanel • Free SSL • 100% Uptime SLA • 24/7 Support
█ Class-leading support that responds in minutes, not days.
-
06-04-2010, 05:43 PM #8Web Hosting Master
- Join Date
- Apr 2009
- Posts
- 865
-
06-04-2010, 05:45 PM #9Web Hosting Industry Expert
- Join Date
- Dec 2007
- Location
- Indiana, USA
- Posts
- 19,196
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.com - Proudly hosting more than 37,700 websites since 2007.
█ Ultra-Fast Cloud Shared and Pay-By-Use Reseller Hosting Powered by LiteSpeed!
█ cPanel • Free SSL • 100% Uptime SLA • 24/7 Support
█ Class-leading support that responds in minutes, not days.
-
06-04-2010, 05:50 PM #10Web Hosting Master
- Join Date
- Apr 2009
- Posts
- 865
-
06-04-2010, 06:03 PM #11Web Hosting Industry Expert
- Join Date
- Dec 2007
- Location
- Indiana, USA
- Posts
- 19,196
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.com - Proudly hosting more than 37,700 websites since 2007.
█ Ultra-Fast Cloud Shared and Pay-By-Use Reseller Hosting Powered by LiteSpeed!
█ cPanel • Free SSL • 100% Uptime SLA • 24/7 Support
█ Class-leading support that responds in minutes, not days.
-
06-04-2010, 06:05 PM #12Web Hosting Master
- Join Date
- Apr 2009
- Posts
- 865
-
06-04-2010, 06:05 PM #13Web Hosting Industry Expert
- Join Date
- Dec 2007
- Location
- Indiana, USA
- Posts
- 19,196
█ Michael Denney - MDDHosting.com - Proudly hosting more than 37,700 websites since 2007.
█ Ultra-Fast Cloud Shared and Pay-By-Use Reseller Hosting Powered by LiteSpeed!
█ cPanel • Free SSL • 100% Uptime SLA • 24/7 Support
█ Class-leading support that responds in minutes, not days.
-
06-05-2010, 01:18 PM #14Web Hosting Master
- Join Date
- Apr 2003
- Location
- NC
- Posts
- 3,093
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 secondsJohn W, CISSP, C|EH
MS Information Security and Assurance
ITEagleEye.com - Server Administration and Security
Yawig.com - Managed VPS and Dedicated Servers with VIP Service
-
06-05-2010, 02:11 PM #15Web Hosting Master
- Join Date
- Apr 2003
- Location
- San Jose, CA.
- Posts
- 1,624
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?
Similar Threads
-
Looking for software to help make ssh/rdesktop easier
By jaymef in forum Hosting Software and Control PanelsReplies: 2Last Post: 11-29-2005, 12:56 PM -
Deleting a Directory in SSH
By openXS in forum Dedicated ServerReplies: 5Last Post: 09-22-2005, 03:12 AM -
Tired of SpeedTest Files? Want a easier way?
By Sheps in forum Other Web Hosting Related OffersReplies: 16Last Post: 06-05-2005, 12:10 AM -
Deleting SSH user
By AA2004 in forum Dedicated ServerReplies: 7Last Post: 05-17-2004, 03:27 AM -
Deleting Directory using SSH
By dropscripts in forum Hosting Security and TechnologyReplies: 3Last Post: 10-27-2003, 10:52 PM