command line, shell

How to bypass shell aliases? (fast!)

Bash aliases can save you from having to remember long commands and eliminate lots of typing. They simply make your life in terminal easier. But from time to time, we may want to use a origin command, which lies under alias.

Example

I use and recommend bat – a cat clone with wings. It supports syntax highlighting for a large number of programming and markup languages. I use it as an alias:

$ alias cat
cat=bat

What if you want to copy a fragment from this file using mouse? Hence there are line numbers and separators, selection would end like this:

While copying we obviously do not want those additional artifacts – content of the file is the key here. What we can do is to have a look at man page of bat and find the option to dismiss addons (--style=plain would do that). However this task can be done quicker by adding a slash at the beginning of the aliased command:

It would just omit alias and use underlying command, which in this case is good old cat.