Skip to content

Instantly share code, notes, and snippets.

@jeremyjs
Created June 16, 2014 21:24
Show Gist options
  • Save jeremyjs/5310cf8f0a767672fffb to your computer and use it in GitHub Desktop.
Save jeremyjs/5310cf8f0a767672fffb to your computer and use it in GitHub Desktop.
# Create file
$ touch /tmp/file.tmp
$ l /tmp/file.tmp
-rw-r--r-- 1 jmeyer1 wheel 0B Jun 16 15:59 /tmp/file.tmp
# Change owner to root
$ sudo chown root /tmp/file.tmp
$ l /tmp/file.tmp
-rw-r--r-- 1 root wheel 0B Jun 16 15:59 /tmp/file.tmp
# Change permissions
$ sudo chmod 755 /tmp/file.tmp
$ l /tmp/file.tmp
-rwxr-xr-x 1 root wheel 0B Jun 16 15:59 /tmp/file.tmp
# Change permissions for root
$ sudo chmod g=rx /tmp/file.tmp
$ l /tmp/file.tmp
-r-xr-xr-x 1 root wheel 0B Jun 16 15:59 /tmp/file.tmp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment