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
![](https://michalwojcik.com.pl/wp-content/uploads/2021/08/Screenshot-2021-08-24-at-17.28.12-1024x733.png)
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:
![](https://michalwojcik.com.pl/wp-content/uploads/2021/08/Screenshot-2021-08-24-at-17.28.55-1024x732.png)
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:
![](https://michalwojcik.com.pl/wp-content/uploads/2021/08/Screenshot-2021-08-24-at-17.31.40-1024x703.png)
It would just omit alias and use underlying command, which in this case is good old cat
.