CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Post-Processing

how to delete all folders of same type?

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree2Likes
  • 1 Post By wyldckat
  • 1 Post By wyldckat

Reply
 
LinkBack Thread Tools Display Modes
Old   June 13, 2013, 15:43
Default how to delete all folders of same type?
  #1
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,186
Rep Power: 16
immortality is on a distinguished road
whats the command to delete all folders of a postProcessing result in time folders after seeing and use?
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   June 15, 2013, 17:14
Default
  #2
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,258
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Hi Ehsan,

Sorry, but your question is too ambiguous
Can you describe in more detail?

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   June 15, 2013, 17:33
Default
  #3
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,186
Rep Power: 16
immortality is on a distinguished road
for example the folders that originated by "Co"(courant number) command.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   June 15, 2013, 18:17
Default
  #4
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,258
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
I've tested running Co with the tutorial case "incompressible/icoFoam/cavityGrade" and it only created the field files "Co" in the already existing time folders. To remove these field files, you can do the following command:
Code:
rm */Co
You can see what this command actually does, by running:
Code:
echo rm */Co

But if it does create new folders, them the trick should be to first remove the files that were created, by using the command above; and then remove the empty directories with the following command:
Code:
for a in *; do rmdir $a; done
It will give several messages indicating that certain files/folders cannot be removed, simply because they are not empty or are not folders. In other words, rmdir will only delete the empty folders.
immortality likes this.
wyldckat is offline   Reply With Quote

Old   June 19, 2013, 09:05
Default
  #5
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,186
Rep Power: 16
immortality is on a distinguished road
could you describe me a bit about it?
Code:
for a in *; do rmdir $a; done
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   June 20, 2013, 16:41
Default
  #6
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,258
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Hi Ehsan,

It's the same as doing:
Code:
for a in *
do
    rmdir $a
done
To know more about each command:
Code:
help for
man rmdir
In essence:
  • The asterisk lists all files and folders in the current folder. You can see this if you run:
    Code:
    echo *
  • rmdir removes empty directories.
  • "for" is ... it is a for cycle!? Not sure how to explain this one, since it's command to several programming languages.
For more information on how to program in the bash shell... Google?

Best regards,
Bruno
immortality likes this.
wyldckat is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to set periodic boundary conditions Ganesh FLUENT 13 January 22, 2014 05:11
Air Conditioned room groovyBC Sebaj OpenFOAM 7 October 31, 2012 15:16
turbulent jet simulation antonio_ing OpenFOAM Running, Solving & CFD 5 September 16, 2010 02:31
rhoSimpleFoam claco OpenFOAM 7 April 20, 2010 04:32
pipe flow with heat transfer Fabian OpenFOAM 2 December 12, 2009 05:53


All times are GMT -4. The time now is 11:52.