Sometimes I have a one-liner that I am repeating many times for a particular task, but will likely never use again in the exact same form. It includes a file name that I am
Don't use ls | wc -l as it may give you wrong results if file names have newlines in it. You can use this function instead:
ls | wc -l
numresults() { find "$1" -mindepth 1 -printf '.' | wc -c; }