1. Technology
You can opt-out at any time. Please refer to our privacy policy for contact information.

Discuss in my forum

Linux Newbie Administrator Guide


that owns the file, and the third for others ("the rest of the world"). A "no" permission is shown as "-".

When setting permissions, these symbols are used: "u"(=user or owner of the file), "g"(=group that owns the file), "o"(=others), "a" (=all, i.e., owner, group and others), "="(=set the permission to), "+"(=add the permission), "-"(=take away the permission), "r"(=permission to read the file), "w"=(write permission, meaning the permission to modify the file), "x"(=permission to execute the file).

For example, this command will add the permission to read the file junk to all (=user+group+others):

chmod a+r junk

This command will remove the permission to execute the file junk from others:

chmod o-x junk

Also try here(lnag_basics.html#file_permissions) for more info.

You can set the default file permissions for the new files that you create using the command umask (see man umask).

chown new_ownername filename

chgrp new_groupname filename

Change the file owner and group. You should use these two commands after you copy a file for use by somebody else. Only the owner of a file can delete it.

lsattr files

List attributes for the file(s). Not very often used because the most interesting attributes are still not implemented. The attributes can be changed using the chattr command. The attributes are: A (=don't update a time when the file is modified), S (=synchronous updates), a (=append only possible to this file), c (=file compressed on the kernel level, not implemented yet), i (=immutable file), d (=no dump), s (=secure deletion), and u (undeletable, not implemented yet). An interesting usage may be to make a file undeletable even by root (until s/he clears the attribute).

sudo /sbin/shutdown -h now

(as a regular user, I will be prompted for my user password) Run the command "shutdown" (or another command which you have been given permission to run by your system administrator). With sudo, the administrator can give selected users the rights to run selected commands, without handing out the root password. The file /etc/sudoers must be configured to contain something like:

my_login_name my_host_computer_name = /sbin/shutdown



(as root, two commands). Verify the integrity of the password and group files.



(as root) Unlikely you need these commands. They convert old-style password and group files to create the more-secure "shadow" files.

  1. About.com
  2. Technology
  3. Linux

©2014 About.com. All rights reserved.