How to delete Files and Directories using SSH?

Your SSH console would be your helpful friend with any kind of command concerning your files and directories. For example removing files and folders is easily done using the rm command which comes from remove.

For example:

rm filename

and it will ask you to confirm the file deletion.

using the -rf options you can force delete recursively ( if it is a folder) without asking you for confirmation. It is useful if you are planning to delete a folder with a lot of files as you would have to confirm for every single file in it.

rm -rf /path/to/folder/

To delete all files and folders in the current directory you can use:

rm -rf *

Please be very careful with using the rm command.

  • 0 کاربر این را مفید یافتند
آیا این پاسخ به شما کمک کرد؟

مقالات مربوطه

SSH ip command

If you wish to obtain information about your server’s IP on a Linux machine using SSH you can use...

SSH rm command

If you wish to remove a file or folder from your Linux system you can use SSH rm command. In this...

SSH echo command

One of the most useful commands in a Linux environment is echo. With it, you can provide output...

SSH history command

If you wish to find what commands you have previously executed in a Linux environment you can use...

SSH cd command

SSH cd command is mainly used to navigate in your Linux environment. In this article, we’ll show...

Powered by WHMCompleteSolution