Results 1 to 10 of 10
hello Linuxers.
bash on redhat9,
delete all .jpg files in this folder and subfolders, thus, recursively :
rm -rf *.jpg
what am I missing ??...
- 08-08-2007 #1Just Joined!
- Join Date
- Mar 2007
- Posts
- 14
rm -rf *.jpg. What is wrong?
hello Linuxers.
bash on redhat9,
delete all .jpg files in this folder and subfolders, thus, recursively :
rm -rf *.jpg
what am I missing ??
- 08-08-2007 #2
- 08-08-2007 #3
Unfortunately, what
does is to look for any folders with a name ending in .jpg and recursively remove such folders. In order to do what you want, I think you'd need to write a script that deals with recursion manually - I'm afraid I haven't done that myself, so i cant give an example.Code:rm -rf *.jpg
Giles"Our greatest fear is not that we are powerless. Our greatest fear is Microsoft"
Registered linux user #391027
- 08-08-2007 #4
Giles is mostly correct. More accurately, your command looks for all directories and files in the current directory that end in '.jpg'. It deletes all of them. If it's a directory, it does the same to all of its subdirectories.
The problem is that this only addresses directories that end in '.jpg'. Fortunately, the find command offers an easy way to fix this:
This command starts in the current directory, recursing through the entire subtree, looking for files only that end with '.jpg'. It will delete any such files.Code:find . -iname '*.jpg' -type f -exec rm -f {} \;
find - the find program
. - search the subtree starting in the current directory
-iname '*.jpg' - find all elements that match the shell pattern '*.jpg'. This should be done case-INsensitively
-type f - only match files
-exec rm -f {} \; - execute the command "rm -f {}" for each matched file, where '{}' is replaced with the name of the matched file.DISTRO=Arch
Registered Linux User #388732
- 08-08-2007 #5Just Joined!
- Join Date
- Mar 2007
- Posts
- 14
- 08-08-2007 #6
- 08-08-2007 #7Just Joined!
- Join Date
- Mar 2007
- Posts
- 14
thank you.
solved it out with this.
rm -f 11/*.jpg
rm -f 12/*.jpg
rm -f 13/*.jpg
rm -f 14/*.jpg
rm -f 15/*.jpg
rm -f 16/*.jpg
rm -f 17/*.jpg
rm -f 18/*.jpg
rm -f 19/*.jpg
rm -f 20/*.jpg
rm -f 22/*.jpg
rm -f 23/*.jpg
rm -f 24/*.jpg
rm -f 25/*.jpg
rm -f 26/*.jpg
rm -f 27/*.jpg
rm -f 28/*.jpg
rm -f 29/*.jpg
rm -f 30/*.jpg
rm -f 31/*.jpg
rm -f 32/*.jpg
rm -f 33/*.jpg
rm -f 34/*.jpg
rm -f 35/*.jpg
rm -f 36/*.jpg
rm -f 37/*.jpg
rm -f 39/*.jpg
rm -f 4/*.jpg
rm -f 40/*.jpg
rm -f 41/*.jpg
rm -f 42/*.jpg
rm -f 43/*.jpg
rm -f 44/*.jpg
rm -f 45/*.jpg
rm -f 46/*.jpg
rm -f 47/*.jpg
rm -f 5/*.jpg
rm -f 54/*.jpg
rm -f 55/*.jpg
rm -f 56/*.jpg
rm -f 57/*.jpg
rm -f 58/*.jpg
rm -f 59/*.jpg
rm -f 6/*.jpg
rm -f 60/*.jpg
rm -f 61/*.jpg
rm -f 62/*.jpg
rm -f 63/*.jpg
rm -f 64/*.jpg
rm -f 65/*.jpg
rm -f 66/*.jpg
rm -f 67/*.jpg
rm -f 68/*.jpg
rm -f 69/*.jpg
rm -f 7/*.jpg
rm -f 70/*.jpg
rm -f 71/*.jpg
rm -f 8/*.jpg
rm -f 9/*.jpg
greetings to those looking for a solution and find this..... thank youLast edited by devils casper; 08-09-2007 at 03:31 AM. Reason: Posting links of relegious sites is Not allowed.
- 08-08-2007 #8Just Joined!
- Join Date
- Mar 2007
- Posts
- 14
- 08-09-2007 #9Linux Engineer
- Join Date
- Feb 2005
- Posts
- 1,044
- 08-09-2007 #10Just Joined!
- Join Date
- Mar 2007
- Posts
- 14
Blimey.....
Definitions of Blimey on the Web:
* (Brit.) 19th-century corruption of the oath, 'God blind me'.
JoyZine - Australia Decoded: A Dictionary of Australian English: B-5
* Minced oaths are corrupted forms of (usually religion-related) swear words that originally arose in English culture sometime before the Victorian Age, as part of the cultural impact of Puritanism after the Protestant Reformation. The censorship caused people to develop a wide variety of minced oaths to avoid swearing on holy names. They were used for swearing and other types of interjections. With time they came to have a mildly comedic effect. ...
en.wikipedia.org/wiki/Blimey
OK, now back to work
no, it was the same type of file (.jpg) in tens of subdirectories....


Reply With Quote
