In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how to use the background running mode to start the program in the Linux terminal". The content in the article is simple and clear, and it is easy to learn and understand. please follow the editor's train of thought to study and learn "how to use the background running mode to start the program in the Linux terminal".
There are many ways to open a terminal window in Linux, depending on your choice and your desktop environment.
If you are using Ubuntu, you can use CTRL+ALT+T key combination to open the terminal. Of course, you can also use the super key (Windows key) to open Dash, search for "TERM", and then click the "Term" icon to open the terminal window.
For other desktop environments, such as XFCE, KDE, LXDE, Cinnamon, and MATE, you can find terminals in the menu. Some environments include terminal icons on the docking bar or panel.
Usually, you can type the application name directly into the terminal to start an application. For example, you can start Firefox by typing "firefox".
The advantage of launching the application on the terminal is that you can include some additional parameters.
For example, you can open a Firefox browsing window with the following command, and then use the default search engine to search for relevant information:
The code is as follows:
Firefox-search "linux.cn"
You may notice that if you start Firefox, the program opens and goes back to the terminal window control, which means you can continue to work on the terminal.
Normally, if you start an application at the terminal, the control will switch to the newly started application and will not switch back to terminal control until the program is closed. This is because you started the program at the front desk.
If you want to open the application in the Linux terminal and return to terminal control, you need to start the application as a background process.
As with the commands listed below, we can start the application in the background by adding a (&) symbol.
The code is as follows:
Libreoffice &
Translator's note: if you need to add parameters, remember to put the & symbol at the end.
Translator's note: in general, when the terminal is closed, the daemon started by the terminal will also be terminated. to keep the daemon running after the terminal is closed, you can use the following command
The code is as follows:
Nohup command [arg...] &
If the application directory is not installed in the directory contained in the PATH variable, there is no way to start the program directly through the application name, we must enter the entire path of the application to start it.
The code is as follows:
/ path/to/yourprogram &
If you are not sure which Linux directory structure the program enters, you can use the find or location command to locate it.
You can enter the following symbols to find a file:
The code is as follows:
Find / path/to/start/from-name programname
For example, you can type the following command to find Firefox:
The code is as follows:
Find /-name firefox
The results of the command run will whizz out a lot. Don't worry, you can also page through less or more.
The code is as follows:
Find /-name firefox | more
Find /-name firefox | less
When the find command finds a folder that does not have permission to access, it reports an access denied error
You can prompt for permissions through the sudo command. Of course, if you don't have sudo installed, you can only switch to a user with permissions.
The code is as follows:
Sudo find /-name firefox | more
If you know that the file you are looking for is in your current directory structure, you can use dots instead of slashes:
The code is as follows:
Sudo find. -name firefox | more
You may need sudo to elevate permissions, or you may not need it at all, and if this file is in your home directory, you don't need to use sudo.
Some applications must be elevated in order to run, or you will get a lot of denied access errors unless you use a privileged user or use sudo to elevate privileges.
Here's a little trick. If you run a program that requires elevated permissions to operate, enter the following command to try it:
The code is as follows:
Sudo!!
Thank you for your reading, the above is the content of "how to use the background running mode to start the program in the Linux terminal". After the study of this article, I believe you have a deeper understanding of how to use the background running mode to start the program in the Linux terminal, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.