Q. How do I ignore shell aliases or function when running a command without removing alias / function from memory or current shell session?
A. aliases are mainly used for abbreviating a system command, or for adding default arguments to a regularly used command.
To view defined aliases the following commands can be used:
$ alias
Sample output:
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'
How to ignore aliases or functions when running a command?
Simply use command called command as follows to ignore aliases or functions. For example, on my system I've following alias set:
alias apt-get='apt-get update && apt-get upgrade'
To ignore apt-get alias, enter:
command apt-get -y install
You can also use any one of the following syntax:
\apt-get -y install
"apt-get" -y install
Both \ and " symbols allows you to run real apt-get command and ignore apt-get alias.
More about 'command' command
Runs COMMAND with ARGS ignoring shell functions. If you have a shell function called ls, and you wish to call the command /bin/ls command, you can type:
command ls
If the -p option is given, a default value is used for PATH that is guaranteed to find all of the standard utilities under UNIX / Linux:
command -p ls
The -V or -v option is given, a string is printed describing COMMAND. The -V option produces a more verbose description:
command -v ls
Sample output:
ls is aliased to `ls $LS_OPTIONS'
type command
Type command will print information about alias, function and real command:
type -a apt-get
Sample output:
apt-get is aliased to `apt-get update && apt-get upgrade' apt-get is /usr/bin/apt-get
Further readings:
- bash man page
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop










![Linux: HowTo Copy a Folder [ Command Line Option ]](http://s0.cyberciti.org/images/rp/1/16.jpg)

{ 2 comments… read them below or add one }
how about unalias?
Thanks Vivek – “command” is new to me.
It is astonishing how Bash has become a swiss knife shell …