![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| delete all but one files in a directory | finalight | Shell Programming and Scripting | 10 | 05-21-2008 03:51 AM |
| Is there anyway to delete a directory that has more than 200mil files? | plcyber | UNIX for Advanced & Expert Users | 4 | 06-01-2007 04:28 PM |
| Delete Some Old files from Particular Directory | siva80_cit | Shell Programming and Scripting | 2 | 12-11-2006 06:47 AM |
| delete files in specific directory | legato | Shell Programming and Scripting | 2 | 03-29-2006 09:46 PM |
| CRON. How to delete files within a directory | southoxon | UNIX for Dummies Questions & Answers | 1 | 08-24-2003 10:55 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
I have a subdirectory which has many child directories and files in it. How can i delete them through a list (txt, rtf. xls , or any file extension) which is created by me. I can not manual delete one by one because it almost over 300 directory and over 4000 files. Any one know please help me?
|
|
||||
|
find command with option user may help.
Execute this to see if these are the files you want to delete Code:
find . -user <your_user_name> -exec ls -l {} \;
Code:
find . -user <your_user_name> -exec rm -f {} \;
|
|
||||
|
I begin with create a a file:
#touch list.txt #nano list.txt and insert the name of folder i want to delete into this file then i run #find -name \list.txt but it didn't work out. Please help. I've just familiar with UNIX so i don't know much about it. Step by step is much appreciated. |
|
||||
|
To read folder names from list.txt and remove them, you can write a simple script like:
Code:
while read line do rm -R $line echo "Folder $line removed" done<list.txt |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|