Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have some script files in a folder along with many other types of files. Is there a way to zip files by username or by permission of files. I want to zip all script files (with execution bit) in a directory.
Thanks. For some reason -f executable didn't list all files
It's not -f, but "-type f" (normal files only) combined with "-executable" (has a "x" bit in its permissions). The first is to exclude directories and sym-links with that X-bit.
It's not -f, but "-type f" (normal files only) combined with "-executable" (has a "x" bit in its permissions). The first is to exclude directories and sym-links with that X-bit.
Sorry, it was a typo mistake. In the terminal I did put correct syntax
Code:
$ ll
-rw-rw-r--. 1 neon neon 119 Jun 4 18:03 gnome-mimial.txt
-rwx------. 1 neon neon 6.4K Jun 4 17:44 hevc
-rw-rw-r--. 1 neon neon 2.2K Jun 4 18:03 hevc-script.txt
-rw-r--r--. 1 neon neon 71 Jun 4 18:03 java.txt
-rwx------. 1 neon neon 202 Jun 3 23:47 jeda
-rwx------. 1 neon neon 2.1K Jun 3 23:47 nvd
-rw-r--r--. 1 neon neon 34 Jun 4 18:03 xfce-cent.txt
-rwx------. 1 neon neon 2.1K Jun 3 23:47 xvd
-rwx------. 1 neon neon 6.1K Jun 3 23:47 xvEncode
-rwx------. 1 neon neon 2.9K Jun 3 23:47 xvJoin
-rwx------. 1 neon neon 2.6K Jun 3 23:47 xvjoin.sh
-rwx------. 1 neon neon 4.1K Jun 3 23:47 xvSlow
-rwx------. 1 neon neon 1.9K Jun 3 23:47 xvTag
-rwx------. 1 neon neon 3.8K Jun 3 23:47 xvYuv4
-rwx------. 1 neon neon 9.6K Jun 3 23:47 yama
-rwx------. 1 neon neon 495 Jun 4 17:44 ytpl
-rw-r--r--. 1 neon neon 161 Jun 4 18:03 yt.txt
$ find . -type f -executable
./hevc
./ytpl
$ find . -type f -perm /+x
./jeda
./nvd
./xvd
./xvEncode
./xvJoin
./xvjoin.sh
./xvSlow
./xvTag
./xvYuv4
./yama
./hevc
./ytpl
-executable
Matches files which are executable and directories which are
searchable (in a file name resolution sense) by the current
user. This takes into account access control lists and other
permissions artefacts which the -perm test ignores. This test
makes use of the access(2) system call, and so can be fooled by
NFS servers which do UID mapping (or root-squashing), since many
systems implement access(2) in the client's kernel and so cannot
make use of the UID mapping information held on the server. Be‐
cause this test is based only on the result of the access(2)
system call, there is no guarantee that a file for which this
test succeeds can actually be executed.
Executed 'file <filename>' and realized the mistake I did. The executable shell scripts were having different owner usernames. In my previous post, I had changed every username to 'neon' for easy reading. the '-type f -executable' only showed the files by an active user (me), whereas '-perm /+x' showed executable files of all users.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.