Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I started off with changing to the folder I want to change permissions for, and that is the opt folder.

$ cd /opt/
test@testVM:/opt$

So I tried changing the permissions for this folder now using:

sudo chmod 775

And that hasn't worked. It showed this message:

Try 'chmod --help' for more information.

There is something I am forgetting or leaving out.

Please can you show me what I am doing wrong?

Thanks in advance.

share|improve this question
add comment

3 Answers 3

up vote 6 down vote accepted

You forgot the "change what" part of the command.

Most commands are like a simple "verb-noun" type structure. (Which, if you think about it, tends to explain why we sound like Yoda when we talk)

You said "chmod 755"... which is the verb... where's the noun?

sudo chmod 755 .         # the '.' means 'here'

-or-

sudo chmod 755 /opt      # always better to specify exactly what you want

My question is going to be: Why do you want to do that? What need do you have to change the permissions of /opt? (not that it's vitally important for me to know, but you should know that changing permissions of anything that's not in your /home folder is usually not a good idea. Think about what you're doing.)

share|improve this answer
    
I am using a program called WinSCP (like an FTP server) to copy files from my local machine to the Ubuntu machine (VM), and need to have the permissions to copy to that folder. Everytime I try copying a folder across, it says the following: "scp: /opt/{folder name}: Permission denied" –  Kevdog777 Jul 10 '12 at 9:28
1  
No worries, but 755 isn't going to allow you to write in that subdirectory either. Why not create a subdirectory in your home and have it saved there? It's your system, do as you wish. –  lornix Jul 10 '12 at 9:30
add comment

You need to specify directory in arguments. If you want to apply changes to the current directory, just add . at the end (or even the full path):

sudo chmod 775 .

otherwise it will give you the error.

ps. If you ran chmod --help as suggested, you would have seen:

 $ chmod --help
Usage:  chmod [OPTION]... MODE[,MODE]... FILE...
   or:  chmod [OPTION]... OCTAL-MODE FILE...
   or:  chmod [OPTION]... --reference=RFILE FILE...
share|improve this answer
    
Note that the OP used 775, while you wrote 755. –  Michael Kjörling Jul 10 '12 at 9:21
    
Aw awesome, thanks so much! –  Kevdog777 Jul 10 '12 at 9:22
    
Doesn't matter what number @rush used, I know the permissions I need ... Thanks again :-) –  Kevdog777 Jul 10 '12 at 9:24
    
fixed anyway =) –  rush Jul 10 '12 at 9:25
add comment

sudo chmod 775 .

You can just do sudo chmod 775 /opt without cd.

Bye the way, -R option of chmod is recursively mode changing.

man chmod for more information.

share|improve this answer
add comment

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.