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 gsto check if the command is an executable file, an alias, a bash function or a bash builtin. – Håken Lid Oct 09 '15 at 19:33alias --help, unhelpfully, does not reveal any useful answer to this question – Purplejacket Apr 14 '17 at 20:50/usr/bin/ghostscriptis a symbolic link to/usr/bin/gs. Sofile $(which gs)should show ELF which is your executable file and of course,file $(which ghostscript)should show "symbolic link to gs". – mchid Aug 08 '23 at 22:10dpkg -L ghostscriptordpkg -L ghostscript | grep binshould show all the files included with the ghostscript package that are (should be) in your $PATH. – mchid Aug 08 '23 at 22:12type gscommand noted above, you may also trywhich gs. – mb-texas Jan 03 '24 at 18:11