LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-12-2005, 01:16 PM   #1
os2
Member
 
Registered: Dec 2003
Location: Canada
Distribution: openSUSE Tumbleweed
Posts: 209

Rep: Reputation: 30
Remove folder and file


hi

under linux (c programming)

i have this file

/opt/good/Ext5_Linux_RTU2/led/A/L1/text.txt
/opt/good/Ext5_Linux_RTU2/led/A/L2/text.txt
/opt/good/Ext5_Linux_RTU2/led/b/L1/text.txt
/opt/good/Ext5_Linux_RTU2/led/b/L2/text.txt

i would like to remove:

/A/L1/text.txt
/A/L2/text.txt
/B/L1/text.txt
/B/L2/text.txt
....
other folder can exist...

all folder and file after /led need to be erased

are there a way to remove all folder after led?

thanks
 
Old 03-12-2005, 02:12 PM   #2
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
I would do :
Code:
find /opt/good/Ext5_Linux_RTU2/led -mindepth 2 -exec rm -rf {} \;
[edit]
I did not read carefully " other folder can exist..."
This command would remove all contents of
/opt/good/Ext5_Linux_RTU2/led subdirectories

Could you ellaborate with " other folder can exist..."

Last edited by keefaz; 03-12-2005 at 02:18 PM.
 
  


Reply



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
remove a folder created 3 days ago. eduac Linux - Software 4 10-17-2005 11:15 AM
Uninstall or Remove Folder? sall Linux - General 4 08-07-2005 11:35 AM
how can i default the max folder file size when it create inside a folder antony_csf Linux - Software 1 06-17-2004 02:26 AM
remove folder from command line demmylls Linux - General 3 02-15-2004 09:52 AM
Remove Home folder from desktop? ceh383 Slackware 3 06-05-2003 12:18 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:57 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
Open Source Consulting | Domain Registration