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,
- [Fix] Linux - bash: useradd: command not found
- Calculate days between dates using dateutils ddiff command
- pwd Command - Print Working Directory
- Rename a directory using Linux/Unix command
- How to go to the End of File in Nano Editor
- How to tar.gz a directory or folder Command
- How to remove/delete a directory in Linux/macOs
- How to Display content of a file in Terminal Screen?
- ls command sort by file size [Linix/UNIX/macOS/bash]
- How to Copy Entire Directory to another Directory in Linux
- 3 ways to clear screen on Linux Terminal
- Command to check Last Login or Reboot History of Users and TTYs
- How to check uptime of Linux/Unix/macOS system/server using console command?
- How to backup a file in Linux/Unix
- Command to know the installed Debian version?
- Check SSH/OpenSSH version Command
- 3 Commands to stop Nginx Server
- Linux: Create a New User and Password and Login Example
- How to install npm on Ubuntu
- How to List All Users in Linux
- How to Get the List of Shells on Linux
- Fix - ssh-copy-id no identities found error
- Installing and using unzip Command to unzip a zip file using Terminal
- scp: ssh: connect to host xxxx port 22: Connection refused Error
- zsh hello world example
More Posts:
- remove div vertical scroll - Html
- SharePoint Managed Metadata Hidden Taxonomy List - TaxonomyHiddenList - SharePoint
- Python matplotlib segmentation fault: 11 macOS Big Sur - Python
- Center Align TextView Android Horizontally or Vertically - Android
- W3 : character data is not allowed here html validation error - Html
- [Fix] Microsoft Teams No Network Connection Please check your network settings and try again. [2603] - Teams
- How to install Android Studio Chipmunk and SDK tools on macOS (2021.2) - Android-Studio
- Change the default Line Encoding Notepad++ (CR LF) - NotepadPlusPlus