LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-20-2011, 12:03 PM   #1
Niall26
LQ Newbie
 
Registered: May 2011
Posts: 2

Rep: Reputation: Disabled
Setting Permissions for UGO in One Command


Ok basically im studying for my system admin exam tomorrow and have come across a question asking for:

'the command I would use to change the group permission to write and the user and other to read and execute for the file "generate-report"'

Sounds simple enough but I cant get it to work at all, tried doing a search in google and on the forums here to no avail.

Is it possible to do in one command or will I need two?

Ive tried:

chmod g+w, uo+rx generate-report

And numerous other variants all with no luck.

Last edited by Niall26; 05-20-2011 at 02:53 PM.
 
Old 05-20-2011, 01:44 PM   #2
Hevithan
Member
 
Registered: Apr 2011
Location: Washington State
Distribution: Zorin5-(Ubuntu 11.04) // Backtrack 5-(Ubuntu 10.04) // Dreamlinux 3.5-(Debian)
Posts: 275
Blog Entries: 5

Rep: Reputation: 40
Quote:
Originally Posted by Niall26 View Post

And numerous other variants all with no luck.
Post the other variants (all that you can remember anyways) ... Knowledge is power, and Knowledge without INFO is just triva.
Without knowing what you've tried, People can't really offer you a suggestion.


Have you tried numerical instead on letters? such as:

Code:
$ chmod 755 FILENAME
Which gives full access to read, execute, and write to owner, and only read and execute to all others.

You may want to read this:
Permissions Help
 
Old 05-20-2011, 02:32 PM   #3
Niall26
LQ Newbie
 
Registered: May 2011
Posts: 2

Original Poster
Rep: Reputation: Disabled
Ok well here's some other variants of it that I have tried:

chmod u+rx, g+w, o+rx generate-report
chmod g+w, uo+rx generate-report
chmod uo+rx, g+w generate-report
chmod 'uo+rx, g+w' generate-report
chmod uo=rx, g=w generate-report

The error I tend to get everytime is: invalid mode: g+w (or whatever the first permission I try to change is)

Im thinking maybe it isn't possible to give user and other permissions and the group different permissions in one command?

Also the numeric value's is the second part of the question, it was simple enough.
 
Old 05-20-2011, 03:01 PM   #4
Hevithan
Member
 
Registered: Apr 2011
Location: Washington State
Distribution: Zorin5-(Ubuntu 11.04) // Backtrack 5-(Ubuntu 10.04) // Dreamlinux 3.5-(Debian)
Posts: 275
Blog Entries: 5

Rep: Reputation: 40
I am assuming you are doing this all as root correct? or at least someone with the proper powers?

You may want to see who has permissions to the file already, Try LS -L like so:

Code:
$ ls -l /home/documents/file
(Or where ever you have it)

And it should return something like this:
Code:
-rwxr-xr-x   1   root   root   484 Feb 25 14:08
You may want the CHOWN command to change ownership of the file, so you would run:

Code:
$chown USERNAME FILE
Such as $chown hevithan testfile

if the user you are trying to change the ownership of happens to be in another group, there's a command for that too ... But for now let's see how this goes. Good luck
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
setting permissions kalidoss Linux - Newbie 1 06-28-2010 09:37 PM
setting permissions Raakh Linux - Newbie 12 01-01-2008 11:19 AM
file permissions OK, but command permissions? stabu Linux - General 2 10-05-2005 01:00 PM
What can we do if we type chmod ugo-x /bin/chmod ?????? bunny123 Linux - Software 3 02-01-2005 09:53 PM
Setting Permissions johnnyde Linux - Newbie 1 05-22-2003 05:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration