Questions relating to the Linux remove command (rm)

learn more… | top users | synonyms

0
votes
1answer
48 views

What are the important xml files? (Accidentally moved all xml files)

Very unfortunately I have moved all my xml files into one folder (I was at /home/desgua/ when I run find . -name '*.xml' -exec mv {} ./logs/ \;. Now I am very afraid of turning off my computer and not ...
4
votes
2answers
85 views

How to prevent users from deleting files that are already in use?

Consider this scenario: User is executing a command on a file. This file becomes 'in-use' now. $ tail -f somefile.log In another shell, user deletes the file. $ rm somefile.log Now, this file ...
0
votes
2answers
27 views

How can I change this script in order to delete directories as well?

find /folder/*.* -mtime +14 -exec rm {} \; I tried rm -r and with -R argument, but without any result.
1
vote
1answer
31 views

Receiving an Error when Trying to Delete a File?

I'm trying to remove some files from an installation I screwed up. I went to the directory in the terminal, and typed sudo rm PCSX but it tells me it doesn't exist even though I can quite clearly see ...
1
vote
2answers
61 views

Accidentally ran “rm-rf” on cygwin and lost all the data from my folder [closed]

I am working on window 8 using cygwin. I ran a shell script which was containt command "rm -rf *" I lost all my data :-( Could anyone please help me how to recover my data.. Please. Thanks in ...
2
votes
1answer
40 views

Aliased rm, how do I also alias sudo rm

I aliased rm to a echo use del or full path to rm to save myself from accidental rm (just lost my $HOME to it). But sudo rm still uses /bin/rm. How can I alias it to also print same message? PS: del ...
1
vote
2answers
36 views

delete several files but leave the selected one

I have a folder contenting several folders and I hope to delete all of them but leave one selected, how could I do this with the command "rm "under Ubuntu12.04??
1
vote
0answers
43 views

How to recover user data missing after reset of computer

I was trying to figure out how watch 4oD (as like many people it just loads forever and never actually plays anything) so I used the help on this page: 4oD (UK) - Can't stream I started with ...
1
vote
2answers
55 views

Find packages which files got deleted or missing after installation

I just accidentally did rm -r /var but luckily managed to ^C it before more damages were done. Is there way to find out all packages which files got deleted in the location so I can reinstall them? % ...
1
vote
2answers
101 views

rm file '??q:q '

I accidently created a file named ??q:q and i can't remove it. rm '??q:q' or rm '\?\?q\:q' (To escape the ?) says No such file or directory Another interesting thing: in ls it shows the name as ...
5
votes
2answers
359 views

rm -I to prevent accidental rm

I just created alias rm="rm -I" to prevent from accidental rm command. -I prompt once before removing more than three files, or when removing recursively. Less intrusive than -i, while ...
2
votes
4answers
167 views

`rm -rf ` and `rm -r` have the same results

Bear in mind that I just learning bash so please explain in moderate terms. rm -rf and rm -r appear to do the same thing. The tutorial (https://help.ubuntu.com/community/Beginners/BashScripting) ...
1
vote
2answers
22 views

How to wipe all contents from my user account?

I'm on 12.04 desktop and was wondering if the following command would remove all the data from my user home directory as well as my trash can: rm -r /home/myUser/* If so, can someone confirm that ...
12
votes
6answers
5k views

How can I recursively delete all files of a specific extension in the current directory?

How do I safely delete all files with a specific extension (e.g. .bak) from current directory and all subfolders using one command-line? Simply, I'm afraid to use rm since I used it wrong once and now ...
1
vote
2answers
364 views

Delete directory by referencing symbolic link

To set up the question, imagine this scenario: mkdir ~/temp cd ~/ ln -s temp temporary rm -rf temporary, rm -f temporary, and rm temporary each will remove the symbolic link but leave the directory ...
2
votes
2answers
425 views

Remove files in a directory based on partial name

I wanted to know what is the best way to remove any files no matter what their extension is based on a partial name. Example: 13-05-12_foo_something.jpg 13-06-01_something.png ...
0
votes
1answer
24 views

How do I determine what is using the folder?

I just can't delete the folder under root (it says that resource/device is busy), but lsof and fuser tell me nothing. The folder is located in the depth of /var/www/... and I tried to delete it after ...
1
vote
0answers
1k views

How to fix error “rm: command-not-found” while processing install-info (apt-get cannot install any software)? [closed]

I am running my apt-get in a normal way but today I got some errors while using the apt-get command can anyone suggest any enhancement that I need to make in my configuration files to fix it. I have ...
2
votes
2answers
152 views

Terminal command to remove unknown file

What is the command to remove unknown file from terminal. Edit after following answer: Example: I have two files يا مهدي- Times-يا محمد Events.html مهدي Events.html how do i only first file?
14
votes
4answers
702 views

Exclude from * in command line

There are plenty of situations where the use of a * is virtually inevitable - e.g. rm -rf * in a folder that holds thousands of subfolders and files. But what if you want to exclude just one or two ...
0
votes
1answer
96 views

How to remove duplicated directory?

I have two directory with same name of "Unread". ls -l drwx------ 1 vg vg 200 Aug 4 21:57 Unread drwx------ 1 vg vg 200 Aug 4 21:57 Unread when I rm/mv the directory named "Unread", one ...
0
votes
1answer
92 views

Mistakenly deleted files recursively from '/' on my still running server

I mistakenly deleted the bin folder, now most of the bin cmds do not exist. The server still works just fine but I know when I restart it, I will not like it. How can I fix this without losing system ...
1
vote
1answer
89 views

“Trash” equivalent for 12.04

I recently updated my Ubuntu version to 12.04. I have aliased rm to the command trash, and now that I have upgraded, there is no longer a command called trash. Is there an equivalent for 12.04? I ...
3
votes
2answers
228 views

rm if there's a file with same basename

Say I have the following files: foo.coffee foo.js bar.js Is there an easy way how to rm *.js if there's a corresponding .coffee file? In the example such a command would remove foo.js leaving: ...
0
votes
1answer
145 views

How can I remove this file?

I'm using an Apple Timecapsule mounted via gvfs-mount (I tried cifs too) which contains a file named Capitoli 3:5.odt I definitely want to remove that but I had no luck. From ubuntu the most i ...
1
vote
1answer
605 views

Why is “rm” so much slower than deleting files via the File Manager?

I witnessed that deleting directories (with the size of a couple of gigabytes) which contain many files is very slow when using rm. It takes up to several minutes! When deleting the same folder via ...
0
votes
2answers
1k views

How to remove single file from /usr directory?

I am using Ubuntu 12.04 LTS, and I want "XnRetro.desktop" file to be removed from directory /usr/share/applications using terminal . How to do it ? I am new into Linux & I know something like ...
2
votes
1answer
250 views

LaTeX filepaths in Ubuntu

I'm sorry, this is quite a specific and esoteric question, but I thought if anyone could help... Well, anyway, last night I used ls to look at a directory and noticed some junk hidden files I didn't ...
1
vote
1answer
93 views

Changing rm -r autocomplete behaviour for directories with whitespace in their name

I'm running Ubuntu 12.04. If I try to auto-complete to delete a directory with spaces in the name, it doesn't work. Say my directory is called "some spacey directory". If I type rm -r some and ...
3
votes
2answers
859 views

Copying from mount share drive to local folder through script

This is my first time trying to work with Linux Scripts so this may be something obvious. Here is what I am trying to do: Remove all contents from local folder - rm /home/user/Documents/Exercise/ ...
5
votes
1answer
831 views

Cannot delete file from /home by rm command

I cannot delete a file in my /home folder. Terminal output give me the message: ~$ rm /home/goldap/Загрузки/Put Don Kihota (1934) bash: ошибка синтаксиса около неожиданной лексемы '(' Roughly ...
2
votes
2answers
1k views

“sudo rm” fails to delete files

My main account is called "u1204" and I have some files created with another account called "dad": $ find . -user dad -print ./Documents/Zim Notes/.zim/state.conf ./Documents/Zim Notes ...
9
votes
1answer
5k views

rm: cannot remove `/run/user/root/gvfs': Is a directory

Whenever I type a command which is similar to sudo apt-get install or anything like this I get this kind of error: $ sudo su # exit exit rm: cannot remove `/run/user/root/gvfs': Is a directory How ...
1
vote
4answers
605 views

Unable to “rm” a file named “() - .” due to “No such file or directory”

A script I wrote named a file "() - ." according to Filezilla. Filezilla was unable to delete it from the server so I tried to "rm "() - ." from inside the containing folder and received "rm: cannot ...
5
votes
4answers
415 views

How can I prevent accidental execution of the rm -r *command?

Occasionally I use command to delete some files. For example, the name might start with 'a', so I'll delete with the command rm -r a*, but I don't want to remove some other directory by accident. How ...
3
votes
2answers
2k views

I cannot delete files from root's Trash

I deleted some large files from nautilus launched as sudo. They still show in /home/.Trash-0/files/<foldername> when I type sudo sh -c "du -h /home | grep -P '[0-9]G\t'" but when I type sudo rm ...
1
vote
2answers
3k views

Can't delete file even as root

I tried to delete a directory by running sudo rm -rf google-chrome. This gave no output message but the directory wasn't deleted. There is only one file remaining, google-chrome/default/User\ ...
7
votes
5answers
35k views

How do I remove a folder?

I'm a new user and Im trying to remove a specific folder. I am using sudo rm /path/ but its not working. What is the correct command to use? It is a file catolog I am attempting to remove but im ...
0
votes
1answer
55 views

“Ghost” output from locate?

I deleted some files, but they seem to still exist. Can anyone please explain the output of this: m@work:~$ locate cfx.css | xargs rm m@work:~$ locate cfx.css /var/www/wfox/hbr.co.nz/cfx/a/c/cfx.css ...
3
votes
2answers
2k views

Difference between sudo rm -rf and rm -vf?

Recently I have seen one issue with a cache problem. The problem comes with broken hash and that could be fixed with sudo rm -rf /var/lib/apt/lists/* and sudo rm /var/lib/apt/lists/* -vf But I ...
0
votes
1answer
913 views

How to forcefully delete files (system files) [duplicate]

Possible Duplicate: How to delete/edit files from readonly filesystem i have a memory card (MS-DOS file system I believe) which I want to delete ALL the files in it. Even though I use sudo ...
7
votes
2answers
342 views

How is rm command different from the delete button?

I read from a book where it says, the command rm deletes the inode and not the file. Which means if I delete with the rm command, then it cannot be restored. I'm very new to Ubuntu environment. Now ...
2
votes
4answers
5k views

Command to delete all files from folders matching name recursivly?

I have my base folder (let's call it base). I have a bunch of folders inside, scattered at various depths within these folders are cache folders. I want to delete all files from within the cache ...
0
votes
1answer
158 views

Accidentally removed all Wine files

I was finding that if any way to remove the installed windows program in ubuntu. then i found a forum here http://wiki.winehq.org/FAQ#uninstall_app. then i type in terminal cd $HOME rm -rf .wine ...
0
votes
1answer
361 views

Duplicate /media directory entries

I installed Ubuntu 64-bit 12.04 over Ubuntu 32-bit 32-bit on the same partitions. In my /media directory I have what appear to be duplicate entries. I had found a similar issue on an Ubuntu discussion ...
3
votes
4answers
359 views

“rm” doesn't accept internal command as a paramter

Why doesn't this work? rm $(gsettings get org.gnome.desktop.background picture-uri | awk '{gsub("file://","");print $0}') rm: cannot remove ...
3
votes
2answers
782 views

how to restore boot folder?

No laughing! I just did sudo rm -vr /boot/*. Is there a way to restore the content? Just to clarify why I would do this: I have a SD-card with a boot-partition mounted at /media/boot that I wanted ...
3
votes
1answer
242 views

Removing a tree

CODE EDIT So now that I'm off work I can do a little coding in my free time. The way that I think I want this to work is take a tarball (what I would normally extract to a folder anyway) and compare ...
1
vote
2answers
4k views

how to download “rtsp” flow

I could download a conference from this link (rtsp://real2.infn.it/webcast/2012-esploratori-invisibile/esploratori-dell-invisibile.rm). How can I do it? Thank you previuosly..
4
votes
4answers
3k views

Is there any faster way to remove a directory than “rm -rf”?

I have a folder that has many files and "rm -rf" takes a lot of time to complete. Is there any faster way to remove a directory and it's contents (subdirs, etc)?