If you have a file or a directory on your Linux, Unix, or macOS Operating System and you want to know its permission details you can make use of the ls -l command followed by the file name, make sure to add -l for long format.
Example:# ls -l myfile.txt
-rwxr-xr-x 1 root root 31 Apr 5 11:25 myfile.txt
Let's try and understand each one of the above details,
-rwxr-xr-xIf you see a hyphen as the first character it says that the object is a file, id you see d -> directory, other characters and its meaning is mentioned below,
- -> regular file
b -> block device
c -> character device
d -> directory
D -> door
l -> symlink
p -> named pipe
s -> socket
r -> Read Permission.
w -> Write Permission.
x -> Executable Permission.
More Posts related to Linux,
- Terminal display next month Calendar
- How to change bash terminal prompt string and color
- How to exit from nano command
- How to Display content of a file in Terminal Screen?
- Copy entire directory using Terminal Command [Linux, Mac, Bash]
- 3 Commands to stop Nginx Server
- How to check file permissions for your file using Linux/Unix/macOS Terminal Command
- Create Hidden File or Directory using Shell Command
- bash: cls: command not found
- How to install python pip on Ubuntu using apt command
- The Date Command and its usage [Linux - Unix - macOS]
- SCP Copy all files from directory to Local Folder
- Create and write file in single Linux/macOS command
- Install OpenSSL on Linux/Ubuntu
- scp: ssh: connect to host xxxx port 22: Connection refused Error
- Check SSH/OpenSSH version Command
- Execute .bin and .run file Ubuntu Linux
- What does apt-get update command does?
- How to ls command to output one entry per line [macOS/Linux/Bash]
- 3 ways to clear screen on Linux Terminal
- How to backup a file in Linux/Unix
- How to quit or exit SFTP Prompt on Terminal
- How to use SCP Command to Copy Directory
- zsh hello world example
- How to remove/delete a directory in Linux/macOs
More Posts:
- Parsing Data for android-21 failed unsupported major.minor version 51.0 - Android
- How to start or open a new bourne-again shell (bash) session on Windows using Command Line CMD - Bash
- W3 HTML validator warning Unable to Determine Parse Mode - Html
- [Solved] Error launching studio - Android-Studio
- How to Get or Set SharePoint Document ID _dlc_DocId using PowerShell - SharePoint