find command : does not print . and ..

find command : does not print . and ..

Post by linq.. » Sun, 28 May 2006 03:40:02



Hi,
  I have this command in my script,

  find . -maxdepth 1 ! -name some_file_name -exec rm -fr {} \;

  It is to delete all the files except one file named in the command.

  It works fine, but I always see "rm:can not remove '.' or '..' "
error message.

  Then I run this command,

  find . -maxdepth 1 ! -name some_file_name

  I do see that the first file is ".", I wonder if ther is a way not to
list "."?

Thanks.

 
 
 

find command : does not print . and ..

Post by Radoulov, Dimitr » Sun, 28 May 2006 03:42:09



Quote:> Hi,
>  I have this command in my script,

>  find . -maxdepth 1 ! -name some_file_name -exec rm -fr {} \;

>  It is to delete all the files except one file named in the command.

http://groups.google.com/group/comp.unix.shell/browse_thread/thread/c...

Regards
Dimitre

 
 
 

find command : does not print . and ..

Post by Sven Maschec » Sun, 28 May 2006 06:18:27



>  find . -maxdepth 1 ! -name some_file_name -exec rm -fr {} \;
>  It is to delete all the files except one file named in the command.
>  It works fine, but I always see "rm:can not remove '.' or '..' "

 find ! . -name . -prune  ! -name some[...]

avoids . (and the unportable expression -maxdepth as well)

 
 
 

find command : does not print . and ..

Post by Sven Maschec » Sun, 28 May 2006 06:46:47


Quote:> find ! . -name . -prune  ! -name some[...]

find . ! . -name [...]
 
 
 

find command : does not print . and ..

Post by Sven Maschec » Mon, 29 May 2006 06:15:59


Quote:>> find ! . -name .
> find . ! . -name [...]

find . ! -name .

syslexia, dyslexia, noise

 
 
 

1. error by doing a cron job...command not found...please help!!!

hi,
i install a cronjob to activate webalizer once a day...

crontab -l    answers:

SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
MAILTO=admin

22 2 * * * admin /bin/webalizer -n www.discount.de -o
/www/vhtdocs/discount/statistik /www/vhtdocs/discount/log/access_log

when time is come i get a mail message:
/bin/bash: admin: command not found

when i use the cron command in a telnet line it works.

plese help!

2. upgrading RH4.2->RH5.1, utmp/wtmp problem

3. Need to find vi command to remove ^H from command man find > find.txt

4. the less command

5. ?updatedb: @find@: command not found???

6. Problem with signals...

7. command not found not solved with ./

8. Perl Issues

9. where can i find Unix commands for dos ?

10. find command : only print the file name matches

11. Matrox Mystique ands X.

12. IDE port not found without booting DOS

13. "user not found" doing .htaccess authentication