LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-21-2006, 03:07 AM   #1
doronunu
Member
 
Registered: Dec 2005
Location: Israel
Distribution: used : Ubuntu, Debian, Arch. current : Centos.
Posts: 69

Rep: Reputation: 15
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?
 
Old 01-21-2006, 03:10 AM   #2
GrueMaster
Member
 
Registered: Aug 2005
Location: Oregon
Distribution: Kubuntu.
Posts: 848

Rep: Reputation: 30
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.
 
Old 01-21-2006, 03:25 AM   #3
doronunu
Member
 
Registered: Dec 2005
Location: Israel
Distribution: used : Ubuntu, Debian, Arch. current : Centos.
Posts: 69

Original Poster
Rep: Reputation: 15
this why ill find and remove files only at /home/myhome.
i want to find and remove files from all the file system.

Last edited by doronunu; 01-21-2006 at 03:28 AM.
 
Old 01-21-2006, 03:31 AM   #4
GrueMaster
Member
 
Registered: Aug 2005
Location: Oregon
Distribution: Kubuntu.
Posts: 848

Rep: Reputation: 30
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".
 
Old 01-21-2006, 07:55 AM   #5
nitinatindore
Member
 
Registered: Dec 2004
Location: India
Distribution: Mandrake, Mandriva, PclinuxOS
Posts: 114

Rep: Reputation: 15
there's a better workaround if you want to delete all files

mkfs <partition name>, usually like /dev/hda1
 
Old 01-21-2006, 08:04 AM   #6
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
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...
 
Old 01-22-2006, 02:42 AM   #7
doronunu
Member
 
Registered: Dec 2005
Location: Israel
Distribution: used : Ubuntu, Debian, Arch. current : Centos.
Posts: 69

Original Poster
Rep: Reputation: 15
Quote:
I hope your "lets say begun with the letter a" is just a hypothetical example

it is, but tell me can i use kill -9?
 
Old 01-22-2006, 02:59 AM   #8
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
Quote:
but tell me can i use kill -9
Sure. kill -9 just kills processes, it doesn't permanently affect any files...
 
Old 01-22-2006, 03:25 AM   #9
doronunu
Member
 
Registered: Dec 2005
Location: Israel
Distribution: used : Ubuntu, Debian, Arch. current : Centos.
Posts: 69

Original Poster
Rep: Reputation: 15
it wasnt a real Q u know.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Removing Linux from my computer medg85 Linux - General 1 01-05-2006 10:19 AM
Can't copy files from an SCO Unix System V computer to a Linux computer gnppapas Linux - General 2 11-27-2004 02:39 PM
Removing serial mouse locks computer allelopath Linux - Hardware 4 11-17-2004 10:10 PM
Removing / uninstalling SuSE 9.1 on computer with dual boot (XP) TrulyTessa SUSE / openSUSE 5 11-09-2004 09:04 AM
Removing files wihtout removing containing Direcotry caps_phisto Linux - General 2 10-07-2004 09:16 AM


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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration