0
votes

Right now I have a project here:

/srv/www/web/src/private/protected

It has a /vendors/ folder with /codeception in it. I have to currently do:

./vendor/codeception/codeception/codecept run

How can I link this directory/command 'codecept' so I don't have to type the absolute path every time?

I want:

codecept run

Instead of:

./vendor/codeception/codeception/codecept run

4
you can concatenate it to $PATH environment variable. PATH=$PATH:full_path_to_script. - shaiki siegal
Editing /etc/environment to: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/srv/www/tigoweb/src/private/proceted/vendor/codeception/codeception/codecept" didnt work - Illuminati

4 Answers

0
votes

In your project folder you could

ln -s vendor/codeception/codeception/codecept .

to create a symlink in the current folder.

0
votes

I added a symbolic link like so: sudo ln -s /srv/www/web/src/private/protected/vendor/codeception/codeception/codecept /usr/local/bin/codecept

0
votes

Edit your ~/.bashrc (or ~/.bash_profile). Add the following:

export PATH=$PATH:bin:vendor/bin

This will allow you to run any executables in both the bin/ and vendor/bin folders without having to cd into them.

You need to close and reopen your terminal for the change to take effect!

0
votes

concatenate it to $PATH environment variable

PATH=$PATH:full_path_to_script

$PATH is an environment veritable used to find commands/scripts in wanted paths.

each time you are looking for a script or command it looks at the Paths that are listed in this variable

see your paths with:

  ~> echo $PATH