Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

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
Comment

determine if command exists

python --version >nul 2>&1 && ( echo found python ) || ( echo fail )
Comment

PREVIOUS NEXT
Code Example
Shell :: make nextcloud scan for files 
Shell :: how to unzip using tar 
Shell :: docker compose latest version install ubuntu 
Shell :: docker start exited container 
Shell :: kill process on linux 
Shell :: bash replace string 
Shell :: get ip address in powershell specifically 
Shell :: docker why my container start on reboot 
Shell :: git push to remote 
Shell :: batch file comment after command 
Shell :: shell script if input is empty 
Shell :: install radeon drivers ubuntu 
Shell :: poetry command install mac 
Shell :: bash count elements in string 
Shell :: linux get ownership of own user directory folder ubuntu chown operation not permitted 
Shell :: get all pods in a node kubectl 
Shell :: bash script command not found 
Shell :: …or push an existing repository from the command line 
Shell :: install firebase on flutter 
Shell :: cp linux command with progress bar 
Shell :: docker run always puull 
Shell :: github actions set ssh key 
Shell :: reset gpg passphrase 
Shell :: see output of a running processes linux 
Shell :: gh clone 
Shell :: revert local merge 
Shell :: how to overwrite file linux cli 
Shell :: td-agent restart 
Shell :: github push local branch to remote 
Shell :: install kali desktop kde environment 
ADD CONTENT
Topic
Content
Source link
Name
3+8 =