Commands in a file:
1. Use your editor to create a file with the relevant commands.
d=/usr/share/dict/linux.words
echo `date` Hello!
count=`grep -c $1 $d`
example=`grep $1 $d|head -1`
echo the string $1 appears $count times in $d
echo including in the word \"$example,\" for example.
2. Change permissions so the file is executable.
$chmod +x afile
3. Run the file from the command line.
$./afile ground
Mon Oct 23 10:14:10 EDT 2017 Hello!
the string ground appears 142 times in /usr/share/dict/linux.words
including in the word "aboveground," for example.