Before accessing any file on your computer system, it is always good to check its permissions to find out whether it will be accessible or not. The file permissions mainly are of three types i.e. read, write, and execute which are represented by "r", "w", and "x" characters respectively.
Here at Ibmi Media, as part of our Server Management Services, we regularly help our Customers to perform related Linux system queries.
In this context, we shall look into how to check the file permissions with the "ls" command on Linux Mint 20.
To check the file permissions with the "ls" command on Linux Mint 20, you can follow either of the following ways.
1. Display all the File Permissions along with some other Information in the system
To show all the file permissions along with some other information, you will have to use the "ls" command with the "-l" flag:
$ ls –l
This command will display all the files within the current directory along with their permissions and some other information.
However, if you want to view the permissions of the files present in any other directory, then you will have to navigate manually to that directory.
2. Show all the File Permissions along with some other Information in Human Readable Format in the system
To show all the file permissions along with some other information in a human-readable format, you will have to use the "ls" command with the "-lh" flag:
$ ls –lh
This command will display all the files within the current directory along with their permissions and some other information in a human-readable format.
However, if you want to view the permissions of the files present in any other directory in a human-readable format, then you will have to navigate manually to that directory.
This article covers the different ways to conveniently check the file permissions of all the files existing on your Linux Mint 20 system using the built-in "ls" command. In fact, ls command provides additional information about a file or folder, such as its access and ownership permissions.