Characteristics of directories and files:
ls -ltr
- This command is being used to get the characteristics with their modification time in reverse order.
l
: This option will provide detailed information about a file or a directory with all permission, owner, size, modification time and date in a long format.t
: This option will provide the modification time of the file or provide the latest time the change has been done to the file.r
: This will reverse the order of the oldest modified files to appear first.
To get the detailed information on a particular file in a long format ls -ltr <file_name>
is executed which will provide the oldest modified file at the top and the latest modified file at the bottom.
File Permissions
File permissions in a Linux system can be defined as properties of a file or a directory and determine who can access the file, modify the file, and execute the file or directory. File permissions play an important role in an operating system ensuring security and privacy. All files and directories contain a set of permissions in three sets according to the different user groups. The groups are defined as follows:
Owner- Only the user who created the file or a directory can access it.
Group- Only a specific group of users can access the files and directories.
Others- All the users can access the files and directories.
Three types of permissions can be assigned to each user group:
read
: This allows a user to access the file and view the contents of a file or a directory. Syntax:r
write
: This allows a user to manipulate or modify the content in file or a directory. operations such as delete, create and rename can be done by this permission. Syntax:w
execute
: This permission allows the user to execute the given code or script. Syntax:x
Octal representation of permissions:
ACL Commands
Access Control Lists (ACLs) provide access control to directories and files. ACLs can set read, write, and execute permissions for the owner, group, and all other system users. An ACL consists of a set of rules that specify how a specific user or group can access ACL-enabled files and directories.
Some ACL commands are listed as follows:
getfacl
: The getfacl command displays the access permissions of files and directories with file name, owner, group and the ACL's(Access Control List) in Linux-based systems.
setfacl
: setfacl command in Linux is used to set access control lists (ACLs) of files and directories.ACL helps to create an additional, more flexible permission mechanism for the file system. setfacl
is used to grant specific permissions to the users and can also be used to deny permissions to users.
Access Control Lists(ACL) are used on Linux filesystems to set custom and more personalized permissions on files and folders. ACLs allow file owners or privileged users to grant rights to specific users or to specific groups. These are mainly used to improve security and privacy of your files and directories.
Thanks for reading!
#devops#90daysofdevops#TrainWithShubham
Let's connect on Linkedin-https://www.linkedin.com/in/piyush-verma-8b1b4426a/