Bobby's Blog

Linux – 17 Special Characters in the Shell That You Should Know

Linux - 17 Special Characters in the Shell That You Should Know


There are a lot of characters that have special meaning to the shell.

Here are 17 of those special characters in the Shell with examples on how to use them.

1. Shortcut for the current user’s home directory

Example:


2. Escape/Ignore next character

Example:


3. Directory separator

Example:


4. Variable, precedes any var

Example:


5. Single-character wildcard

Example:


6. Single quotation mark – escapes the special characters

Example:


7. The back tick is used for substitution

Example:


8. Double quotation marks, unlike the single quotation marks, the special characters between the quotes would be executed as normal rather than being escaped.

Example:


9. Wildcard

Example:


10. Start a process in the background

Example:


11. If command1 returns true, then do command2

Example:



12. If command1 returns false, then do command2
Example:

13. Pipe output to a program
Example:

14. Execute multiple commands on one like
Example:

15. Ranges of letters and numbers
Example:

16. Redirect output to a file
Example:

17. Redirect input to a program
Example:

Once you know a good number of those you could then start using them together and do lots of cool stuff!

If you want to learn more about Linux, I strongly recommend the following book:


About the author

Bobby

Linux System Administrator