2
votes
2answers
311 views

UNIX command for deleting / removing files on today's date

I want to remove all the files in the directory I am in currently in that were created today. So if today is April 3rd then the UNIX commond I am asking for would remove someFile2, someFile3, ...
1
vote
3answers
81 views

Unix delete with find: Delete all files that are listed in a file

In my root directory, I have a couple folders named something like AA, BB, CC etc., each containing files in the format AA1001.txt, BB1002.txt etc. In my root folder, I also have a file all_to_delete ...
0
votes
2answers
356 views

Unix command for finding and deleting folders with folder names in date format

I have folder names in the below date format 20130801 20130802 20130803 20130804 20130805 20130806 20130807 20130808 . . . 20130819 Similarly ,I have folders created from past two years for each ...
0
votes
2answers
47 views

Deleting multiple files in terminal

I am using Python to develop on a particular project. But one thing's disturbing is the .pyc files that crop up. % find `pwd` | grep '.pyc' This returns a list of files in my current directory. How ...
8
votes
3answers
13k views

How to find which files and folders were deleted recently in Linux?

I am having one particular folder (/home/sam/officedocuments) which is having hundreds of folders and files. I think I deleted some files and folders by mistake but I'm not sure. How to find which ...
2
votes
2answers
175 views

How to delete all folders that have the same name as their parent folder?

Somehow I got a copy of every folder inside itself. What is the shell command I could run to delete all folders that are inside folders of the same name? For example in the above, running the ...
0
votes
2answers
1k views

How can I use the find command to remove directories without eliminating certain subdirectories?

I am trying to modify the following command in a script that removes directories based on age. Example directories would be the following: /a/b/c/2011/11/11 /a/b/c/2011/11/11/12-ACD-1234 ...
171
votes
8answers
8k views

How far will you get with an 'rm -rf /' command?

I've often wondered how far the system will actually get if you run rm -rf /. I doubt the OS would be able to erase itself (?) Bonus Question: After the command has been executed, will rm have ...
2
votes
2answers
3k views

Find and remove all empty files

How can I search all empty files of non-root system and delete them?
10
votes
6answers
10k views

How to delete all but one file in Unix? [duplicate]

Possible Duplicate: How to delete all files in a directory except some? How to delete all but one(or some) file in Unix? Something like rm -rf -ignore myfile.txt *
4
votes
3answers
1k views

Are there undeleteable files in Linux?

I've never seen this before (20 years of *nix). I've been trying to save my hard drive (details upon request) and have been pretty successful except there are some file that look like this: $ ls -al ...
0
votes
4answers
493 views

An “easy” way to securely delete files on a Unix box?

Command line tools, like "shred", come with many disclaimers about situations where they may not securely delete files. I had an idea for a cheap'n'easy way to do it and wanted advice. How about ...
62
votes
12answers
5k views

What command do I need to use to remove a file called `-rf`?

I did something crazy at some point that created a file called -rf on my filesystem. Now I can't figure out how to delete it... I've tried: rm "-rf" rm \-rf These just exit immediately, arrgh! ...
3
votes
2answers
839 views

Delete Directories smaller than x

How can I delete Directories which are smaller than, say, 1000 KB? I already have a file list from the command: du -sk * | sort -n > sort.txt but I don't know how to proceed. ++++++++ ...