Suppose I have command like cd abc/def, So I want to create own command like 'a'.
If I run 'a' command it ,should run command cd abc/def
optiplex-3020:~$ a
So could it be possible and I want to use python as scripting language
Suppose I have command like cd abc/def, So I want to create own command like 'a'.
If I run 'a' command it ,should run command cd abc/def
optiplex-3020:~$ a
So could it be possible and I want to use python as scripting language
cd
is a built-in command and cannot be run by an external program, so you must use your shell:
alias a='cd abc/def'
If you want this to be permanent, put it in your ~/.bashrc
or ~/.zshrc
depending on your shell.
You can just use aliases in linux it does exactly what you want. Other option is to create alias that points to the python script, but i see no point using python when you have it integrated in linux.