Please Login or Register

Knowledgebase

Linux/Unix Command: rm - Remove (delete) files/directories

rm - Remove (delete) files/directories

CODE:
$ rm [options] [file/directory]

The rm command removes (deletes) files/directories, on your server via SSH.

For example:

CODE:
$ rm /file.txt

Would delete the file.txt in the / directory, assuming the file.txt file is writable, this command is likely to ask if you want to delete before preforming the command.

 

CODE:
$ rm -f /file.txt

Would delete the file.txt in the / directory, using the "-f" or "--force" option will execute the command without prompting.

 

CODE:
$ rm -r /directory/

Would delete all the contents in /directory/ recursively using the "-r" or "-R" or "--recursive" options.

 

Options:

-d, --directory
unlink FILE, even if it is a non-empty directory (super-user only)
-f, --force
ignore nonexistent files, never prompt
-i, --interactive
prompt before any removal
-r, -R, --recursive
remove the contents of directories recursively
-v, --verbose
explain what is being done
--help
display this help and exit
--version
output version information and exit

 






Was this answer helpful?
Add to Favourites Add to Favourites   Print this Article Print this Article
Also Read

Powered by WHMCompleteSolution

Language:


Web Hosting
Client Login
Web Hosting

Email

Password

Remember Me


Web Hosting
Search
Web Hosting




Follow Us on Twitter