The bottom line is that I can not run a command in the folder from the terminal. While I'm in it. Writes that the command is not found, and that's it. I tried to copy to / usr / local / bin - the command is executed, but the wrong paths during execution are understandable, since I launch the artisan console utility on the laravel project.

I would be grateful for the help. All I could find on the Internet is "a list of the most popular bash commands," "terminal commands that everyone should know," etc.

  • show file start - Senior Pomidor
  • What kind of file? - Denis Okunev
  • you can not run a command that is in a folder, right? Do you mean some function (or skrpit)? then write your team. please - Senior Pomidor
  • <? php / * | -------------------------------------------- ------------------------------ | Register The Auto Loader | --------------------------------------------- ----------------------------- | | Composer provides a convenient, automatically generated class loader | for our application. We just need to utilize it! We'll require it | not the worry about the | loading of any of our classes "manually". Feels great to relax. | * / require DIR . '/ bootstrap / autoload.php'; - Denis Okunev
  • Awfully showed) I mean the script that is in the file - Denis Okunev

1 answer 1

  1. do not confuse command and file. command is not in the "directory" command is a keyword for the shell (echo, for example)

  2. to run a file that has an executable bit installed (chmod + x filename), write ./имяФайла (Unix searches and runs executable files only in directories it knows about from the PATH variable), and ./ helps it to guess that the current directory is needed.

  3. if you have php (python, etc.) - file, just write php имяФайла

  4. if your php script has a so-called shebang line ( #!/usr/bin/php ) and the executable file itself (chmod + x) installed, then the ./ filename should work (no need to write a php имяФайла )

  • Thanks again! - Denis Okunev