Answers for "how to check if a command exists in linux"

0

check if command exists bash

command -v <the_command>
Posted by: Guest on August-27-2021
0

check if a command exists

# To find out if a given command exists:

if command -v given-command > /dev/null 2>&1; then
  echo given-command is available
else
  echo given-command is not available
fi
Posted by: Guest on November-22-2021

Code answers related to "how to check if a command exists in linux"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language