How to print other special characters?

QuestionsQuestions8 SkillsProBasic Files OperationsSep, 16 2025
0164

You can print other special characters in the terminal using the echo command as well. Here are some examples:

  1. Exclamation mark (!):

    echo "!"
  2. At symbol (@):

    echo "@"
  3. Hash (#):

    echo "#"
  4. Dollar sign ($):

    echo "\$"
  5. Ampersand (&):

    echo "&"
  6. Asterisk (*):

    echo "*"
  7. Parentheses (( and )):

    echo "( )"
  8. Quotes (" and '):

    echo "\"Single quotes\" and 'Double quotes'"

For characters that have special meanings in the shell (like $, &, *, etc.), you may need to escape them with a backslash (\) or enclose the entire string in single quotes (') to prevent the shell from interpreting them.

0 Comments

no data
Be the first to share your comment!