Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to change the permission for my .bashrc file in Ubuntu but don't seem to have permission. I've tried following the example here:

Open up publicity.html for reading and writing by anyone.

Before:  -rw-r--r--  publicity.html
Command: chmod og=rw publicity.html
After:  -rw-rw-rw-  publicity.html

Here's my terminal session:

username@ubuntu:/etc$ -rw-r--r-- bash.bashrc
-rw-r--r--: command not found
username@ubuntu:/etc$ chmod og=rw bash.bashrc
chmod: changing permissions of `bash.bashrc': Operation not permitted
username@ubuntu:/etc$ -rw-rw-rw- bash.bashrc
-rw-rw-rw-: command not found

Any ideas how I can do it?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

The file is probably not owned by you. try

sudo chmod og=rw bash.bashrc

You can see who owns it with

ls -l

and you can change owner with

sudo chown username:username bash.bashrc
share|improve this answer
    
Fantastic. Works perfectly! –  user20285 May 29 '10 at 0:21

Looks like you entered -rw-r--r-- bash.bashrc as a command.
It's not a command itself but is part the output of the command ls -l bash.bashrc.

Example:

user@host:~$ ls -l /etc/bash.bashrc
-rw-r--r-- 1 root root 1939 2010-04-19 04:15 /etc/bash.bashrc


See Wikipedia for further information on the meaning of -rw-r--r--
http://en.wikipedia.org/wiki/File_system_permissions#Symbolic_notation

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.