Linux alias commands (can recursion be avoided?)

I searched for clarity aliases and used one command. I have currently defined the x command:

alias x="clear;ls" 

Now there is some way to avoid recursion and determine:

  alias ls='clear;ls' 
+7
source share
3 answers

If you put a backslash in front of the command name, this will disable any aliases.

 alias ls='clear;\ls' 

Or, as Arno said, just use the full path for ls.

+20
source

Another way to do this:

 alias ls='clear; command ls' 

This is different from /usr/bin/ls because it is still looking for ls in $PATH , but will ignore shell functions or aliases.

+13
source

Just do:

 alias ls='clear;/usr/bin/ls' 

When entering:

 $ ls 

First of all, he will search for a user-defined function, it will launch it, otherwise the search will be performed in the $ PATH commands.

By providing an explicit path to the ls , recursion can be avoided.

+1
source

All Articles