Questions tagged [rm]
75 questions
5
votes
3 answers
directories with two one dot (.) entries
I'm trying to clean up my lost and found, and I've managed to remove most things, but I'm left with "almost" empty directories, like:
lost+found/#14042862:
total 1324
dr---wx--- 2 76040 43010 4096 2011-04-29 07:56 .
dr---wx--- 2 76040 43010 …

Jayen
- 1,857
- 4
- 16
- 28
5
votes
2 answers
can't git rm a directory
I accidentally added a directory to the list of items i'm supposed to git commit. Now when I try to run a git rm dirname, I get the error
rm 'dirname'
fatal: git rm: 'dirname': Is a directory
I tried the following commands git rm -rf dirname and…

John
- 7,343
- 23
- 63
- 87
4
votes
2 answers
Blocking rm -rf for application
I have application which during run-time generates interesting intermediate outputs to ./tmp directory.
At the end of execution this directory is deleted.
How can I preserve contents of it?
I do not have uid 0 on the system.
Therefor I can't…

user23364
- 145
- 4
4
votes
2 answers
How to delete files quicker than rm -rf?
Possible Duplicate:
Millions of files in php’s tmp error - how to delete?
Is there any way how to delete folder/files quicker than with command rm -rf?
It seems my disc is filled with bilions of files (sessions of php5) which were not deleted in…

Byakugan
- 141
- 1
- 3
- 12
4
votes
2 answers
Delete files created 5 mins or earlier in a folder
On CentOS, how can I delete files which are created 5 mins ago or earlier in a folder? Thanks!

ohho
- 1,005
- 8
- 19
- 34
3
votes
2 answers
Delete all files & directories in a folder except one file
I want to delete all files & directories in a folder say 'A'. But except one file in that folder say .keep. I have tried the following command.
find A ! -name '.keep' -type f -exec rm -f {} +
But above command also deletes folder A. I do not want…

Dushyant Joshi
- 101
- 1
- 10
3
votes
4 answers
Can I recover from "rm /*"?
I'm running Debian... And, I accidentally ran "rm /*" as root (hurray!) - luckily I didn't use -r, so the dirs are still intact. However, when trying to boot, I get...
run-init: /sbin/init: No such file or directory
Kernel panic - not syncing:…

Nick Bolton
- 5,126
- 12
- 54
- 62
3
votes
1 answer
Why does docker rm take almost 6 seconds to run?
I have a simple docker image based on ubuntu 15.10 that's just running bash. The image is around 1.2gb. It launches very quickly, but when I try to remove the container after it's exited, it always takes around 6 seconds:
$ time ( echo "exit" | sudo…

Jesse Crossen
- 131
- 4
3
votes
5 answers
Deleting files in Linux
I need to find all files matching a certain criteria and delete them - here's a snippet:
/var/www/somesite/releases/{many directories}/tmp/attachment_fu
I'd like to find all files in any tmp/attachment_fu directory and delete them - the problem is…

user18816
- 165
- 4
3
votes
1 answer
vmware esxi - Can't delete directory, not even with rm -rf
I am trying to delete a directory but it's not working.
When using rm -rf IPCop I get the error message rm: can't remove 'IPCop': Directory not empty.
Another thing I noticed was, when executing ls in this directory I get this output: ls:…

Zulakis
- 4,153
- 14
- 48
- 76
3
votes
2 answers
rm + how to remove file with special Characters
I have this file in my linux machine:
----------9976723563nneh4_-----192.9.200.4
I try to delete this file but I cant as all see here:
what need to add to rm in order to remove this file ?
rm "----------9976723563nneh4_-----192.9.200.4"
rm:…

yael
- 2,433
- 5
- 31
- 43
3
votes
3 answers
User can't remove symlink which owns
I'm trying to remove symlink, although I have appropriate permission, the operation is denied (the user is called capistrno):
capistrno $ rm -f /var/www/app/current
rm: cannot remove `/var/www/app/current': Permission denied
the user should have…

Tombart
- 2,143
- 3
- 27
- 48
3
votes
4 answers
rm intermittently causes disk to lock up
I have encountered this extremely strange problem on two servers now, both running CentOS5, both of them ext4. One is a SSD, the other is a regular hard drive, both SATA without RAID.
The issue is the following, when I run rm -r on a directory with…

user788171
- 279
- 1
- 5
- 13
3
votes
2 answers
How does `rm -rf` work
When I try rm -rf on a directory which has a lot of subdirectories and/or files and which is mounted with SSHFS, then I takes a while to execute.
Is it normal ?
I would like to know how rm -rf works internally, at the Files System level.
Does it…

Charles
- 185
- 2
- 8
3
votes
1 answer
What happens when you 'delete' a file as opposed to securely shredding it?
I read that when you delete a file, depending on the situation, its possible to recover its contents.
What happens on a hardware level when you you 'delete' a file, ex. $ rm myFile as opposed to securely shredding it, ex. $ shred myFile that makes…

user784637
- 1,542
- 7
- 35
- 52