Answer the question
In order to leave comments, you need to log in
How to automatically create a file with all possible permissions in linux?
How to create empty files with all possible combinations of access rights, and the file name should look like rwx-wx--x.txt
That is, correspond to the rights
Answer the question
In order to leave comments, you need to log in
bash:
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
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question