|
|
|
|
||||||
| comp.unix.shell Using and programming the Unix shell. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
hi, everyone
i am looking for a tip to delete the content of a directory without deleting the actual directory with bash thank you ![]() |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
On 2007-05-25, di0rz` wrote:
> hi, everyone > i am looking for a tip to delete the content of a directory without > deleting the actual directory with bash shopt -s dotglob rm -rf "$dir"/* -- Chris F.A. Johnson, author <http://cfaj.freeshell.org/shell/> Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress) ===== My code in this post, if any, assumes the POSIX locale ===== and is released under the GNU General Public Licence |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
di0rz` wrote:
> i am looking for a tip to delete the content of a directory without > deleting the actual directory with bash $ man rm Try: $ rm -rf <directory>/* $ rm -rf <directory>/.* # if you also want to hit dot-files Or is there something that I missed? -- -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GE d+(-) s+: a@ C+ ULAHS++$ P- L+>++ E--- W++ N++ o !K w--(+) O- M?>+ V? PS+ PE+(++) Y+ PGP- t+ 5 X R !tv b+ DI(+) D G e++ h---- r+++@ y++++ ------END GEEK CODE BLOCK------ |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
thanks it's working
On May 25, 8:11 am, SiKing <nos...@noway.invalid> wrote: > di0rz` wrote: > > i am looking for a tip to delete the content of a directory without > > deleting the actual directory with bash > > $ man rm > > Try: > $ rm -rf <directory>/* > $ rm -rf <directory>/.* # if you also want to hit dot-files > > Or is there something that I missed? > > -- > -----BEGIN GEEK CODE BLOCK----- > Version: 3.1 > GE d+(-) s+: a@ C+ ULAHS++$ P- L+>++ E--- W++ N++ o !K w--(+) O- M?>+ V? PS+ > PE+(++) Y+ PGP- t+ 5 X R !tv b+ DI(+) D G e++ h---- r+++@ y++++ > ------END GEEK CODE BLOCK------ |
|
![]() |
| Outils de la discussion | |
|
|