Uthman
Uthman

Reputation: 9817

Find executable files having no extensions?

Following program list me all files in a directory but how can I display only those 'executable' files having no extension ?

find $workingDir/testcases -type f -perm -og+rx  | while read file
do
        echo $file  
done

Upvotes: 2

Views: 3283

Answers (2)

Quamis
Quamis

Reputation: 11087

#!/bin/bash

DIR="./";

find $DIR -type f -perm -og+rx  | while read file
do
    echo $file | egrep -v "\.[^/]+$";
done

Upvotes: 1

Reto Aebersold
Reto Aebersold

Reputation: 16624

You could use:

find $workingDir/testcases -type f ! -name "*.*" -perm -og+rx

Upvotes: 9

Related Questions