1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Random Linux+ Question #64

Discussion in 'Linux+' started by tripwire45, Aug 23, 2005.

  1. tripwire45
    Honorary Member

    tripwire45 Zettabyte Poster

    13,493
    179
    287
    You are on the command line and reviewing file permissions in your home directory. The permissions for a file named "zfile" are:
    Code:
    -rw-r--r--
    You execute the command:
    Code:
    chmod g=wx zfile
    What do the permissions look like for this file now? Choose only one answer from the options below.

    1. -rw-rwxr--
    2. -rw--rxr--
    3. -rw-r--rwx
    4. -rwxr--r--
    5. -rwxrwsr--
    6. The argument "g=wx" is not valid.

    Answer later.

    PS I did try this on Debian. :tongue
     
    Certifications: A+ and Network+
  2. tripwire45
    Honorary Member

    tripwire45 Zettabyte Poster

    13,493
    179
    287
    C'mon. It's been almost a week. *Nobody* wants to take a crack at this? PS, freddy, you and Phoenix can have at it. Knock your socks off. :tongue
     
    Certifications: A+ and Network+
  3. Jakamoko
    Honorary Member

    Jakamoko On the move again ...

    9,915
    60
    229
    OK, as I don't want this thread to die in shame, it's patently obvious the answer is 6.

    <prepares to undergo humiliation again>
     
    Certifications: MCP, A+, Network+
    WIP: Clarity
  4. Jakamoko
    Honorary Member

    Jakamoko On the move again ...

    9,915
    60
    229
    No wait - I thought about it - it's 4, 4, 4 :biggrin
     
    Certifications: MCP, A+, Network+
    WIP: Clarity
  5. Bluerinse
    Honorary Member

    Bluerinse Exabyte Poster

    8,871
    167
    256
    Hmmm, not sure... Let me see, what you are asking Trip is what are the resulting file permissions if you use chmod to alter the attributes of the group to be exactly write and execute, correct? I am assuming here that if you give the permissions to write and execute the group will also be able to read otherwise I can't see a correct answer.

    If so, then I would expect to see...

    -rw (user) rwx (group) r-- (other)

    So, I will go with answer 1

    Pete
     
    Certifications: C&G Electronics - MCSA (W2K) MCSE (W2K)
  6. ffreeloader

    ffreeloader Terabyte Poster

    3,661
    106
    167
    To tell the truth I hadn't seen this until today. Don't know how I missed it, but I did.

    I'll go with number 1. All that's happening is that write and execute permissions are being added to the group's permissions. Thus since permisssions previously were read only for world and group, and read/write for the file owner they are now read write for owner, read, write and execute for group, and read only for for world.
     
    Certifications: MCSE, MCDBA, CCNA, A+
    WIP: LPIC 1
  7. Bluerinse
    Honorary Member

    Bluerinse Exabyte Poster

    8,871
    167
    256
    Freddy, from reading this

    chmod ug=rwx somefile

    This sets the file permissions to *exactly* what is specified. Now, the file
    permissions become -rwx rwx---.


    It states also that if you want to add permissions to the already established ones you would use...


    chmod g+wx not the *=*


    Am I missing something?


    Pete
     
    Certifications: C&G Electronics - MCSA (W2K) MCSE (W2K)
  8. ffreeloader

    ffreeloader Terabyte Poster

    3,661
    106
    167
    Well, what you wrote was my first thought too, but at least on my Debian box it simply adds the write and execute permissions to the existing ones. I tried it on my system and it added them to an existing read permission. The file permissions became -r--rwxr--. If it had been what both you and I orginally thought the permissions would have ended up as -rw--wxr--. That's one of Trip's choices but that's not how things worked on my system. I'll try it again. Maybe I misread the output from ls -al. We'll see. If I'm wrong it won't be the first time.

    I don't normally change permissions this way. I would normally use "chmod 674 filename" to do the same thing. For some reason I found it easier to learn. Don't ask me why, I couldn't tell you.
     
    Certifications: MCSE, MCDBA, CCNA, A+
    WIP: LPIC 1
  9. ffreeloader

    ffreeloader Terabyte Poster

    3,661
    106
    167
    LOL. You're right Bluerinse. I misread the output from ls -al. I guess I better be wearing my glasses all the time. :oops:

    The answer is 2 not 1.
     
    Certifications: MCSE, MCDBA, CCNA, A+
    WIP: LPIC 1
  10. Bluerinse
    Honorary Member

    Bluerinse Exabyte Poster

    8,871
    167
    256
    But 2 doesn't have group write perms Freddy :blink
     
    Certifications: C&G Electronics - MCSA (W2K) MCSE (W2K)
  11. ffreeloader

    ffreeloader Terabyte Poster

    3,661
    106
    167
    I'm gonna quit posting as I'm not even able to read anymore. :oops: Sleep deprivation is just killing my ability to think.
     
    Certifications: MCSE, MCDBA, CCNA, A+
    WIP: LPIC 1
  12. Bluerinse
    Honorary Member

    Bluerinse Exabyte Poster

    8,871
    167
    256
    No worries Freddy, that sleep apnea thing sounds dreadful :x
     
    Certifications: C&G Electronics - MCSA (W2K) MCSE (W2K)
  13. ffreeloader

    ffreeloader Terabyte Poster

    3,661
    106
    167
    It's definitely not a walk in the park when it's not being treated, i.e. no mask and cpap machine to sleep with. I think Trip would agree that the sleep deprivation is like taking about 30 or 40 points of your IQ score.
     
    Certifications: MCSE, MCDBA, CCNA, A+
    WIP: LPIC 1
  14. Bluerinse
    Honorary Member

    Bluerinse Exabyte Poster

    8,871
    167
    256
    I realise Trip suffers too. It seems to affect American IT people a lot, it must be something in the water :rolleyes:

    I am glad that I don't suffer, I couldn't afford to have 30 or 40 IQ points knocked off. It would only leave me with 5 :cry:

    Pete
     
    Certifications: C&G Electronics - MCSA (W2K) MCSE (W2K)
  15. tripwire45
    Honorary Member

    tripwire45 Zettabyte Poster

    13,493
    179
    287
    Upped the pressure a bit but the mask itself keeps waking me up. :tongue
     
    Certifications: A+ and Network+
  16. Bluerinse
    Honorary Member

    Bluerinse Exabyte Poster

    8,871
    167
    256
    So what is the answer James :blink
     
    Certifications: C&G Electronics - MCSA (W2K) MCSE (W2K)
  17. tripwire45
    Honorary Member

    tripwire45 Zettabyte Poster

    13,493
    179
    287
    My bad. Technically, the answer is 6, but not really. 6 says that the command is not valid but that's not true. What happens is that the permissions are indeed set exactly as stated. The "g" stands for group which originally had this permission: r--

    When you use g-wx, you change the group's permission to exactly what you type so in this case, the permissions change from r-- to
    -wx. The entire string should read, -rw--wxr--

    I goofed. :oops:
     
    Certifications: A+ and Network+

Share This Page

Loading...