TL;DR: The command to remove a shell alias is unalias
. See the unalias manual. Run:
unalias gs
But if your gs
command is not an alias (most likely), it will not help. The response will be something like:
bash: unalias: gs: not found
To find the type of the command trouble you're in, use type
built-in shell command:
type gs
On my system it says it is an executable:
gs is /usr/bin/gs
Compare that with a common alias ll
:
alias ll='ls -l'
type ll
ll is aliased to `ls -l'
See help type
for detailed description of the type
shell built-in command
You can also check if it is a symbolic link with:
ls -la /usr/bin/gs
On my system it isn't:
-rwxr-xr-x 1 root root 14520 Aug 24 17:03 /usr/bin/gs
Otherwise there would be an arrow like this:
-rwxr-xr-x 1 root root 14520 Aug 24 17:03 /usr/bin/gs -> /some/other/file
As pointed out by others, removing the alias from the current shell session is temporary. For permanent removal, you will need to find where it is defined, such as alias gs=xyz
, and remove it there, or add unalias gs
to your ~/.profile
or ~/.bashrc
file.
If it is not an alias, you can locate the package that installed the command and uninstall it. On Debian/Ubuntu for instance:
dpkg -S /usr/bin/gs
ghostscript: /usr/bin/gs
sudo apt-get remove ghostscript
type gs
to check if the command is an executable file, an alias, a bash function or a bash builtin.alias --help
, unhelpfully, does not reveal any useful answer to this question