The command to change the file attributes.

 

    chattr - change file attributes

    Format: chattr [-RV] [-v] [mode] filename

    -R – here it changes the attribute of the directory recursively

    Eg1: chattr +a file1

    Here it sets the appendable attribute to file file1 so that we can only do copy and append operations.

    Eg2: chattr +i file1

    Here it sets the immutable attribute to the file file1 so that we can only do copy operation.

    Eg3: chattr –a file1

    Here it removes the appendable attribute of the file1

 

    The command lsattr is  used to list the file attributes

    Format: lsattr filename

    Eg1: lsattr file1

    It list the attributes of the file file1

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

what is the command 'ls' used for?

       ls – list directory contents.    ...

for what the command 'tail' is used for?

  tail – print the last 10 lines of the named file.If more than one file is specified...

for what purpose the commad 'du' is used for?

      du- estimates the file space usage.   Format: du [options] [file]...

what is the use of command 'grep'?

    grep- search one or more files that matches a regular pattern  Format:...

'cp' command in linux

    cp - copy files and directories.  Format: cp [options] source...

Powered by WHMCompleteSolution