Open the terminal and create a folder to store the script file you wrote.
Find the path of the executable program to be opened. Here we take Firefox as an example. There is the Firefox execution program under /usr/bin.
Enter cd /usr/local/myShell to enter the folder just created.
(Recommended learning: linux video tutorial)
Then enter sudo touch openFireFox.sh to create the script file.
Enter sudo vi openFireFox.sh and use vi to edit the file.
#Press i to enter the insert state. Enter:
#!/bin/sh cd /usr/bin ./firefox
and then press the Esc key to exit the editing state. Press: wq and then press Enter to save the file and exit.
After exiting, enter sudo chmod 777 ./openFireox.sh to modify the file permissions.
Then enter ./openFireFox.sh to open the Firefox browser.
Related recommendations: linux tutorial
The above is the detailed content of How to open software in linux by calling script. For more information, please follow other related articles on the PHP Chinese website!