Questions tagged [rm]

rm is the command to remove files

43 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4
votes
0answers
53 views

Deleting non-empty directory without w permission while having w permission in parent directory

Here's the situation: dir1/dir2/file.txt permissions: drwxrwxrwx 4 me group 4.0K Jan 11 17:53 dir1 drwxr-xr-x 4 other_guy group 4.0K Jan 11 17:48 dir2 -rw-r--r-- 1 other_guy group 158 Jan 11 17:...
3
votes
1answer
1k views

rm -fr fails to remove directory due to “Is a directory” error

Recently noticed that one of my CentOS NFS clients have a directory which looks somewhat corrupted: CentOS release 6.3 (Final) [root@LG-B8A-LNX ~]# ls -lathr / ls: cannot access /zebra: No such file ...
3
votes
0answers
1k views

Unable to delete files even with root, lsattr is also not responding

I have two somehow corrupt files in my second hard disk of my laptop, which has dual boot Ubuntu 15.04 and Windows 7. I keep it mounted as a ntfs formatted partition in media. I share this drive ...
2
votes
0answers
469 views

File shows up in ls but cannot rm or mv, seems to be held by some unknown process

I do a lot of work on an SGE cluster running CentOS 7, and have recently had issues with jobs dying randomly, but seemingly with some processes still running that prevent me from cleaning up to start ...
2
votes
0answers
1k views

Unable to remove folder, even with `--force`, sudo not needed

Trying to remove a folder: $ rm -r folder rm: cannot remove 'folder/subfolder/cifscaf6': No such file or directory Doesn't work. Let's try with -f: $ rm -rf folder rm: cannot remove 'folder/...
2
votes
0answers
681 views

I can't delete a file from EFI System Partition

I'm trying to delete a file since I installed rEFInd instead or Grub, I want to remove Grub or just remove "grubx64.efi" from my ESP, to make it disappear in the rEFInd boot screen. I can mount my ...
2
votes
1answer
2k views

Cannot remove directory, operation not supported on NTFS

I have an old Windows directory that I have not been able to remove using Windows processes so I moved to Slax Linux to try and remove it. When removing the directory I receive Cannot remove [...
2
votes
1answer
2k views

rm -rf: cannot remove `/opt/jetty': Directory not empty

I have a script using the following command to remove a folder: ssh -q root@hostname sh -c 'rm -rf /opt/jetty/' Most of the times it works fine, but occasionally I get this message: rm: cannot ...
1
vote
1answer
26 views

Find (and delete) all files with hard link count = 1

I'm having a tough time trying to reclaim some unused disk space on one of my macOS 10.13 partitions. Thanks to GrandPerspective, I think I found out that every time I delete some items in Photos for ...
1
vote
2answers
49 views

How can I find the latest log for multiple jobs in AIX and delete the latest one

I am new to unix. I am trying to find the latest log of multiple jobs and delete the latest one. Can I write a shell script for it? I have tried with basic commands, but there it is selecting a ...
1
vote
0answers
50 views

Color rm -i prompt messages

I'm looking for a way to apply custom colors to messages emitted by the rm -i command: ~ $ rm -i file.txt rm: remove regular empty file 'file.txt'? I understand that I need to redirect the stderr as ...
1
vote
1answer
58 views

removing a directory

I'm trying to remove a directory called cc by running the command rm -rf cc, but it has trouble removing a file inside the directory. I get the following error: rm: cannot remove 'boy.mp4' : Input/...
1
vote
0answers
155 views

Unable to delete files from within smplayer

smplayer has an option that allows deleting the currently playing video. This worked well in windows 7, and even in debian 9 till about an year back. It brings up a confirmation dialog box, and if I ...
1
vote
1answer
755 views

Cannot rm file because it doesn't exist?

I've encountered a really weird problem on a NAS volume I'm accessing on OS X. I have a PNG file that I tried to delete, but something went wrong and it still appears when I run ls or view the ...
1
vote
1answer
357 views

What methods for overwrite protection and accidental removing are there?

Apart of unix perms are there other protection for don't remove or overwrite files? By example: Restringing dirs than rm can delete. Overwrite protection when I made cat >file instead of cat >>file ...
1
vote
0answers
1k views

Delete oldest file with a shell script on FTP server

I would like to create a cron job for deleting the oldest file in a directory which is on FTP server. I have created my first shell script #!/bin/sh # connect to backup FTP server... lftp -u (...
1
vote
0answers
178 views

Find directory containing file; execute command in that dir; then delete files

I want to find all directories (recursively) which contain .cue files, execute a command in that directory, then delete all files in that directory with the same prefix as the .cue file. find . -name ...
1
vote
0answers
44 views

Find files inside sub-directories with different names (to remove them with mtime)

I have a set of client folders on a server. Each client has backups inside a "backup" directory like so; ~/backups/<CLIENT_NAME>/{daily, weekly, monthly}/{databases, directories, logs} I'd ...
1
vote
1answer
86 views

How to delete all files in a directory

I don't often use Unix/Linux system but I think something awkward happens to me. I would like to delete all files in the DATA directory in my ksh. rm -f $P_VAR/DIR/DATA/* using this in unix ...
1
vote
0answers
80 views

Are the links between the inode and data blocks of a file removed when deleting the file?

Suppose there is only one hard link to a file. When rm the hard link, the inode and data blocks of the file will be marked as unused. But are the links from the inode to the data blocks of the file ...
1
vote
0answers
903 views

Perl script to delete big directory

This blog gives different ways of deleting Big Directories and their relative times for deleting a directory with 500,000 files. The script using perl is reported to be fastest, which is given by cd ...
1
vote
0answers
5k views

Why is rm -r the same as rm -R?

If you look in the rm man page you see that rm -r, rm -R, and rm --recursive are all the same. -r, -R, --recursive remove directories and their contents recursively When using options, I'm ...
1
vote
0answers
746 views

rm: Directory resources is not empty

I'm getting this kind of error when i'm deleting file on my AIX machine. Getting same error for rmdir. venky-19:[/hm/dev/application/backup/ear/] # rm -rf resources rm: Directory resources ...
1
vote
0answers
389 views

Command that can find files that are not referenced by other files and then delete them

I was wondering if anyone knew how I could go about writing a grep command that recursively finds files that are not being referenced/used in a specific file and/or a directory of files, and then ...
1
vote
1answer
540 views

Prevent active file removal on an NFS filesystem

I clear my logs using following script - find "." -mtime 1 -type f -print0 | xargs -0 rm -rf But it deletes the active files also and creates .nfs… files instead. Is there any way to prevent ...
0
votes
1answer
87 views

I deleted my files with git rm, but i also commited them, how to get them back?

I ran git rm on some files thinking that they will be removed from the bitbucket repository, and i also commited them, after that i checked that they disapeared from the bitbucket repo, but they were ...
0
votes
0answers
53 views

cannot permanently delete Xcode.app in trash, not even if with “sudo rm -rf” because directory is not empty?

I run on osx 10.14, and I was trying to delete and reinstall xcode. I have also tried the following in safe mode but have the exact same problems. I moved xcode.app to trash, right clicked and chose ...
0
votes
0answers
59 views

Using rm --one-file-system to only delete files on the local filesystem

I have a FUSE mount located in /media/writable, however, sometimes this FUSE mount disconnects, but some programs will still attempt to write to /media/writable. When I restart the FUSE mount service,...
0
votes
0answers
40 views

remove program from local terminal

I tried to remove gfortran program from the local terminal windows by: rm -rf /usr/local/bin/gfortran but always I am facing the following : override rwxrwxr-x root/wheel for gfortran? I ...
0
votes
0answers
60 views

How to delete a git repo with submodule from NTFS partition and then git clone it with submodule initialized?

I tried setting my 2 TB hard drive partition into a NTFS file system, per an answer to an earlier question of mine. I moved a heap of my git repos onto it. Some of my repos have submodules, and ...
0
votes
1answer
79 views

How do I remove a directory on a remote system that has a quota?

I have an rsync.net account that has hit its quota and I'm trying to remove (rm -rf) a directory to clean up space. However all the remove commands I can think of to try (rm, truncate, find -delete, ...
0
votes
3answers
208 views

synchronise with remote machine via http, and delete older files

I have a folder in my system(ubuntu) that gets synchronized with work using wget. File-names are in the following format A156.0.1.x, A156.0.y, A156.0.z, A156.0.a, A156.0.b. All files are created at ...
0
votes
1answer
3k views

How to manage “device or resource busy” in a script?

I have a little script that have to remove some files. How can I manage the device or resource busy error of rm? Can I catch it? Like a try/catch? So that if I catch it I, for example, sleep 3 seconds ...
0
votes
1answer
981 views

dd script with timings

Trying to figure out the best approach to a script that will do the following: Create a loop script that creates a 10GB file using dd where, upon completion, removes the file, then repeats 25 times ...
0
votes
1answer
711 views

Unable to delete a directory from vmware?

I am trying to delete a file in hortonbox sandbox setup on my vmware workstation player 12 and I am getting continuous error "invalid argument". rm -rf 1 rm: cannot remove `1': Invalid argument ...
0
votes
0answers
947 views

Removing directories: Shell vs. File Manager

I've noticed that some graphical file manages such as Thunar allow you to remove any directory as long as you are the owner of this directory -- even if this directory contains a sub directory which ...
0
votes
1answer
61 views

OSX: Grammarian won't uninstall

Im trying to uninstall an annoying app on my Mac called Grammarian Pro X and the uninstaller doesn't work with my version of OSX 10.11. You can uninstall the main app but there is still bits of the ...
0
votes
0answers
925 views

Input/output error when trying to remove a file in NFS

I am trying to remove a file that is located on an NFS storage device. rm model_parameters_epoch_000.npz I get the error message: rm: cannot remove ‘model_parameters_epoch_000.npz’: Input/output ...
0
votes
1answer
81 views

Can't delete a file

I trie to use sudo rm -rf .Trash-1001 But it says "The Removing of .Trash-1001/info" is not possible: The directory is not empty. (This is a translation by me because I have German as my system ...
0
votes
0answers
77 views

Cancel removing a directory, and want to find out what have been removed

I was removing a directory by rm -r mydir and cancelled it in the middle. How can I find out what have been removed under the directory? Does remove a content of a directory change the timestamp of ...
0
votes
1answer
368 views

Delete subfolder and keeping up parent folder

I need to delete folderx which are not accessed for seven days, easily I can do it with next: find /path/folder -type d -mtime +7 |xargs rm -rf The probelm is when I have subfolder marked for ...
0
votes
1answer
640 views

when is it safe to remove `/dev/.tmp-block-*` files

i'm currently experimenting with temporary lvm-snapshots (that is: create a snapshot of an LV, do something with the snapshot (e.g. run a backup), then destroy the snapshot. something along the lines: ...
0
votes
3answers
1k views

Unable to delete a file without permissions etc

I have a file in Windows XP left over after deleting Google Chrome. Its location is C:\Documents and Settings\Admin\Local Settings\Application Data\Google\Chrome\User Data\Default\old_Cache_000 The ...