Removing files from server?

wickedDUDE

New member
Jun 25, 2006
1,054
12
0
Hello,

I have hundreds of files that I want to delete from the server.

What's the easiest way to delete the files at the server level (i.e. without having to go into the folder structure and manually delete each one) ?

thx.
 


Normally you SSH in and type "cd /" then type "rm -rf *" and it will bring up a dialog that lets you choose which files to delete.
 
Not looking to delete my whole web site. Only individual files.

Suppose I have the list ready. What would the code be using SSH commands?
 
If you have something like cPanel or Plesk, you can skip SSH and use the GUI.

Are you on a linux box or windows? If Windows, then just remote in and work it like a desktop machine.

If linux do what Kiopa_Matt said.
 
I tried the method of removing the files in SSH: rm -f file1 file2 file3 file4 file5

The problem is that I still can't delete multiple files because when I paste all the files from Notepad into PUTTY my list gets truncated.

Basically it seems like Putty only allows something like a 300 character limit per command..after that you can't paste or type anymore.

So I can't even delete 15 files at once because some of the paths are long.

Any help is appreciated.
 
Also, why not use the file manager of cPanel?

Why not just sFTP in select the files and delete ??

WHY.jpg
 
I tried the method of removing the files in SSH: rm -f file1 file2 file3 file4 file5

The problem is that I still can't delete multiple files because when I paste all the files from Notepad into PUTTY my list gets truncated.

Basically it seems like Putty only allows something like a 300 character limit per command..after that you can't paste or type anymore.

So I can't even delete 15 files at once because some of the paths are long.

Any help is appreciated.

Code:
nano deleter.sh
*paste here
ctrl-x, y, enter
chmod +x deleter.sh
./deleter.sh
 
please, do not suggest a simple solution :food-smiley-002:

The files are scattered in hundreds of different directions...this isn't a viable option unless I want to spend two weeks of my time doing it.

There has to be some SSH experts here...
 
What mattseh said. Create a deleter.sh file... in other words, just a text file that deletes the files.

Code:
rm -f file1
rm -f file2
rm -f file3
rm -f file4
rm -f file5

Upload it to your server, CHMOD to 0755, and run via SSH.
 
Thanks for this... and to matt. I'm just don't know much about that method. I'm afraid of messing other stuff up on the server.

I just don't understand why Putty won't let me paste more text in a single command. It's not like I'm pasting thousands of lines. Even if I could delete 50 URLs at a time I would be happy with that.
 
Throw a file manager script on your server and do some wild card searches and mass delete. Check out eXtplorer, installs pretty quickly.
 
Please keep dripping information about your files, and access so we can keep guessing the best solutions. :338:


Do you need to delete all files in certain directories?

Do you need to delete certain files in directories with lots of other files?



Maybe you need to hire someone to do this for you?
 
Please keep dripping information about your files, and access so we can keep guessing the best solutions. :338:


Do you need to delete all files in certain directories?

In some cases, yes. But I'm fine deleting the files and leaving and empty folder.

Do you need to delete certain files in directories with lots of other files?

Yes.

Maybe you need to hire someone to do this for you?

In theory I should be able to do this extremely easily. I checked out various web sites and they all say the same thing.

How to Delete Files and Fodlers via SSH Tutorial

rm -f myFile.txt myFile1.txt myFile2.txt …etc…

The problem is that I can only paste a certain amount of text. i.e. Putty only accepts 250 characters or so and that's it. That's the longest command that you can make. The rest of it gets truncated for whatever reason.