Skip to content

Instantly share code, notes, and snippets.

@HotFusionMan
Created June 8, 2021 12:57
Show Gist options
  • Save HotFusionMan/f71dcfde1afe64c38909be7aa27fecad to your computer and use it in GitHub Desktop.
Save HotFusionMan/f71dcfde1afe64c38909be7aa27fecad to your computer and use it in GitHub Desktop.
#!/bin/bash
# From https://www.networkworld.com/article/3620895/what-asking-which-whereis-or-whatis-can-tell-you-about-linux-commands.html , with syntax corrections for macOS X.
clear
if [ $# == 0 ]; then # if no arguments provided, prompt user
echo -n "What command(s) are you asking about?> "
read args
else
args=$*
fi
for cmd in `echo $args` # for each command entered
do
echo "$cmd"
echo -n "executable: "
which $cmd
echo -n "all files: "
whereis $cmd | sed "s/$cmd: //"
echo 'function(s):'
echo "`whatis $cmd`"
echo "===================================================================="
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment