8
rated 0 times
[
8]
[
0]
/ answers: 1 / hits: 1979
/ 1 Year ago, thu, march 2, 2023, 1:06:14
The name of the file is '[' . When I open it up in vi it looks like it's a copy of 'test'. It's owned by root.
More From » 11.04
The name of the file is '[' . When I open it up in vi it looks like it's a copy of 'test'. It's owned by root.
That file is supposed to be there (or under /usr/bin/[
). It allows you to type, for instance, [ -f $HOME/.bashrc ] && echo ".bashrc exists"
, which is equivalent to test -f $HOME/.bashrc && echo ".bashrc exists"
.
Reality is a bit more complicated, since bash overrides /usr/bin/[
with its own [
, so you can use the [
executable by providing a full path, /usr/bin/[ -f $HOME/.bashrc ] && echo ".bashrc exists"
.