

Let say their is a file name -file.txt, to delete this file write command as: $ ls This extra dash is necessary so that rm does not misinterpret the file name as an option. Stallman,ĭelete file whose name starting with a hyphen symbol (-): To remove a file whose name begins with a dash (“-“), you can specify a double dash (“–“) separately before the file name.

Written by Paul Rubin, David MacKenzie, Richard M. There is NO WARRANTY, to the extent permitted by law. This is free software: you are free to change and redistribute it. License GPLv3+: GNU GPL version 3 or later.
#OS X UNDELETE FROM RM SOFTWARE#
–version: This option is used to display the version of rm which is currently running on your system.Ĭopyright (C) 2016 Free Software Foundation, Inc. Now, deletion from A directory(as parent directory) will be done as: $ rm *Įvery directory and file inside A directory is deleted.Ĥ. Normally, rm wouldn’t delete the directories but when used with this option, it will delete.īelow is the tree of directories and files: $ ls At each stage it deletes everything it finds. r (Recursive Deletion): With -r(or -R) option rm command performs a tree-walk and will delete all the files and sub-directories recursively of the parent directory. I want every rm command (that I run) to be logged somewhere. Are you sure (y/n) ': I do not want these modification to interfere with any scripts or apps or any system tool that would be running a rm command.
Something like 'current directory isNote: -f option of rm command will not work for write-protect directories.ģ. See a new line prompt whenever I run rm or rm -rf as sudo or as normal user. Rm: remove write-protected regular empty file 'e.txt'? n The -f option overrides this minor protection and removes the file forcefully. f (Force Deletion): rm prompts for confirmation removal if a file is write protected. i (Interactive Deletion): Like in cp, the -i option makes the command ask the user for confirmation before removing each file, you have to press y for confirm deletion, any other key leaves the file un-deleted.

