Logo 
Search:

Unix / Linux / Ubuntu Answers

Ask Question   UnAnswered
Home » Forum » Unix / Linux / Ubuntu       RSS Feeds
  on Jan 23 In Unix / Linux / Ubuntu Category.

  
Question Answered By: Adah Miller   on Jan 23

'chmod +x [filename]' will make the file executable, which David probably
correctly assumed you meant. If you want to make a file writable, use 'chmod
+w [filename]'

If the file is owned by root, use 'sudo chmod ...'

These commands will set execute and write permissions for everyone. If you
want to limit say execute permissions to just the owner, use 'chmod u+x
[filename]'.

You can also use a numeric permission string instead of [u/o/g +/- r/w/x].
The syntax is 'chmod [0-7][0-7][0-7] [filename]'. The first digit sets
permissions for the owner, the second for the group, the third for everyone
else. The digits are calculated by adding 4 for read permission, 2 for
write permission and 1 for execute permission.

For example, the command:

'chmod 764 filname'

sets the owner's permissions to read, write and execute (4 + 2 + 1), the
group's permissions to read and write (4 + 2) and everyone else's to read
only (4). You will notice that directories also have permissions, and
setting the execute permission on a directory allows users to enter the
directory using 'cd' and access files as long as they know the names.
Setting the write permission allows users to create, delete and modify files
and subdirectories, even ones they don't own. Setting the read permission
allows users to list all files contained in the directory, their ownership
and permissions and the times they were last updated.

Properly setting permissions is the most important thing you can do to keep
your computer and information safe

Share: 

 

This Question has 2 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on non-writeable Or get search suggestion and latest updates.


Tagged: