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,
- Command to know the Available Memory on Linux System
- How to install curl on Alpine Linux
- How to backup a file in Linux/Unix
- Install Java Runtime Environment (Oracle or open JRE) on Ubuntu
- What is the Default Admin user and Password for Jenkins
- How to tar.gz a directory or folder Command
- Copy entire directory using Terminal Command [Linux, Mac, Bash]
- Fix: bash: ipconfig: command not found on Linux
- Command to check Last Login or Reboot History of Users and TTYs
- Linux: Create a New User and Password and Login Example
- ls command to list only directories
- bash: cls: command not found
- How to exit from nano command
- Installing and using unzip Command to unzip a zip file using Terminal
- What does apt-get update command does?
- ls command: sort files by name alphabetically A-Z or Z-A [Linux/Unix/macOS/Bash]
- How to remove or uninstall Java from Ubuntu using apt-get
- scp: ssh: connect to host xxxx port 22: Connection refused Error
- Sort ls command by last modified date and time
- Create Nested Directories using mkdir Command
- How to Exit a File in Terminal (Bash/Zsh)
- Command to know the installed Debian version?
- How to connect to SSH port other than default 22
- How to save a file in Nano Editor and Exit
- Install OpenSSL on Linux/Ubuntu
More Posts:
- Fix: 403 Forbidden/Access Denied Error during Windows Software Updates - Windows
- 21 Essential Mac Terminal Shortcuts for Devs and DevOps to Boost Productivity - MacOS
- Notepad++ Search Across Multiple Lines - NotepadPlusPlus
- Convert Java String to JSON Object using Jackson - Java
- Windows 11 Notepad Find and Replace All Text Example - Windows-11
- How to Make Excel as Default on Mac - MacOS
- How to Force Quit Microsoft Excel Application on Mac - Microsoft
- How to view the Eclipse error log - Eclipse