15.01.2024 Views

CompTIA A+ Certification All-in-One Exam Guide

  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

To change the group, use the following syntax:

chown <owner>:<group> filename

So, to change the owner of launch_codes to sally, type

chown sally launch_codes

To change the group to mi6, type

chown sally:mi6 launch_codes

If you retype the ls -l command, you would see the following output:

Be aware that the chown command needs superuser privileges (sudo or

su). Refer to Chapter 15 for details.

chmod Command

The chmod command is used to change permissions. Sadly, it uses a

somewhat nonintuitive addition system that works as follows:

r: 4

w: 2

x: 1

For example, we can interpret the permissions on

as follows:

• Owner’s permissions are 6: 4+2 (rw-)

• Group’s permissions are 6: 4+2 (rw-)

• Everyone’s permissions are 4: 4 (r--)

The chmod command uses the following syntax to make permission

changes:

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!