The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
2answers
48 views

Delete oldest directory, skipping two of them

I have to delete oldest directory. But, two of directories does not have to be "included" in this action. So, directory content looks like this: [root@myserver backup]# ls -la total 84 drwxr-xr-x 21 ...
-3
votes
2answers
85 views

Remove all files in directory except last 20

I have question why is my cmd for "removing all files in directory except last 20" not working within cron but in command prompt yes. * * * * * ls -1tr /home/testusr/test | head -n -20 | xargs -d ...
1
vote
1answer
48 views

How to delete special character in linux

By mistake I made a file with the name \. How do you delete something like that? I've tried rm --\ rm "\" rm -- -\and nothing seems to work. I bet it's so simple but I'm stumbled - any suggestions?
1
vote
0answers
71 views

Composer runtime error when deleting subdirectories

I am running 'composer install' on my server, and then using the script feature to delete all subdirectories called '.git' but I am running in the following composer error. Delete all .git dirs find: ...
1
vote
1answer
62 views

Ubuntu server: Delete first folder in directory

How can I grab the first subfolder in a directory and delete it? I found a script to monitor the free diskspace. It sends an alert email if space runs low, but I want to also delete some unneeded ...
7
votes
3answers
409 views

How to keep subtree removal (`rm -rf`) from starving other processes for Disk I/O?

We have a very large (multi-GB) Nginx cache directory for a busy site, which we occasionally need to clear all at once. I've solved this in the past by moving the cache folder to a new path, making a ...
1
vote
5answers
198 views

How to remove a file where the file name has utf-8 character issues

I want to remove a file from a server via bash rm command. This is a sample file Test_ Mürz.jgp. How would one go about removeing files with such chars issues in the filename on a grand scale ... ...
1
vote
1answer
68 views

How to increase deletion speed of several folder

I have a script containing about 420k lines of "rm -rf" command like which where generated using a "find" statement. Each pdf's folder is containing between 1 and 30 files (no subfolder). rm -rf ...
2
votes
1answer
2k views

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 ...
-2
votes
2answers
36 views

Ubuntu - utilities ask about each file? [closed]

I'm using Ubuntu 12.10 after doing something like sudo rm *.log it asks me about each file. do you want to delete 1234.log y/n ? do you want to delete 12345.log y/n ? It is having this same behavior ...
1
vote
2answers
195 views

rm + how to remove file with special Characters [duplicate]

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 ...
1
vote
3answers
541 views

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 ...
0
votes
3answers
156 views

Why “jobs -p | kill -n 15” doesn't work?

I'm very new to Linux. And as a matter of fact I use Cygwin now and not Linux itself. I'm trying to install RVM (Ruby Version Manager). I was doing rm -r ./.rvm -i command. I wanted to remove .rvm ...
0
votes
2answers
1k views

Can't delete corrupt files on Linux

So I got hit by a script kitte... Fortunately the box is Ubuntu and was able to replace w/ binaries from a comparable system, however, Some of the files I couldn't delete, and am still stumped on ...
3
votes
4answers
308 views

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 ...
1
vote
2answers
726 views

How to delete files quicker than rm -rf? [duplicate]

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 ...
2
votes
4answers
239 views

How to quickly remove hundreds of thousands of files? [duplicate]

Possible Duplicate: Doing an rm -rf on a massive directory tree takes hours I'm running a simulation program on a computing cluster (Scientific Linux) that generates hundreds of thousands ...
0
votes
2answers
80 views

Pausing deletion of directories if load is high

I have a list of directories that I'd like to delete. However when I do them all at one, load spikes on the box. Does anyone have an example of a script that would wait until load was under a certain ...
3
votes
2answers
353 views

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 ...
-1
votes
2answers
125 views

remove files starting with dash

I have (by mistake) created several files starting with a dash in my home directory. I can not select them nor delete them. # ls -lht -rw-r--r-- 1 root root 325 Mar 22 16:33 -s-vmstat-overall ...
2
votes
3answers
309 views

Recover data from EXT3 filesystem

Our junior sysadmin accidently deleted some of the directories. Can anyone please suggest any free/proprietary application to recover files from an EXT3 filesystem (RHEL 5.x) ?
3
votes
1answer
91 views

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 ...
88
votes
24answers
26k views

How do I prevent accidental rm -rf /*?

I just ran rm -rf /* accidentally, but I meant rm -rf ./* (notice the star after the slash). alias rm='rm -i' and --preserve-root by default didn't save me, so are there any automatic safeguards for ...
3
votes
2answers
3k views

Is there a way to delete 100GB file on Linux without thrashing IO / load?

I have a huge log file I need to delete on a production web server. I'm worried it'll bring the system to a crawl if I rm it on Linux. Any brilliant ideas? Update: Filesystem: ext3 Partition: /var ...
1
vote
4answers
886 views

Cannot remove or list directory (ls or rm) Linux - Debian

I have a log file directory at /var/log/apache2/vhosts on a Debian dedicated server. Every day I split the main access_log into respective vhostname.com_access_log files in /var/log/apache2/vhosts In ...
2
votes
4answers
16k views

Cannot delete folder with rm -rf. Error: device or resource busy

I'm trying to delete /var/www/html but I'm getting this error: rm: cannot remove `html': Device or resource busy
1
vote
3answers
587 views

Very slow rm -rf on OpenVZ VPS with Debian 6 installed

I recently bought OpenVZ VPS and compared to a dedicated servers rm -rfoperation takes considerably longer to complete (about 4x - 5x longer). This is case even if there is one big file as opposed to ...
2
votes
5answers
628 views

Disable rm * on production servers

Is there a way to block rm with a single * in production servers? This would help prevent accidents like: rm test * instead of rm test*
2
votes
2answers
1k views

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!
5
votes
3answers
121 views

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 ...
0
votes
2answers
619 views

How can I remove a directory that I own when it contains subdirectories owned by another user?

I have created a directory /home/web/test on a Debian server using a basic unprivileged account web. Another account — tomcat — then created some subdirectories and files in that folder (as you might ...
4
votes
2answers
317 views

Difficult to Delete Files in Linux

There's a lot of stuff about this on the Internet, but most of the examples there are contrived. How does one delete files that are really stubborn? e.g., $ find ./ -inum 167794 ./àKÈÿÿÿÿ@ $ find ...
3
votes
2answers
2k views

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 ...
2
votes
2answers
2k views

How can I reclaim bytes from a nearly full, 850G mongodb partition?

Woke up this morning to find out MongoDB grew to all available disk space for some reason. I cannot repair the db to compact it, as I have no space left. I can't even start postgres to remove an old ...
1
vote
2answers
707 views

Cannot delete a dir via SSH: etc/rc.d/init.d/functions': Operation not permitted

I am attempting to delete a backup directory on MediaTemple's (dv) via SSH. The directory is "old" and contains the entire server contents from OS level that (mt) backed up there after my server was ...
4
votes
3answers
4k views

Remove directories in Solaris

I am using Solaris. I have several directories with the following names: saa_first.data saa_second.data saa_third.data I want to remove these directories along with its content, so I use: rm -fr ...
1
vote
2answers
589 views

How do I delete a directory that has many subdirectories?

I have a directory with many subdirectories. I tried doing rm -rf mydirectory but it was still running after 1 hour. I have tried getting the number of subdirectories with ls -l . | egrep -c ...
5
votes
9answers
1k views

Best practices to prevent 'rm -rf /' in bash scripts

It's well known fact that extra space in env.variable can lead to deletion of / directory in bash script. #!/bin/bash ... rm -rf /$MYPATH if $MYPATH contains values like " dir" or "dir /" it will ...
1
vote
6answers
901 views

Linux console - prevent accidental deletion of files

Yesterday I deleted /etc by mistake. I remembered I found a software to prevent this kind of things but I can't find it anymore. I don't remember the name and actually Google is not helping. It had ...
52
votes
21answers
17k views

rm on a directory with millions of files

Background: physical server, about two years old, 7200-RPM SATA drives connected to a 3Ware RAID card, ext3 FS mounted noatime and data=ordered, not under crazy load, kernel 2.6.18-92.1.22.el5, uptime ...
0
votes
1answer
232 views

OSX: Undeletable files

So via what I suspect is a cron'd rsync gone awry, I noticed that I have ~25000 variants of .DS_Store in a directory that's on an external disk, they're named "..DS_Store.FOO" where FOO varies. The ...
21
votes
10answers
19k views

How to make `rm` faster on ext3/linux?

I have ext3 filesystem mounted with default options. On it I have some ~ 100GB files. Removal of any of such files takes long time (8 minutes) and causes a lot of io traffic, which increases load on ...
2
votes
2answers
202 views

I removed the run directory of /var/run on Debian and need to fix it

Can anyone tell me how I can undo a sudo rm -r /var/run mistake? I am unable to use sftp and mysql now.
0
votes
3answers
603 views

Ubuntu rm not deleting files

My colleague and I have been struggling with deleting a directory and its contents. We are working on a new version of our websites source code on Ubuntu 8.04 (dir: /var/www/websites), what we want ...
3
votes
4answers
1k views

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 ...
0
votes
1answer
224 views

How is it possible for rm to throw “not a directory” and “is a directory errors”?

I got a strange error the other day. Attempting to rm -rf nav/ a directory threw "not a directory", but trying to rm nav errored with "is a directory". How is this possible?
3
votes
5answers
330 views

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 ...
7
votes
3answers
3k views

Unix magic, delete all .pyc files from a tree of directories?

Is there a quick way of deleting all the .pyc files from a tree of directories?