Skip to main content
Cleaner and more readable?
Source Link
Thor
  • 17.5k
  • 3
  • 55
  • 71

To find out what commands are masked by aliases, do something like this:

alias | sed 's/^[^ ]* *\|=.*$//g' | while read a; do
  printf "%20.20s : %s\n" $a "$(type -ta $a         |
awk tr-F '\n''[ =]+' '{print $2}')"      |
donewhile read cmd; do
  type -ta "$cmd" | awkgrep -Fq file \
    && printf "%s is overloaded: '$2\"%s\"\n" ~"$cmd" /file/'"$(alias $cmd)"
done

###Explanation

Explanation

alias alone lists defined aliases and sedawk extracts their name. The while loop runs type -ta on each of them and awkgrep prints the lines that both contain alias and filechecks if any also are a file.

To find out what commands are masked by aliases, do something like this:

alias | sed 's/^[^ ]* *\|=.*$//g' | while read a; do
  printf "%20.20s : %s\n" $a "$(type -ta $a | tr '\n' ' ')"
done | awk -F: '$2 ~ /file/'

###Explanation

alias alone lists defined aliases and sed extracts their name. The while loop runs type -ta on each of them and awk prints the lines that both contain alias and file.

To find out what commands are masked by aliases, do something like this:

alias                            |
awk -F '[ =]+' '{print $2}'      |
while read cmd; do
  type -ta "$cmd" | grep -q file \
    && printf "%s is overloaded: \"%s\"\n" "$cmd" "$(alias $cmd)"
done

Explanation

alias alone lists defined aliases and awk extracts their name. The while loop runs type -ta on each of them and grep checks if any also are a file.

Added explanation of awk. Remove all whitespace before alias name.
Source Link
Thor
  • 17.5k
  • 3
  • 55
  • 71

To find out what commands are masked by aliases, do something like this:

alias | sed 's/^[^ ]* \|=*\|=.*$//g' | while read a; do
  printf "%20.20s : %s\n" $a "$(type -ta $a | tr '\n' ' ')"
done | awk -F: '$2 ~ /file/'

###Explanation

alias alone lists defined aliases and sed extracts their name. The while loop runs type -ta on each of them and awk prints the lines that both contain alias and file.

To find out what commands are masked by aliases, do something like this:

alias | sed 's/^[^ ]* \|=.*$//g' | while read a; do
  printf "%20.20s : %s\n" $a "$(type -ta $a | tr '\n' ' ')"
done | awk -F: '$2 ~ /file/'

###Explanation

alias alone lists defined aliases and sed extracts their name. The while loop runs type -ta on each of them.

To find out what commands are masked by aliases, do something like this:

alias | sed 's/^[^ ]* *\|=.*$//g' | while read a; do
  printf "%20.20s : %s\n" $a "$(type -ta $a | tr '\n' ' ')"
done | awk -F: '$2 ~ /file/'

###Explanation

alias alone lists defined aliases and sed extracts their name. The while loop runs type -ta on each of them and awk prints the lines that both contain alias and file.

Brief explanation
Source Link
Thor
  • 17.5k
  • 3
  • 55
  • 71

To find out what commands are masked by aliases, do something like this:

alias | sed 's/^[^ ]* \|=.*$//g' | while read a; do
  printf "%20.20s : %s\n" $a "$(type -ta $a | tr '\n' ' ')"
done | awk -F: '$2 ~ /file/'

###Explanation

alias alone lists defined aliases and sed extracts their name. The while loop runs type -ta on each of them.

To find out what commands are masked by aliases, do something like this:

alias | sed 's/^[^ ]* \|=.*$//g' | while read a; do
  printf "%20.20s : %s\n" $a "$(type -ta $a | tr '\n' ' ')"
done | awk -F: '$2 ~ /file/'

To find out what commands are masked by aliases, do something like this:

alias | sed 's/^[^ ]* \|=.*$//g' | while read a; do
  printf "%20.20s : %s\n" $a "$(type -ta $a | tr '\n' ' ')"
done | awk -F: '$2 ~ /file/'

###Explanation

alias alone lists defined aliases and sed extracts their name. The while loop runs type -ta on each of them.

Source Link
Thor
  • 17.5k
  • 3
  • 55
  • 71
Loading