unalias Command in Linux with Examples

This tutorial explains Linux “unalias” command, options and its usage with examples.

unalias – remove alias.

DESCRIPTION

The unalias command is used to remove entries from the current user’s list of aliases.

unalias removes aliases created during the current login session. It also suppresses permanent aliases; however, they are affected only for the current login session and are restored after the user logs in again.

unalias can simultaneously accept any number of alias names as arguments (i.e., input data).

advertisement
advertisement

SYNOPSIS

unalias [-a] [alias_name(s)]

OPTION :

-a
This option tells unalias to remove all aliases for the current user for the current shell for the current session, but it likewise does not affect permanent aliases for future sessions.

Note: Join free Sanfoundry classes at Telegram or Youtube

EXAMPLE

For example, if a user had an alias named p for the pwd (i.e., present working directory) command, such alias could be removed with the following:

$ unalias p

Now if one tries to run a command p by entering p at the terminal prompt, one will get an error of Command Not Found.

advertisement

Sanfoundry Global Education & Learning Series – 1000 Linux Tutorials.

If you wish to look at all Linux commands and their usage examples, go to Linux Commands Tutorial.

advertisement

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.