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

Random Linux+ Question #66

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 looking at a file named "kfile" in your home directory. Currently, the file permissions are:
    Code:
    -rw-r--r--
    You want the permissions to be:
    Code:
    -rwxr-xr--
    Which of the commands below will achieve your goal? Choose only one.

    1. chmod 421 kfile
    2. chmod 542 kfile
    3. chmod 754 kfile
    4. chmod 765 kfile
    5. chmod 631 kfile
    6. None of the above.

    Answer later.
     
    Certifications: A+ and Network+
  2. tripwire45
    Honorary Member

    tripwire45 Zettabyte Poster

    13,493
    179
    287
    Boy, you guys need work on the chmod command. Correct answer is 3. The command chmod 754 filename will produce the correct result. The "7" affects the user, the "5" affects the group, and the "4" affects "others". Memorize this:

    r = 4
    w = 2
    x = 1

    The numbers are additive so if you want a catagory just to have read permissions, you'd use a "4". If you wanted someone to have read and execute (4 + 1), you'd use a 5. Read and write (4 + 2) is 6. For example, if I wanted all three categories (user, group, others) to have read and write permissions to a file named "file", I'd type:

    chmod 666 file
     
    Certifications: A+ and Network+

Share This Page

Loading...