Deleting is the act of removing a file.

learn more… | top users | synonyms

35
votes
5answers
284k 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 ...
31
votes
3answers
29k views

How do I delete all empty directories in a directory from the command line?

Say I have a directory named foo/. This folder includes subdirectories. How can I delete all the empty directories in one command?
22
votes
2answers
24k views

How do I remove all files that match a pattern?

When I revert in Mercurial, it leaves several .orig files. I would like to be able to run a command to remove all of them. I have found some sources that say to run: rm **/*.orig But that gives me ...
16
votes
2answers
31k views

Is it safe to delete a lost+found folder?

I have an empty seperate partition used for my vhd/virtualbox. mounted at /mount/win7. I've deleted everything now and there's a lost+found folder left over. It takes up about 5gigs Is it safe to ...
16
votes
1answer
7k views

Deleting contents of ~/.local/share/Trash/expunged …?

Is there a safe way of deleting contents of ~/.local/share/Trash/expunged ? I see It has lots of files & folders I had deleted -- from the trash as well. They are taking a lot of disc space. ...
15
votes
7answers
102k views

How do I remove my Ubuntu partition from Windows 7 and reuse the space?

I am dual-booting Windows 7 and Ubuntu, both installed on separate partitions. I don't need Ubuntu anymore. How can I remove the Ubuntu partition(s) and add the reclaimed space to my Windows 7 ...
13
votes
5answers
4k views

Is it safe to delete every hidden folder in the home directory?

My $HOME (otherwise known as '~') directory has lots of hidden configuration folders. Is it safe to delete all of them? To be specific Will the OS break if I do so? Will my ethernet/printer/sound/...
13
votes
1answer
2k views

Is it possible to delete files when another filesystem is mounted on the path?

Having just written an answer about moving /usr to a new partition I was wondering about deleting files once a new partition has been mounted. To use the example from the question, is it possible to ...
13
votes
7answers
14k views

Why do I get “Directory not empty” when I try to remove an empty directory?

I have this empty directory, but I keep getting the following error message: Cannot remove test: Directory not empty I know this question has been asked plenty of times but none of them helped. I ...
13
votes
2answers
46k views

How to recover Deleted Files and Folders?

How I can restore files and folders. I've deleted my home folder recursively. :(
11
votes
2answers
897 views

How to make my system delete all the files in a certain directory older than a certain time while keeping the directory structure intact?

I have a directory on my machine, think of it as my own sort of tmp directory, but it's in my ~ directory. And I want to make it so that my system every 3 hours deletes all the files in (though ...
11
votes
3answers
17k views

How do I delete a hard link?

Recently I created a link with the following: sudo ln -n originalFileLocation How do I delete a hard link?
11
votes
2answers
7k views

How to delete all the settings for Deja Dup

When I upgraded to 11.04 Deja Dup started behaving strangely, it would begin a new full backup everytime the computer was started because it was looking for a drive and folder which I had removed some ...
10
votes
5answers
20k views

How to recursively remove .svn metadata folders?

I have a Java project and it used a SVN repository, now I decide to change to GIT. However the problem is that SVN engine that I used created in every folder of the project the .svn metadata ...
10
votes
2answers
2k views

What happens if you Trash the Trash?

I was just wondering what would happen if I went and moved the Trash located here: /home/neo/.local/share/Trash To my Trash? I mean if I go to that folder and right-click on the contents and tell ...
10
votes
2answers
901 views

Intercepting calls to rm, and directing deleted files to trash instead

Is there a way to intercept calls to rm, and instead of permamently deleting the files, moving them to trash instead?
9
votes
7answers
21k views

Unable to delete file - no such file or directory

How can I delete a file that is there but the system says is not there?
8
votes
3answers
2k views

What does rm -rf do?

What does rm -rf do when used to remove files or directories? How do the -r and -f options work together?
8
votes
4answers
51k views

How to delete/edit files from readonly filesystem

I am having problem with my memory device (actually a memory card that act external memory device like pendrive). experimentx@workmateX:/var/www/zendtest$ sudo rm /media/A88F-8788/python-2.7.1-...
8
votes
2answers
8k views

Ubuntu deleted files from guest account desktop

I have Ubuntu 12.10 and was using guest account. I downloaded some files on desktop and shutdown my m/c after use. Now today when I logged in to guest account to copy those files but surprisingly ...
8
votes
2answers
656 views

How do I delete the target of a symbolic link without deleting the link itself?

I have a symbolic link ~/Desktop/test.txt which points to ~/rendu/test.txt. I know ONLY the path of ~/Desktop/test.txt, I want a fast way to delete ~/rendu/test.txt WITHOUT deleting the symbolic link....
8
votes
1answer
2k views

How to prevent a file under user folder to be deleted?

How can I make some file impossible to be deleted by user even if it is under his/her home folder?
8
votes
3answers
25k views

Ubuntu: Can I delete /var/log files due to low root space

Just had the message: Low disk space.. 2 GB left Judging by a posted message on ubuntu.org forums, I found that I have a .log file in /var/log at 22 GB in size!! My root is an 82 GB partion and ...
8
votes
2answers
3k 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 ...
7
votes
2answers
568 views

Is there a significant disadvantage to aliasing rm to do something else?

I've been bitten a few times recently with rming things I shouldn't have - for example, forgetting to ulink symlinks, not rm them. I'm thinking of writing a small bash script to simply move the ...
7
votes
3answers
3k views

Removing sources after building from them

Suppose, we've built some package from sources (configure make install). May we remove sources directory after successful building? Or it depends? On what, then?
7
votes
1answer
11k views

Where is the delete account button in Thunderbird on Ubuntu 12.04

I was unable to find the "Delete account" button in Thunderbird on Ubuntu 12.04. Saw posts saying that I can find it at the bottom left side, but could not find it. Please help me find that button.
7
votes
2answers
372 views

Is there a way to recover a file that I have deleted but is still open somewhere?

This question is related to How to recover deleted files? but it is slightly different in nature. Suppose I have a file named ~/something open in a text editor. Further suppose that I open a terminal ...
7
votes
2answers
16k views

How to stop and remove the docker

I'm trying to remove a docker/images/containers and all stuff which is somehow connected with docker, but first of all I neeed to stop it. While I'm trying to execute this command: docker stop $(...
7
votes
1answer
14k views

How to recover deleted folders or files (by shift+delete) from an NTFS partition

I have a 80 GB hdd in which Ubuntu is installed alongside windows. I also have a 500 GB hdd having 3 partitions in which i store my data. Actually i mistakenly deleted a folder permanently in one of ...
7
votes
4answers
5k views

Delete confirmation missing when I hit the delete key

I'm sick of accidentally deleting files and directories as DEL button is badly located on my keyboard. I would really like it if ubuntu asked me to confirm before deleting anything. Is there a way to ...
7
votes
2answers
2k views

Disable shift-delete for file deletion

As an re-education procedure in order to reduce (likely) future data loss, I wish to disable the Shift+Del functionality to delete files in Ubuntu (11.10 and 12.04). Also, if I could replace it with a ...
7
votes
2answers
5k views

Is there a GUI program to securely delete files and folders? [duplicate]

I see there's a lot of info in the answers to this question. I have used such CLI commands added to the context menu of the file manager (mostly Thunar's custom actions, which I favour over Nautilus, ...
6
votes
3answers
34k views

How to delete all the files with a certain extension from a folder and all of its subfolders?

I want to remove all the .jpg files from my Music folder in order to save room. My Music folder contains subfolders, and I would like to know if there is a command to remove all the .jpg files from ...
6
votes
2answers
3k views

vim/gedit delete words between character

I have a huge file with the entries like the one below: <option value="201">Medical</option> <option value="203">Finance</option> <option value="205">Tax Return</...
6
votes
2answers
221 views

I can continue playing a video after I Shift-Delete it. Is the disk-space freed when I close player?

I've noticed that I can actually Shift-Delete (ie. doesn't go to Trash) a video which is currently playing, and it still keeps on playing, even though there is no named reference to it in nautilus or ...
6
votes
1answer
8k views

How do you delete files in the location: /usr/local/src?

I tried to move a file into the rubbish bin (because I followed some instructions about installing sage and it involved moving a file to that directory) and it gave me errors saying that I didn't have ...
6
votes
6answers
23k views

Why I can't delete a folder?

Could not remove the folder [Folder name]. Show more details Error removing file: Directory not empty Cancel-Skip All-Skip I tried to delete these folders from terminal with: rm -r
6
votes
1answer
372 views

How to detect files with the same name but different extensions?

I have a directory whose files have extension either .JPG or .NEF and I want to delete the files of the form X.NEF for which X.JPG does not exist in the directory. (X here can be any string.) I don't ...
6
votes
1answer
7k views

Can I safely remove all the files in /tmp?

I want to make free space on my computer, and Baobab tells me /tmp is 8 Gio large. Can I delete all the files in /tmp safely? Do I have to close some programs first? Additionally, why is this ...
6
votes
1answer
1k views

How can I remove the default application indicators, like the power or the volume indicator, in Unity?

After installing a bunch of new application indicators, I realized that I was using a lot of the top-bar space, and wanted to get rid of some default indicators to have more space. Is this somehow ...
6
votes
2answers
62 views

How to delete folders that have n or fewer files in them?

I need to do some folder clean-up, and I'd like to remove directories that have 10 or fewer files in them. I tried looking at GNU's find, but there wasn't anything related to the number of files in a ...
5
votes
4answers
258 views

What happens if I attempt to delete Ubuntu itself while logged in?

What would happen if I delete the / directory while logged as root into Ubuntu? Would I get some sort of error to the effect of Error: unable to self-destruct? Or would I actually be able to delete ...
5
votes
1answer
1k views

Running out of disc space- how to check where its being used?

I am starting to run out of disk space. How can I check where all the largest files are located on my Ubuntu installation so that I can delete them?
5
votes
1answer
2k 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 ...
5
votes
1answer
3k views

How to use Secure Erase and is it on the install CD? [duplicate]

Supposedly there is some built in hard drive magic called "Secure Erase" which is wildly faster and more secure than "dd if=/dev/zero..." I am most excited about the speed increase. There seems to ...
5
votes
1answer
951 views

Can you delete the Humanity icon theme safely?

I'm trying to reduce used space after running disk usage analyser, since I'm using a 40GB SSD. The icons use quite a bit of space! Could I delete those that I don't use, such as humanity? (I use ...
4
votes
2answers
8k views

How to delete specific files from terminal

Recently, I converted my music files to a different format. I have for example a folder of an artist containing the different albums in separate folders. I would knowing if is there a way to delete *....
4
votes
4answers
239 views

Can you recover previous versions of files?

I know that if I delete a file it won't actually be 'deleted' as such, just marked as 'can be overridden when needed' so that when that space is needed the file will just be overridden, and this means ...
4
votes
2answers
7k views

Delete all files whose filenames contain a particular string?

I changed my wordpress theme. The older one created so much images on server. My new theme doesnt need them, so I want to remove all. How can I do that? For example: Default image: ...