I want to get the list of all the files in my home folder, having rwx
(read-write-execute) or 777 permissions for everyone.
Also, what is the command to know the permissions of a file?
I want to get the list of all the files in my home folder, having rwx
(read-write-execute) or 777 permissions for everyone.
Also, what is the command to know the permissions of a file?
The terminal opens up in your home directory by default. From anywhere else, type cd ~
to return to the home directory.
ls -l
will show you the file permissions at the beginning, e.g.
-rwxr-xr-x 1 izx izx 11217428 Oct 2 2011 wkhtmltoimage-amd64
You can then filter with grep to get your desired result:
ls -l | grep -P ".{7}rwx.*"
rwx
which in my home directory shows:
-rwxrwxrwx 1 izx izx 0 Jun 15 23:42 sd.png
-rwxrwxrwx 1 izx izx 0 Jun 15 23:42 slashdot.png
drwxrwxrwx 3 izx izx 4096 Jun 15 21:31 src
In your home directory, type find . -perm -a+rwx
rwx
by all; the results will be displayed with full relative paths, e.g.
./.mozilla/firefox/lr5z24b3.default/lock
./src
./src/accountsservice-0.6.15/src/libaccountsservice/.libs/libaccountsservice.so
./src/accountsservice-0.6.15/src/libaccountsservice/.libs/libaccountsservice.la
./src/accountsservice-0.6.15/src/libaccountsservice/.libs/libaccountsservice.so.0
./src/accountsservice-0.6.15/debian/libaccountsservice-dev/usr/lib/libaccountsservice.so
./src/accountsservice-0.6.15/debian/libaccountsservice0/usr/lib/libaccountsservice.so.0
./src/accountsservice-0.6.15/debian/tmp/usr/lib/libaccountsservice.so
./src/accountsservice-0.6.15/debian/tmp/usr/lib/libaccountsservice.so.0
./.pulse/676238f89edd1f57138b3da400000004-runtime
./sd.png
./slashdot.png
./XnView/lib/libQtGui.so.4
./XnView/lib/libQtWebKit.so.4
./XnView/lib/libQtXml.so.4
./XnView/lib/libQtDBus.so.4
./XnView/lib/libQtNetwork.so.4
./XnView/lib/libQtCore.so.4
./XnView/lib/libQtSvg.so.4
The bold entries in the home directory also showed up in the first method.
For more ways on using find
to accomplish what you want, please refer to Eliah Kagan's answer just above or below this one.