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.
- How to Display content of a file in Terminal Screen?
- How to Install CVS Version Control on Linux/Ubuntu
- How to install and Configure sar sysstat tools in Ubuntu Linux
- ls command to list only directories
- [Ubuntu] Search a package and versions using apt command
- zsh hello world example
- Linux Remove or Delete Files and Directories using Terminal Commands
- How to tar.gz a directory or folder Command
- Calculate days between dates using dateutils ddiff command
- How to ls command to output one entry per line [macOS/Linux/Bash]
- 3 Commands to stop Nginx Server
- Create and write file in single Linux/macOS command
- SCP Copy all files from directory to Local Folder
- How to go to the End of File in Nano Editor
- How to remove/delete a directory in Linux/macOs
- How to Copy Entire Directory to another Directory in Linux
- Execute .bin and .run file Ubuntu Linux
- The Date Command and its usage [Linux - Unix - macOS]
- Fix - ssh-copy-id no identities found error
- How to check uptime of Linux/Unix/macOS system/server using console command?
- How to Select All text in vim/vi editor using Keyboard
- Linux: Create a New User and Password and Login Example
- Command to display epoch time Terminal
- How to install curl on Alpine Linux
- How to exit from nano command
- How to uninstall pip Python packages - Python
- Run SharePoint Flow on weekday, weekend, specific day - PowerAutomate
- Notepad++ Mark and Copy feature - NotepadPlusPlus
- How to check Command Line Tools Version [Updated for Ventura] - MacOS
- How to Sign Up for ChatGPT AI Chat Bot with Steps - HowTos
- JdbcTemplate Batch Insert Example using Spring Boot - Java
- Building library Gradle Project Info: Downloading services.gradle.org - Android-Studio
- Docker MySQL Compose File with Volume Example - Docker