I've been looking around for ways to alias clear and ls into one command. Currently I've defined command x:
alias x="clear;ls"
Now is there any walkaround to avoid recursion and define:
alias ls='clear;ls'
If you put a backslash before the command name, that will disable any aliases.
alias ls='clear;\ls'
Or, like Arnaud said, just use the full path for ls.
Another way of doing this would be
alias ls='clear; command ls'
This is different from /usr/bin/ls
, as it still searches ls
in the $PATH
, but will ignore shell functions or aliases.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With