rm Questions

5

Solved

rm -r .git rm -r .git --force I get the following and there seems to be a never ending supply after I enter 'yes' and move to the next. override r--r--r-- redacted/staff for .git/objects/95/9008...
Impassioned asked 24/3, 2019 at 4:20

5

Solved

When I do rm file.txt or rm *.txt I'm prompted for each file, since I didn't specify the -f option to rm. But when I do this: find . -type f -name '*.txt' | xargs rm the files are removed...
Cutworm asked 16/3, 2017 at 7:43

3

Solved

Background I have a PowerShell script that writes some results into a file. I want to remove the result file automatically at the start of the script with Remove-Item. You can remove the result fi...
Onetoone asked 29/7, 2020 at 15:51

3

I am trying to remove a directory /path/to/dir using the rm -rf command. Unfortunately I get the error rm: cannot remove '/path/to/dir/.nfsdda293a660f276ca0000000a': Device or resource busy After ...
Greensward asked 22/4, 2022 at 1:32

8

Solved

I've got a seemingly un-deletable directory in Unix that contains some hidden files with names that start with .panfs. I'm unable to delete it using either of these commands: rm -R <dir> rm ...
Bess asked 5/6, 2013 at 18:48

8

Solved

I have hundreds of directories and files in one directory. What is the best way deleting only directories (no matter if the directories have anything in it or not, just delete them all) Currently...
Quizzical asked 10/5, 2011 at 16:19

3

Solved

Unable to remove .git I have a git repository, Rift, that I am trying to remove. On attempting to run rm -rf, I get the error: rm: cannot remove 'Rift/.git/objects/pack': Directory not empty. When ...
Dipetalous asked 16/11, 2020 at 3:40

6

Solved

I accidentally removed the entire directory of my source code...with a nice rm -r. I know, really bad; but fortunately, I had a git repo in the containing directory. Thus, git has a huge list of un...
Schnurr asked 23/7, 2014 at 13:28

8

Solved

I did: git init git add . git rm -rf dirname Looking at other answsers, git reset --hard HEAD, git checkout -f and git reflog did not work, apparently because there is no HEAD to go back to, nor...
Pomander asked 10/3, 2012 at 5:14

12

Solved

I want to delete all files which have names containing a specific word, e.g. "car". So far, I came up with this: find|grep car How do I pass the output to rm?
Menedez asked 31/12, 2013 at 14:0

8

Solved

I am trying to delete erroneous emails based on finding the email address in the file via Linux CLI. I can get the files with find . | xargs grep -l [email protected] But I cannot figure out h...
Personate asked 25/12, 2010 at 2:53

12

Solved

In Linux, how do I remove folders with a certain name which are nested deep in a folder hierarchy? The following paths are under a folder and I would like to remove all folders named a. 1/2/3/a ...
Doubletalk asked 23/10, 2012 at 14:26

20

When using sudo rm -r, how can I delete all files, with the exception of the following: textfile.txt backup.tar.gz script.php database.sql info.txt
Rosenblast asked 1/12, 2010 at 14:13

10

Solved

What delete command can be run to remove only files in given directory NOT directories NOT sub-directories NOT files in these sub-directories. Some files don't have extensions so rm *.*...
Laminar asked 10/10, 2011 at 15:13

3

Solved

I'm trying to pipe some files from the find command to the interactive remove command, so that I can double check the files I'm removing, but I've run into some trouble. find -name '#*#' -print0 |...
Rhombencephalon asked 18/8, 2013 at 19:24

3

Solved

rm is to remove item, but what is the parameter -rf do or signify? Whenever I typed help -rf it printed the entire list of available commands in powershell. What happens if you type rm -rf in powe...
Ragi asked 4/5, 2012 at 6:36

5

Solved

I'm trying to work out a command which deletes sql files older than 15 days. The find part is working but not the rm. rm -f | find -L /usr/www2/bar/htdocs/foo/rsync/httpdocs/db_backups -type f \(...
Dace asked 25/6, 2012 at 14:40

4

Solved

I've got a bunch of files that end in "-e" that I want to remove. $ find . -name "*-e" exec rm {} \; find: exec: unknown primary or operator Is the regex expanding in some way that messes everyt...
Vigue asked 13/1, 2015 at 5:50

5

Solved

sorry if this is a noobie question but I can't find a good answer. To find then remove something I can use find . -name ".txt" -exec rm "{}" \; But why can't I just pipe the results to rm like ...
Agma asked 1/12, 2013 at 0:24

4

Solved

I would like to delete all the emacs backup (~) files from subfolders. I am aware that I can cd in every single folder and delete them using rm *~ (e.g. for backup file test.cpp~). How I can dele...
Archfiend asked 17/3, 2017 at 10:50

5

Solved

I have a Makefile that defines a .PHONY clean target for cleaning up .o files and executables, that target looks like: ... .PHONY : clean clean: rm $(addprefix $(vq_DIR),$(vq_OBJS)) \ $(addprefi...
Priesthood asked 22/2, 2014 at 3:26

1

Solved

When I deploy my server I got errors server_1 | (node:9) UnhandledPromiseRejectionWarning: /usr/app/packages/server/dist/modules/listing/create/resolvers.d.ts:1 server_1 | (function (exports, requ...
Margarethe asked 3/1, 2019 at 8:21

1

Solved

I have this command: rm -rf ~/.quicklock; echo $? rm -rf ~/.quicklock; echo $? rm -rf ~/.quicklock; echo $? rm -rf ~/.quicklock; echo $? always exits with 0, even if directory does not exist. I ...
Burgwell asked 2/3, 2018 at 5:32

3

Solved

I want to delete files from a specific directory recursively. So, I have used find . -wholename "*.txt" -delete We can also delete the files using rm -rf *.txt What is the difference between...
Capitalism asked 2/7, 2012 at 10:47

3

Solved

I see that this question is getting popular. I answered my own question below. What says Inian is correct and it helped me to analyze my source code better. My problem was in the FIND and not in t...
Valeric asked 14/4, 2016 at 8:47

© 2022 - 2024 — McMap. All rights reserved.