How do I ignore bash shell aliases or functions when running a command without removing alias or function from memory or current shell session on a Linux or Unix-like systems?
An alias is nothing but shortcut to commands. The alias command allows the user to launch any command or group of commands (including options and filenames) by entering a single word. Aliases are mainly used to abbreviate a system command or add default arguments to a regularly used command.
ADVERTISEMENTS
Run:
$ alias
My bash aliases:
alias cp='cp -i'
alias l='ls $LS_OPTIONS -lA'
alias ll='ls $LS_OPTIONS -l'
alias ls='ls $LS_OPTIONS'
alias mv='mv -i'
alias rm='rm -i'
alias apt-get='apt-get update && apt-get upgrade'
Simply use a command called command as follows to ignore aliases or functions. For example, on my system I’ve following aliases set:
alias apt-get='apt-get update && apt-get upgrade'
To ignore apt-get alias, enter:
command apt-get -y install nginx
You can also use any one of the following syntax too:
**\**``apt-get -y install apache2
**"**``apt-get``**"**`` -y install htop
Both ** and " symbols allows you to run real apt-get command (or apt command if alias defined) and ignore apt-get/apt alias at the CLI.
#function