sticky(8) System Manager's Manual sticky(8)Name
sticky - executable files with persistent text
Description
The sticky bit (file mode bit 01000), is used to indicate special treatment for certain executable files and directories.
While the sticky bit, mode 01000 is set on a sharable executable file, the text of that file will not be removed from the system swap area.
Thus the file does not have to be fetched from the file system upon each execution. As long as a copy remains in the swap area, the origi-
nal text cannot be overwritten in the file system, nor can the file be deleted. Directory entries can be removed so long as one link
remains.
Sharable files are made by the and options of
To replace a sticky file that has been used, clear the sticky bit with and execute the old program to flush the swapped copy. This can be
done safely even if others are using it. Overwrite the sticky file. If the file is being executed by any process, writing will be pre-
vented. It suffices to simply remove the file and then rewrite it, being careful to reset the owner and mode with and Set the sticky bit
again.
A directory whose sticky bit is set becomes an append-only directory, or, more accurately, a directory in which the deletion of files is
restricted. A file in a sticky directory may only be removed or renamed by a user if the user has write permission for the directory and
the user is the owner of the file, the owner of the directory, or the superuser. This feature is usefully applied to directories such as
which must be publicly writeable but should deny users the license to arbitrarily delete or rename each others' files.
Restrictions
Only the superuser can set the sticky bit.
See Alsochmod(2)
RISC sticky(8)
Check Out this Related Man Page
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)
I would like to give execution rights for a script to one user. (that's the easy part...)
When that user is running the script, I would like the effective user ID to be that of the file-owner. Is this possible? (6 Replies)
Hi,
I have a landing area where some files keep on coming after irregular intervals of time. From this landing area, I need to move files to another directory for processing. For this, I am using a for loop to find certain kinds of files in the landing area.
Now my question is, suppose I start... (6 Replies)
I have a directory. To this directory, for Group bits combination, it is showing as 's'. Which I found out, it means "Set User ID on execution mode". Within this directory I am not able to create subfolder.
Does it mean, only the Owner of this directory will be able to create subdirectories &... (5 Replies)
HI
What is sticky bit?
how can be see if the sticky bit for file is set?
WHat is meaning of sticky bit set on Directory?
What is the syntax to set the sticky bit? With example
Thanks (10 Replies)
Hi all,
I have trouble working with Sticky bit in solaris,
I am able to delete files and directory from the directory who has sticky bit set , i have verified that i am neither owner of the file pr directories..
I have check in Solaris 7, 8 ,9 ,10, versions, that does not seem to work..... (8 Replies)
Hi,
I have some ps files where I want to ectract/copy a certain number from and use that number to rename the ps file.
eg:
'file.ps' contains following text:
14 (09 01 932688 0)t
the text can be variable, the only fixed element is the '14 ('. The problem is that the fixed element can appear... (7 Replies)
I looked into the sticky bit, but I think, if possible, that I would prefer to have the file recreate itself after deletion. The file is several directories deep, and from time to time the top level directory will be trashed. I need the file to recreate after this. Is it possible to perhaps... (13 Replies)
Hi all,
We have some files are under 744 permissions and the the owner is say owner1 and group1.
Now we have another user owner2 of group2, owner2 can remove files of the owner1 and the permission of those files are 744, unix admin told us he did some config at his side so we can do that.
... (14 Replies)
how can i copy a certain word from a text file then use this word to replace in another text file??
i tried to use something like:
awk '{print "Hit the",$1,"with your",$2}' /aaa/qqqq.txt > uu.txt
but i can't add an argument to point to the second file which i will replace in.
please... (8 Replies)
Hello,
I have 50 text files in a directory called "AllFiles"
I want to make a program that will go inside of the "AllFiles" Directory and count the number of lines in each individual text file. Then, the program will calculate how many more lines there are over 400 in each text file and... (7 Replies)
Hi Everyone,
I am looking for a simple way for replacing all the files under a directory that use the server "xsgd1234dap" with "xsdr3423pap".
For Example:
In the Directory,
$pwd
/home/nick
$ grep -l "xsgd1234dap" *.sh | wc -l
119
I have "119" files that are still using... (5 Replies)
I am new to Unix scripting and would like some help. Here is my scenario:
1) I have a text files that contains two fields: file name and retention period in months:
File1 36
file2 24
File3 12
2) The directory I am searching contains sequential files.
3) I need to be able to take the file name... (10 Replies)
Hello all,
I need to write a script which has following requirement:
Need to read the filenames from text file and then search for the above read files in the required directory and if match found backup them in a backup folder.
And also need to compare and verify whether the files in the... (7 Replies)
i got this archive file on sticky bit mode. somehow i could not remove the sticky bit. i could not even copy or view the view using file user account or root account.
-rw-r--r-T 1 mark support 875166720 Mar 23 2005 file_mig.dat
anybody encounter this type of problem?
i have done running... (11 Replies)