Linux Commands: Making Bash Error Messages Friendlier | Linux Today

Linux Commands: Making Bash Error Messages Friendlier

Written By
CS
Carla Schroder
Apr 1, 2010

“The command line! The bane of the novice Linux user! It’s so
useful — yet it can be challenging to learn.

“The error messages don’t help much. “Command not found.”
“Permission denied.” As a newbie, you need to know more. Isn’t that
the right command? Why was permission denied? How are you to figure
out what the real problem was? And why can’t the shell help you
with that?

“Ubuntu has taken some steps in that direction already. They’ve
set up the bash shell so that if you get “Command not found”, most
of the time you’ll also see suggestions on what you might have
meant: commands that are spelled similarly, or commands that aren’t
installed along with which package you need to install to get them.
It looks like this:

$ catt /etc/fstab
No command ‘catt’ found, did you mean:
Command ‘cat’ from package ‘coreutils’ (main)
Command ‘cant’ from package ‘swap-cwm’ (universe)
catt: command not found

“It’s an excellent step. Perhaps still not 100% clear — you
still need to know what those packages are and how to install them
— but it’s a good start!

“But what about other errors, like the all too common
“Permission denied”? Ubuntu’s error handling uses a function built
into bash for that specific purpose, a function called
command_not_found_handle that can’t be used for other types of
errors.”

Complete
Story

CS

Carla Schroder

Linux Today Logo

LinuxToday is a trusted, contributor-driven news resource supporting all types of Linux users. Our thriving international community engages with us through social media and frequent content contributions aimed at solving problems ranging from personal computing to enterprise-level IT operations. LinuxToday serves as a home for a community that struggles to find comparable information elsewhere on the web.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.