Little Girl's Mostly Linux Blog


Bash tests

This page was last updated on August 19, 2013.

File Tests
d is a directory
f is a file
nt newer than
r readable
w writeable
x executable
Logical Tests
&& logical and
! logical not
|| logical or
Numeric Tests
gt greater than
ge greater than or equal to
eq equal to
lt less than
le less than or equal to
ne not equal to
String Tests
= equal to
n not zero length
z zero length

Obligatory Happy Ending

And they all lived happily ever after. The end.

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI


Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Blog at

%d bloggers like this: