delete backup files using putty

JawadArshad

Well-Known Member
PartnerNOC
Apr 8, 2008
459
7
68
PK
cPanel Access Level
DataCenter Provider
How can I delete back up files using putty (SSH). I want to know the commands.
What kind of backup files do you want to delete. Go to the folder where the backup files are located using the command below.

cd /path/to/backup/folder/

The command below will delete the file named 'backup-file'.

rm backup-file
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,545
12
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
Removing files via command-line (CLI) SSH access

How can I delete back up files using putty (SSH). I want to know the commands.
Please use the following command to review the official manual "man" page for the "rm" utility:
Code:
# man rm
Via SSH, the "rm" command could be used; however, this must be done so carefully so as to not inadvertently remove important or required data.

The command-line (CLI) switch "-r" should only be used if needing to "recursively" remove a directory and all of the contents within that directory. As a safety precaution, I recommend to not use this option unless absolutely required for removing an entire directory structure and its contents.

The CLI switch "-v"may be used to enable verbose output that will explain what is being done, such as indicating when a file is removed. I recommend using this option so that there will be a more visual record of what actions are performed, excellent for copying-and-pasting.

The CLI switch "-f" may be used if needing to force the removal without prompting and ignoring nonexistent files.

The CLI switch "-i" may be used if needing to interactively confirm the removal of each file by answering a prompt for yes or no; this may be a desired option to use if there is any uncertainty involved in what is needing to be removed.

The following example could be used to forcefully remove a file named "backupfile.tar.gz" that is located in the same directory that you're currently in (where "backupfile.tar.gz" should be replaced with the actual file name involved):
Code:
# rm -fv backupfile.tar.gz
The following example could be used to interactively remove a file named "backupfile.tar.gz" located in a directory path of "/path/to/" (where "/path/to/backupfile.tar.gz" should be replaced by the actual directory path and file name of the file to remove):
Code:
# rm -iv /path/to/backupfile.tar.gz
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,545
12
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
Hi there, I used tht command on ssh & nothing happend, where the error?
Multiple commands were discussed in this thread. Please clarify exactly what command was used and what you were expecting to happen using the specific command.

The following command may be used to obtain a history of the commands entered for the user you are logged-in as:
Code:
# history