On Thu, 28 Jan 2010 05:26:55 -0500, Jörg-Volker Peetz wrote:
> Just two remarks:
> 
> in order to see hidden files (*nix: the ones with a . at the beginning
> of their names) there is the -a switch of ls, e.g.,
> 
>   ls -la /maxtor
> 
> to remove also the hidden files can become a little arduous, for a start use
> 
>   rm -rf .??*
>
> this will avoid to remove the directory itself (.) and the parent
> directory (..). But one can easily think up names of hidden files which
> would not be removed by this command.

Assuming that you are using bash as the current shell, another way to do
this is to use the GLOBIGNORE shell variable.  For example,

   GLOBIGNORE=.:..
   rm -r /maxtor/*
   unset GLOBIGNORE

This causes rm to remove all files, including "dot files" from the /maxtor
directory.  It also removes subdirectories.  The /maxtor directory itself
is not removed.  "." (the current directory) and ".." (the parent directory)
are the only dot files which are exempted.  This technique works with any
command in which the shell does pathname expansion, not just rm.


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to