Sponsored Content
Full Discussion: Warning using 'find'.
Operating Systems OS X (Apple) Warning using 'find'. Post 302994611 by bakunin on Saturday 25th of March 2017 06:15:10 AM
Old 03-25-2017
It is a - quite common - misconception to think that files/directories which names start with a dot are somehow special. They are not. In fact the only "special treatment" they receive is by the ls-command which does not display them as long as the option -a (display them anyway) is not given.

For all other commands (including find) directories and/or filenames starting with a dot a just as normal as all the others. If you want to exclude them from your result set you have to take specific precautions to filter them out. For the same reason:

Code:
rm ..

might not do what you wanted/expected it to do, but syntactically the command is OK and - given the right privileges - will do what it is supposed to do (which, again, might not be what you wanted, but that is another problem).

I hope this helps.

bakunin
 

2 More Discussions You Might Find Interesting

1. Solaris

Jumpstart -- Warning: Could not find matching rule in rules.ok

I just setup a new jumpstart server, and I'm having problems with rules.ok errors. I'm coming up blank after many Google searches, forum searches, etc..... This is the error I receive: Skipped interface e1000g1 Attempting to configure interface e1000g0... Configured interface e1000g0... (0 Replies)
Discussion started by: christr
0 Replies

2. Shell Programming and Scripting

find command giving incomplete sentence warning

Hi , I am adding a line in my shell scripts to delete all the old directory with the below command. On running this command it is coming out with the message find: incomplete statement find /ersdg3/ERS/ERS_INPUT_LOGS/RIO/rio_archive -type d -mtime +47 -exec rm -rf {} What is wrong or... (3 Replies)
Discussion started by: guddu_12
3 Replies
sticky(5)						Standards, Environments, and Macros						 sticky(5)

NAME
sticky - mark files for special treatment DESCRIPTION
The sticky bit (file mode bit 01000, see chmod(2)) is used to indicate special treatment of certain files and directories. A directory for which the sticky bit is set restricts deletion of files it contains. A file in a sticky directory can only be removed or renamed by a user who has write permission on the directory, and either owns the file, owns the directory, has write permission on the file, or is a privi- leged user. Setting the sticky bit is useful for directories such as /tmp, which must be publicly writable but should deny users permission to arbitrarily delete or rename the files of others. If the sticky bit is set on a regular file and no execute bits are set, the system's page cache will not be used to hold the file's data. This bit is normally set on swap files of diskless clients so that accesses to these files do not flush more valuable data from the sys- tem's cache. Moreover, by default such files are treated as swap files, whose inode modification times may not necessarily be correctly recorded on permanent storage. Any user may create a sticky directory. See chmod for details about modifying file modes. SEE ALSO
chmod(1), chmod(2), chown(2), mkdir(2), rename(2), unlink(2) BUGS
The mkdir(2) function will not create a directory with the sticky bit set. SunOS 5.10 1 Aug 2002 sticky(5)
All times are GMT -4. The time now is 06:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy