ls command
ls is a Linux shell command that lists directory contents of files and directories.
ls -l : To show long listing information about the file/directory.
-rw-------. 1 root root 1723 Mar 11 22:18 anaconda-ks.cfg
1st Character – File Type: First character specifies the type of the file.
In the example above the hyphen (-) in the 1st character indicates that this is a normal file. Following are the possible file type options in the 1st character of the ls -l output.
Field Explanation
– : normal file
d : directory
Field 1 – File Permissions: Next 9 character specifies the files permission. The every 3 characters specifies read, write, execute permissions for user(root), group and others respectively in order. Taking above example, -rw-rw-r– indicates read-write permission for user(root) , read permission for group, and no permission for others respectively. If all three permissions are given to user(root), group and others, the format looks like -rwxrwxrwx
Field 2 – Number of links: Second field specifies the number of links for that file. In this example, 1 indicates only one link to this file.
Field 3 – Owner: Third field specifies owner of the file. In this example, this file is owned by username ‘root’.
Field 4 – Group: Fourth field specifies the group of the file. In this example, this file belongs to 'root’ group.
Field 5 – Size: Fifth field specifies the size of file in bytes. In this example, ‘1123’ indicates the file size in bytes.
Field 6 – Last modified date and time: Sixth field specifies the date and time of the last modification of the file. In this example, ‘March 11 22:18’ specifies the last modification time of the file.
Field 7 – File name: The last field is the name of the file. In this example, the file name is anaconda-ks. cfg
Thank you! Ashutosh S. Bhakare sir, Ankush Kathar sir, Pavan Wankhade sir
#unnatidevelopment #redhat #linux