I want to remove gs alias from my PC. When I type gs it will open GhostScript. But I checked everywhere in the home directory .alias .bash_aliases .bashrc

I also overwrite the gs with my custom alias.

I can't remove it. And I also type alias in terminal, in the list I couldn't find it.

Please I want to remove it...

  • 3
    gs isn't an alias, it's the name of the GhostScript binary. If you want gs to do nothing then you would have to uninstall ghostscript from your system although this probably isn't a good idea as a lot of other software depends on it. – Cheesemill Jul 27 '13 at 18:52
  • @Cheesemill and that explains the ? I had in my head. Why do you assume it is aliased jean000? :) – Rinzwind Jul 27 '13 at 18:58
  • 3
    You can use type gs to check if the command is an executable file, an alias, a bash function or a bash builtin. – Håken Lid Oct 9 '15 at 19:33
  • 1
    alias --help, unhelpfully, does not reveal any useful answer to this question – Purplejacket Apr 14 '17 at 20:50

The command to remove an alias is unalias so....

 unalias gs



unalias - remove alias definitions


unalias alias-name...

unalias -a


The unalias utility shall remove the definition for each alias name specified. See Alias Substitution . The aliases shall be removed from the current shell execution environment; see Shell Execution Environment .

-a Removes All aliases

  • not working I got unalias: no such hash table element: gs – jean000 Jul 27 '13 at 18:41
  • 10
    Then you do NOT have it alias'd. – Rinzwind Jul 27 '13 at 18:45
  • 8
    caution: unalias -a will remove all alias definitions from the current shell execution environment., possibly including other innocent ones. – Huey Nov 21 '14 at 12:48
  • 1
    @assylias I missed that :) edited – Rinzwind May 20 '15 at 11:42
  • 3
    unalias removes an alias or aliases from the current shell, but if they are 'stored' in for example ~/.bashrc, they will come back when you create a new shell (or terminal window). So you should remove the definition of the aliases from where they are stored in order to get rid of them, unless they are temporary aliases. – sudodus Mar 19 '18 at 17:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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