Skip to content
Digital Garden
Search
K
Main Navigation
thien.dev
GitHub
Twitter
Appearance
GitHub
Twitter
Menu
Return to top
On this page
Table of Contents for current page
Linux commands
Check if a command exists
bash
if
[[
!
-x
"$(
command
-v
$CMD
)"
]];
then
echo
"
$CMD
could not be found"
exit
fi
if
[[
!
-x
"$(
command
-v
$CMD
)"
]];
then
echo
"
$CMD
could not be found"
exit
fi