-1
votes
2answers
92 views

Behaviour of “rm -r”

Up until now I was using Ubuntu, and the behaviour of rm for directories was the following: rm -r dir would remove dir if it was empty, and give an error otherwise rm -rf dir would remove dir and ...
16
votes
3answers
1k views

How can I remove a file or directory called “\”?

I'm using terminal on a Ubuntu machine and there is a file that I would like to delete. The file's name is \ (just a backslash). Now usually I would just do rm filename However if I do rm \ then ...
8
votes
3answers
10k views

Can files deleted with rm -rf be recovered?

When I delete folders or files in through osx terminal using the rm -rf, where do they go? I heard that some say they are deleted directly, but some also say it only "remove the link to the file ...
0
votes
2answers
313 views

recursively delete but keep .gitignore file

I've been trying out several methods from SU but I have been unable to do this: I got a folder (example: /var/www/tmp/) which contains several files and directories. I'd like to delete all the files ...
1
vote
4answers
1k views

Where do files and directories go when I run 'rm -rf folder_or_file_name' in Ubuntu 10.04?

When I delete folders or files in the Nautilus GUI, those folders/files go to Trash but where do folders/files go when I run rm -rf folder_or_file_name in terminal in Ubuntu 10.04?
0
votes
1answer
97 views

How to remove files that start with 2011XXXX

I have a bunch of files i need to delete, they all start with 2011XXXX. How would i delete them. So far i have this command: ls | grep 2011 | xargs rm And it works, but is there a better way to ...
0
votes
2answers
75 views

Remove files which have a certain syntax

I have a couple of files which follow this syntax: *_yyyy-mm-dd_hhhmmm.* Example: *_2010-01-01_00h10m.* *_2010-01-01_01h10m.* *_2010-01-01_02h10m.* *_2010-01-01_03h10m.* ... ...
2
votes
3answers
515 views

Why does rm -rf not yield an error?

ubuntu 9.10 if you type rm you get a missing operand error, same thing with rm -r but rm -f yields no error. -f is supposed to be 'force' not 'dispell errors'