touch {0..7}{0..7}{0..7}.txt
echo -n {0..7}{0..7}{0..7} | xargs -d ' ' -I{} chmod {} {}.txt
touch u={,r}{,w}{,x},g={,r}{,w}{,x},o={,r}{,w}{,x}.txt
echo -n u={,r}{,w}{,x},g={,r}{,w}{,x},o={,r}{,w}{,x} | xargs -d ' ' -I{} chmod {} {}.txt
#! /bin/bash
let "i=0"
echo $i
while [ $i -lt 512 ]
do
touch tmp
chmod $(printf %o $i) tmp
mv -- tmp "$(ls -l tmp | cut -d' ' -f1).txt"
let "i=i+1"
done