/usr/bin/[

Asked by oddemirci on 2010-01-17

Just because of curiosity:

What is the file:

'/usr/bin/['

It seems to be binary, but I cannot run it. Also, I could not find anything related to this file on the web.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu bash Edit question
Assignee:
No assignee Edit question
Solved by:
Brian Gallew
Solved:
2010-01-17
Last query:
2010-01-17
Last reply:
2010-01-17
Best Brian Gallew (geek+work) said : #1

[ is an alias for "test" and is frequently used in shell scripts. When you see "if [ -e /some/file ]" the "[" in there is really running that file unless it happens to be a shell built-in.

Matt Perry (mp) said : #2

It's part of the GNU coreutils package. That particular program is associated with the 'test' program. Run 'man test' to see more.

oddemirci (oddemirci) said : #3

Hi Brian, thank you for the answer. I am new to Linux and learning details every day.

Interestingly googling "/usr/bin/[" does not give anything, neither does "if [ -e". Anyway, thank you.

oddemirci (oddemirci) said : #4

Hi Matt, thank you for the reference for "man test". It was helpful.