![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Count files in every subdirectory | yorryk | Shell Programming and Scripting | 3 | 08-12-2008 02:22 PM |
| [Question]How to copy files to all subdirectory | dzufauzan | UNIX for Dummies Questions & Answers | 2 | 07-08-2008 10:45 PM |
| Find files in directory and its subdirectory | jyotib | Shell Programming and Scripting | 11 | 01-24-2008 01:19 PM |
| Find files including subdirectory and Delete | thepurple | Shell Programming and Scripting | 1 | 10-04-2007 03:57 AM |
| How can I copy files and subdirectory? | odogbolu98 | UNIX for Dummies Questions & Answers | 3 | 02-15-2002 12:14 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
How to deleting some files under subdirectory
Hi guys, sorry if my english not very well.. i have a problem.. i have a file and the structure is :
Folder/ Folder/10.123.124.20/pm_data/A200807 Folder/10.123.124.20/pm_data/A200807 Folder/10.123.124.20/pm_data/A200807 Folder/10.123.124.20/pm_data/A200808 Folder/10.123.124.20/pm_data/A200808 Folder/10.123.124.20/pm_data/A200808 Folder/10.123.124.21/pm_data/A200807 Folder/10.123.124.21/pm_data/A200807 Folder/10.123.124.21/pm_data/A200808 Folder/10.123.124.21/pm_data/A200808 Folder/10.123.124.21/pm_data/A200808 I just wanna delete A200808, but till now i even can't sorting the file using this command ls Folder/10*/pm_data/A200808* but when am type ls Folder/10*/pm_data/* it's work.. pls somebody.. help me |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
For deleting the file that starts with A200808*, u can use the below code
rm -f ls -1 Folder/10*/pm_data/A200808* |
|
#3
|
|||
|
|||
|
many thx for replying my thread.. I already found the pattern..
find Folder/ -name A200808* -exec rm -f {} \; am lil bit confuse, i've been trying this command before, but it's not working.. when am try again few hour ago, and they work's... strange... i use this SunOS machine : SunOS 5.9 Generic_118558-11 sun4u sparc SUNW,Sun-Fire-V240 btw thx for helping me |
|
#4
|
|||
|
|||
|
You should execute below.
Code:
find Folder/ -name 'A200808*' -exec rm -f {} \;
Before command parameters is used by find command Your shell expands parameters. After you execute "touch A200808.txt", You can figure out difference by below commands. Code:
echo A200808* Code:
echo 'A200808*' |
|
#5
|
|||
|
|||
|
[quote=p50p100;302226935]You should execute below.
Code:
find Folder/ -name 'A200808*' -exec rm -f {} \;
|
|||
| Google The UNIX and Linux Forums |
| Thread Tools | |
| Display Modes | |
|
|