This is my solution from this thread. Member wanted to list all files in a directory with their octal permissions.
This script performs a ls -l style file list, with the octal permissions in the first column. The output formatting isn't perfect, but gets the point across.
Script:
This script performs a ls -l style file list, with the octal permissions in the first column. The output formatting isn't perfect, but gets the point across.
Script:
Bash:
#!/bin/bash
# list all files in current directory, and include their octal permissions
# include hidden
shopt -s dotglob
# iterate
for f in *
do
echo -n $(stat "$f" -c '%a')" "
echo "$(ls -ld --color=always "$f")"
done