LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-16-2012, 09:13 AM   #1
Danish Iqbal
LQ Newbie
 
Registered: Jul 2012
Posts: 2

Rep: Reputation: Disabled
how to delete 100k + files from root of my ftp?


i am currently deleting these files manually means using filezila / cute ftp to delete files but the problem is that is only show 10k files at a time is there any wy to delete all the files atonce except the directories and its inside files on root
What i want
1.i dont want to delete directories and its inside files
2.i want to delete all files in root
is there any way to do this or any way to list more than 10k files in ftp

Thanks
 
Old 07-16-2012, 09:22 AM   #2
montel
Member
 
Registered: Jun 2012
Location: Canada
Distribution: Ubuntu/Debian/CentOS
Posts: 45

Rep: Reputation: 19
if you do:
Code:
rm /root/*
It wont delete directories, but will delete files. I just tested on my Ubuntu 12.04 box. There is probably a better way to do this, but off the top of my head, this works.
 
Old 07-16-2012, 09:26 AM   #3
Danish Iqbal
LQ Newbie
 
Registered: Jul 2012
Posts: 2

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by montel View Post
if you do:
Code:
rm /root/*
It wont delete directories, but will delete files. I just tested on my Ubuntu 12.04 box. There is probably a better way to do this, but off the top of my head, this works.
can i use this with PHP and how much time it takes to complete 100K + files
 
Old 07-16-2012, 09:48 AM   #4
montel
Member
 
Registered: Jun 2012
Location: Canada
Distribution: Ubuntu/Debian/CentOS
Posts: 45

Rep: Reputation: 19
I have no idea about your PHP question. From what I understand, you can execute commands via PHP, but I am not a PHP guru. But I just created and deleted 100k files. It took about 9 seconds to delete files with nothing in them. So depending on how large each of your files are, it will take longer.
 
Old 07-16-2012, 03:15 PM   #5
psyhe
LQ Newbie
 
Registered: Mar 2006
Posts: 5

Rep: Reputation: 1
Quote:
Originally Posted by Danish Iqbal View Post
can i use this with PHP and how much time it takes to complete 100K + files
you can use the command above in php like this:

<?php
system('rm /root/*');
?>

The time needed for the delete operation varies depending on the kind of the filesystem where the files are (ext4 is much faster at this than jfs for example), it depends on the size of the files and also on the CPU/disk load ...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't Delete Files - even as root! DJOtaku Linux - General 5 04-03-2008 09:48 PM
Files that root can't delete? mijohnst Solaris / OpenSolaris 5 03-20-2008 10:04 PM
Need to delete directories with files using command line FTP Zombie13 Linux - Software 2 03-10-2006 10:23 PM
Allow Anynomous FTP user to delete files RohanShrivastav Linux - Networking 2 10-12-2005 10:14 PM
I'm looking for perlscript to delete some files via ftp cccc Programming 1 02-24-2004 01:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration