Create an ALIAS for a . /configure File?

Asked

Viewed 121 times

2

I cloned the Github repository, and to execute the command I always need to type, . /directory name/vv

I imagine that this "file" is of the Linux CONFIGURE type, correct?

I wonder how I create an ALIAS on Ubuntu so that when I type only "vv" it runs this command globally from anywhere on my machine...

And if possible they could add the same process to OSX (Mac)?

1 answer

1


Usually the alias is placed in the file ~/.bashrc, assuming you use the Bash. To edit the file, type in the terminal:

gedit ~/.bashrc

And add the alias in the end:

alias cmd='comando'

It is also possible to create a aliases separate, so you won’t have to put them on .bashrc, but in a file of your choice. First, edit the file ~/.bashrc and uncomment the following lines:

if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi

Save and close the file. After that, all you have to do is create the file ~/.bash_aliases and add your aliases there.

  • It worked partially... I created an alias like this: alias vv='. /vv/vv' right? This VV folder is in the /home/joaopaulo/ and can only be executed if I am in the /home/joaopaulo/ I wanted to be able to execute this command from anywhere in the system, either in Documents or the Desktop, I wanted to)

  • 1

    @Joãopaulo Good, if the folder vv is in your home, just indicate in the alias thus: vv='$HOME/vv/vv' should work. =)

  • @qmechanick Worked!!!! Thank you very much!!!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.