7

Solaris operating system does not have chattr, it uses chmod instead. Also on Windows. Because when you're changing attributes of a file you're changing what you or other users can do with it, thus the meaning of chmod.

So do we really need chattr? and how is it different to chmod?

Shayan
  • 1,503
  • 1
    "Solaris operating system does not have chattr, it uses chmod instead. Also on Windows." Not our problem ;) chattr is more powerful than chmod: chmod does not always have a method to set "immutable". – Rinzwind Feb 16 '18 at 10:36

3 Answers3

6
  • chmod refers to file permissions for users, groups and others:

    read
    write
    execute

  • chattr refers to attributes regardless users or groups, some of the attributes are:

    a → Append only
    i → Immutable
    c → File automatically compressed in kernel

    Take a look at Wikipedia for chattr.

1

Extended attributes

The chattr allows to change extended file attributes, which are not supported by all *nix operating systems or all GNU/Linux distributions or file systems.

Conversely, the chmod command can only change standard file system attributes.

Serge Stroobandt
  • 5,268
  • 1
  • 48
  • 59
0

At least because:

Not  all  flags are supported or utilized by all filesystems;

The second thing - this question is a kind of trilling, because there is no chattr (these bits like linux has support) in solaris.