Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

chmod(1) [v7 man page]

CHMOD(1)						      General Commands Manual							  CHMOD(1)

NAME
chmod - change mode SYNOPSIS
chmod mode file ... DESCRIPTION
The mode of each named file is changed according to mode, which may be absolute or symbolic. An absolute mode is an octal number con- structed from the OR of the following modes: 4000 set user ID on execution 2000 set group ID on execution 1000 sticky bit, see chmod(2) 0400 read by owner 0200 write by owner 0100 execute (search in directory) by owner 0070 read, write, execute (search) by group 0007 read, write, execute (search) by others A symbolic mode has the form: [who] op permission [op permission] ... The who part is a combination of the letters u (for user's permissions), g (group) and o (other). The letter a stands for ugo. If who is omitted, the default is a but the setting of the file creation mask (see umask(2)) is taken into account. Op can be + to add permission to the file's mode, - to take away permission and = to assign permission absolutely (all other bits will be reset). Permission is any combination of the letters r (read), w (write), x (execute), s (set owner or group id) and t (save text - sticky). Let- ters u, g or o indicate that permission is to be taken from the current mode. Omitting permission is only useful with = to take away all permissions. The first example denies write permission to others, the second makes a file executable: chmod o-w file chmod +x file Multiple symbolic modes separated by commas may be given. Operations are performed in the order specified. The letter s is only useful with u or g. Only the owner of a file (or the super-user) may change its mode. SEE ALSO
ls(1), chmod(2), chown (1), stat(2), umask(2) CHMOD(1)

Check Out this Related Man Page

CHMOD(1)						      General Commands Manual							  CHMOD(1)

NAME
chmod - change mode SYNOPSIS
chmod mode file ... DESCRIPTION
The mode of each named file is changed according to mode, which may be an octal number or a symbolic change to the existing mode. A mode is an octal number constructed from the OR of the following modes. 0400 read by owner 0200 write by owner 0100 execute (search in directory) by owner 0070 read, write, execute (search) by group 0007 read, write, execute (search) by others A symbolic mode has the form: [who] op permission The who part is a combination of the letters u (for user's permissions), g (group) and o (other). The letter a stands for ugo. If who is omitted, the default is a. Op can be + to add permission to the file's mode, - to take away permission, and = to assign permission absolutely (all other bits will be reset). Permission is any combination of the letters r (read), w (write), x (execute), a (append only), and l (exclusive access). Only the owner of a file or the group leader of its group may change the file's mode. SOURCE
/sys/src/cmd/chmod.c SEE ALSO
ls(1), stat(2), stat(5) CHMOD(1)
Man Page

15 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

permissions

to prohibit 'others' from deleting files, what should we omit: write or execute? thx (9 Replies)
Discussion started by: melanie_pfefer
9 Replies

2. UNIX for Dummies Questions & Answers

Scripts execution

hello everybody: i think this is really quite of dummy question. after I write a new script, and give it the execute permission. some times its just enough to call its name to run the script , other times I need to include ksh or ./ScriptName . so how I can make all my scripts run by just... (9 Replies)
Discussion started by: aladdin
9 Replies

3. Shell Programming and Scripting

FIND/CHMOD combined

I am trying to change permission for all subdirectories and files inside folder1 so this is what i came with after many seraches on the internet. man find and man chmod mirc and few articles. find .public_html/folder1 -print0 | xargs -0 chmod 777 what's wrong with this command? it is FTP... (33 Replies)
Discussion started by: smoother
33 Replies

4. UNIX for Advanced & Expert Users

how to set the default file persmission of file to "rwx"

hi. I want to set the default permission for ever new created file to rwxrwxrwx .. I try umask 000 but it does't not give the execute persmission , is there any way to set the default permission for every new created file to rwxrwxrwx .. thankx (9 Replies)
Discussion started by: tahir23
9 Replies

5. Solaris

add administrator user to system

Hello I have a new job and I need change the last user administrator, I dont know if is easier change some things about this user or add my user in the group with every permission, how can I do it. I dont know which is the group. I think is no only useradd en after modify /etc/passwd. Tank... (14 Replies)
Discussion started by: cata
14 Replies

6. UNIX for Advanced & Expert Users

How UNIX admin set up this? how files of 744 of other owner can be removed by another owner?

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)
Discussion started by: TheGunMan
14 Replies

7. Shell Programming and Scripting

I need script Copy permissions of files and folders from one server to another

Hi.. I have 2 servers with linux suse10. I made a mistake and on one of the servers changed with chmod the permission of root in directory /. In the other servers the permissions are correct Please i need a script, to change the permissions of one server 1, using the same permission of the... (11 Replies)
Discussion started by: ave-phoenix
11 Replies

8. Shell Programming and Scripting

chmod to stop cat from displaying the file?

Hi, Im struggling with what chmod to change the permission of a file in the current directory named MyFile so the command "cat MyFile" fails to display the file.?? (10 Replies)
Discussion started by: tryintolearn
10 Replies

9. Shell Programming and Scripting

Re-apply the file permission

Hi, I having an issue with file permission. To fix it I need to read the file's existing permission and re-apply the same permission to the file. This has to be done for every single file under a mount point. I'm novice in scripting. Help me with this in shell scripting. # ls -l /dev/null... (10 Replies)
Discussion started by: agent001
10 Replies

10. UNIX for Dummies Questions & Answers

How to create a file with 777 permission.?

Hi Guys, I want to know is there any method to create a file having 777 permission. I am aware of umask, since it is only giving max. 666 permission for files this is not fulfilling my needs. Thanks in advance ---------- Post updated at 12:49 AM ---------- Previous update was at 12:31... (10 Replies)
Discussion started by: sanoop
10 Replies

11. Shell Programming and Scripting

one line command to change mode only if necessary

hi, sorry for posting this for a quick answer. Is there a one line command to change permissions on files in a directory to a given mode (say 554) and only for those files that do not already have that mode? Running chmod updates the last access/modified timestamp on the files, and i want to... (11 Replies)
Discussion started by: ysrini
11 Replies

12. UNIX for Dummies Questions & Answers

How to set default permission

Hey Guys, First post here. I just started learning UNIX a few weeks ago. My issue: I use FreeNAS which is based off of UNIX in my network environment which hosts files that my team needs to access. Each user has their own login but we are all part of a group called "ITLIC". I have a share... (15 Replies)
Discussion started by: uglycustoomer
15 Replies

13. UNIX for Beginners Questions & Answers

What is wrong with file permission?

Friends, I have weird problem with my Linux OS. I have few files which is owned by root but could not be modified (edit, chmod, chown etc) # id uid=0(root) gid=0(root) groups=0(root) # whoami root # ls -l /etc/security/access-sshd.conf -rw-r--r-- 1 root root 431 Jun 22 03:31... (12 Replies)
Discussion started by: baluchen
12 Replies

14. UNIX for Beginners Questions & Answers

Setting write permission for particular user

Hi All, We have a scenario in production where we want only one user from a group to modify the file. The file is not set to write permission for application manager. -r--r--r-- 1 amgr u00 15661716 Aug 30 00:06 DCI.dat So here amgr will have permission to edit the file. We want a... (10 Replies)
Discussion started by: arunkumar_mca
10 Replies

15. What is on Your Mind?

Climate change anyone?

Hi all together, The US President considers this topic as not serious. Here in Germany there it's taken very serious, made a lot of words, but little action. As far as I am reading now - written here quite clearly ... N.Y. Times - loosing earth or as video with the current state of... (37 Replies)
Discussion started by: stomp
37 Replies