Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

14
  • 1
    could you explain the second chmod more? Commented Apr 8, 2013 at 8:38
  • @BartlomiejLewandowski go-rwx: no permissions for group and others. This sets the permissions to rwx------ (except that files that were created since the chmod may end up with fewer permissions, e.g. rw-------). In other words, the files will be accessible only by their owner. /tmp/.[!.]* is to include dot files, which commonly exist in /tmp. Commented Apr 8, 2013 at 9:28
  • 4
    The +t is referred to as the sticky bit. That's what keep anyone other than the owner from being able to remove files, even though the permissions are 777 otherwise. The sticky bit was originally to get the kernel to leave commonly programs in memory when they exited so they wouldn't have to be fetched from disk when next run. We're talking PDP11 days.... Commented Oct 8, 2013 at 21:51
  • 1
    @GabrielFair I replaced the command using wildcards by one using find which won't run into that problem. Commented Apr 21, 2018 at 8:58
  • 1
    @alper No, do not do that. 1777 is for /tmp itself, which is writable by everybody. Almost all directories in /tmp should only be readable and writable by their owner. Commented Jul 28, 2020 at 7:06