Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

1.) In a terminal when we make an alias for any command line,the life of that alias is as long as the terminal is open.

alias new_command=old_command

example: alias dog=cat

But can we explicitly undo the alias command? i.e undo the alias assigned to that command without closing the terminal.

2.) Also when we do something like PATH=$PATH:.:/Test

We add the files to that directory wherein all the command are stored.How do we undo this? One way of doing it is by closing the terminal,whats the other way?

I'm new to Unix ,please help. Correct me if i'm wrong

share|improve this question
    
For general $PATH manipulations see my Stack Overflow question How do I manipulate $PATH elements in shell scripts?. –  dmckee Oct 14 '10 at 23:32
add comment

2 Answers

up vote 7 down vote accepted

1) unalias dog

2) This will remove the lastmost directory from your path: PATH=${PATH%:*}. Repeat it as needed for however many bad entries you've got.

share|improve this answer
    
Carefully with %. :) –  Casual Coder Oct 14 '10 at 20:00
    
Thank you. +1. –  Pavitar Oct 15 '10 at 5:20
add comment

1) You mean like unalias ?

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.