3.3.1 Argument Predicates

You can use argument predicates to filter lists of file names based on various properties of those files. This is most useful when combined with globbing, but can be used on any list of files names. Eshell supports the following argument predicates:

/

Matches directories.

.(Period)

Matches regular files.

@

Matches symbolic links.

=

Matches sockets.

p

Matches named pipes.

%

Matches block or character devices.

%b

Matches block devices.

%c

Matches character devices.

*

Matches regular files that can be executed by the current user.

r
A
R

Matches files that are readable by their owners (‘r’), their groups (‘A’), or the world (‘R’).

w
I
W

Matches files that are writable by their owners (‘w’), their groups (‘I’), or the world (‘W’).

x
E
X

Matches files that are executable by their owners (‘x’), their groups (‘E’), or the world (‘X’).

s

Matches files with the setuid flag set.

S

Matches files with the setgid flag set.

t

Matches files with the sticky bit set.

U

Matches files owned by the current effective user ID.

G

Matches files owned by the current effective group ID.

l[+-]n

Matches files with n links. With + (or -), matches files with more than (or less than) n links, respectively.

uuid
u'user-name'

Matches files owned by user ID uid or user name user-name.

ggid
g'group-name'

Matches files owned by group ID gid or group name group-name.

a[unit][+-]n
a[+-]'file'

Matches files last accessed exactly n days ago. With + (or -), matches files accessed more than (or less than) n days ago, respectively.

With unit, n is a quantity in that unit of time, so ‘aw-1’ matches files last accessed within one week. unit can be ‘M’ (30-day months), ‘w’ (weeks), ‘h’ (hours), ‘m’ (minutes), or ‘s’ (seconds).

If file is specified instead, compare against the modification time of file. Thus, ‘a-'hello.txt'’ matches all files accessed after hello.txt was last accessed.

m[unit][+-]n
m[+-]'file'

Like ‘a’, but examines modification time.

c[unit][+-]n
c[+-]'file'

Like ‘a’, but examines status change time.

L[unit][+-]n

Matches files exactly n bytes in size. With + (or -), matches files larger than (or smaller than) n bytes, respectively.

With unit, n is a quantity in that unit of size, so ‘Lm+5’ matches files larger than 5 MiB in size. unit can be one of the following (case-insensitive) characters: ‘m’ (megabytes), ‘k’ (kilobytes), or ‘p’ (512-byte blocks).

The ‘^’ and ‘-’ operators are not argument predicates themselves, but they modify the behavior of all subsequent predicates. ‘^’ inverts the meaning of subsequent predicates, so ‘*(^RWX)’ expands to all files whose permissions disallow the world from accessing them in any way (i.e., reading, writing to, or modifying them). When examining a symbolic link, ‘-’ applies the subsequent predicates to the link’s target instead of the link itself.