I am trying to print the output as below using the command:
ls -l| awk '/777/{print $0}'
or
ls -l| awk '/0777/{print $0}'
But it does not print anything. O/P should be like,
drwxrwxrwx 2 sbcoper sbcprd 4096 Apr 20 2015 work
(I am using 0777 or 777 because of find . -type f -perm 0777)
Advertisement
Answer
you’ve got the right idea, but 777 is the octal representation of permissions, and with this you’re looking at the output of ls, which lists permissions as a string, like “drwxrwxrwx”, so a simple modification of your command would work nicely,
ls -l | awk '/rwxrwxrwx/{print $0}'