Little Girl's Mostly Linux Blog

BashTests

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

Comment:

Blog at WordPress.com.