LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   removing files for the computer (https://www.linuxquestions.org/questions/linux-newbie-8/removing-files-for-the-computer-406067/)

doronunu 01-21-2006 02:07 AM

removing files for the computer
 
how can i tell linux to search all the files, lets say begun with the letter a, and remove them?

GrueMaster 01-21-2006 02:10 AM

Use find. Example: find /home/myhome -name "a*" -exec rm -f {} \;. ## End period not part of cmdline

The {} will be replaced with the path and filename matching the -name parameter.

doronunu 01-21-2006 02:25 AM

this why ill find and remove files only at /home/myhome.
i want to find and remove files from all the file system.

GrueMaster 01-21-2006 02:31 AM

Then replace /home/myhome with / (or what ever starting directory you want to use). Also, if you'd like more information on using find, type "man find".

nitinatindore 01-21-2006 06:55 AM

there's a better workaround if you want to delete all files

mkfs <partition name>, usually like /dev/hda1

bulliver 01-21-2006 07:04 AM

Quote:

i want to find and remove files from all the file system.
I hope your "lets say begun with the letter a" is just a hypothetical example, because if you run:
Code:

find / -name "a*" -exec rm -f {} \;
you will totally bork your system...

doronunu 01-22-2006 01:42 AM

Quote:

I hope your "lets say begun with the letter a" is just a hypothetical example
:D
it is, but tell me can i use kill -9?:D

bulliver 01-22-2006 01:59 AM

Quote:

but tell me can i use kill -9
Sure. kill -9 just kills processes, it doesn't permanently affect any files...

doronunu 01-22-2006 02:25 AM

it wasnt a real Q u know.


All times are GMT -5. The time now is 06:09 PM.