Linux / UNIX Tech Support Forum
This is a discussion on How to Count executable (x) files in Linux / UNIX? within the Shell scripting forums, part of the Development/Scripting category; hey all,, I need a script or line of command that counts files that have "x" perrmission. thanks....
|
|||||||
| Shell scripting You can discuss the shell scripting, request shell scripts and scripting techniques |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
||||
|
hey all,,
I need a script or line of command that counts files that have "x" perrmission. thanks. |
| The Following User Says Thank You to eawedat For This Useful Post: | ||
jaysunn (04-06-2009)
| ||
| Sponsored Links | ||
|
|
|
||||
|
GNU/find has the -executable option:
Code:
find /usr/sbin -executable | wc -l
__________________
Vivek Gite Linux Evangelist |
| The Following User Says Thank You to nixcraft For This Useful Post: | ||
jaysunn (04-06-2009)
| ||
|
||||
|
thanks jaysunn & nixcraft
nixcraft i think ur command seeks also in subdirectories ,, when using urs i got the number 318 (wide number) when using jaysnn's i get the number "4" 10x.. |
| The Following User Says Thank You to eawedat For This Useful Post: | ||
jaysunn (04-06-2009)
| ||
|
||||
|
Quote:
Code:
find /usr/sbin -executable -type f | wc -l Code:
find /usr/sbin/ -type f -perm -o+rx | wc -l Almost a close match!
__________________
Vivek Gite Linux Evangelist |
| The Following User Says Thank You to nixcraft For This Useful Post: | ||
jaysunn (05-06-2009)
| ||
![]() |
| Tags |
| bash , find , find -execcutable , gnu , linux , unix , wc command |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Linux / UNUX directory hard link count | vaibhav.kanchan | Linux software | 4 | 13-12-2008 02:10 AM |
| Rename multiple files in UNIX | sweta | Getting started tutorials | 1 | 26-10-2008 10:44 AM |
| Linux / UNIX Remove All Files in Folder Ending With ~ Symbol | demuytree | Shell scripting | 4 | 17-08-2008 07:25 AM |
| UNIX ls only directories (display only dirs and no files) | chiku | Solaris/OpenSolaris | 1 | 21-10-2006 12:27 AM |
| Script to remove executable files | sweta | Shell scripting | 4 | 12-03-2005 01:21 PM |