First 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.
Free video tutorial 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.
If you want the program to be executed in the background, you can press ctrl C in the terminal to exit the program and re-enter ./openFireFox.sh &
, this way Programs can be run in the background and the terminal can continue to be used.
More related articles and tutorials are recommended: linux tutorial
The above is the detailed content of How to open software in linux. For more information, please follow other related articles on the PHP Chinese website!