mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-02-25 00:50:15 +08:00
Merge pull request #2248 from ZhouJ-sh/master
选题&翻译 20150115 How To Run Linux Applications From The Terminal In Background Mode.md 您好,非常感谢您的翻译和选题。有一点小问题,请您下次稍微注意下: 您这个翻译,是一次性提交了选题和译文,为了保持原文参考,您没有删除原文,但是这样您的原文就没人删除了。 所以,建议您,选题单独一个 PR,翻译的译文(包括删除选题的原文)再来一个 PR,并拉开时间差比较好。 此外,您这里把上一个翻译的原文给删除了,其实应该在上次提交译文时候删除——这个也是我疏忽了,我当时应该给补充删除的。 这次的这个 PR 的原文,我稍后会帮您删除。 再次,感谢您的参与和奉献~
This commit is contained in:
commit
71de35194d
@ -1,104 +0,0 @@
|
||||
[zhouj-sh translating...]
|
||||
2 Ways To Fix The UEFI Bootloader When Dual Booting Windows And Ubuntu
|
||||
================================================================================
|
||||
The main problem that users experience after following my [tutorials for dual booting Ubuntu and Windows 8][1] is that their computer continues to boot directly into Windows 8 with no option for running Ubuntu.
|
||||
|
||||
Here are two ways to fix the EFI boot loader to get the Ubuntu portion to boot correctly.
|
||||
|
||||

|
||||
|
||||
### 1. Make GRUB The Active Bootloader ###
|
||||
|
||||
There are a few things that may have gone wrong during the installation.
|
||||
|
||||
In theory if you have managed to install Ubuntu in the first place then you will have [turned off fast boot][2].
|
||||
|
||||
Hopefully you [followed this guide to create a bootable UEFI Ubuntu USB drive][3] as this installs the correct UEFI boot loader.
|
||||
|
||||
If you have done both of these things as part of the installation, the bit that may have gone wrong is the part where you set GRUB2 as the boot manager.
|
||||
|
||||
To set GRUB2 as the default bootloader follow these steps:
|
||||
|
||||
1.Login to Windows 8
|
||||
2.Go to the desktop
|
||||
3.Right click on the start button and choose administrator command prompt
|
||||
4.Type mountvol g: /s (This maps your EFI folder structure to the G drive).
|
||||
5.Type cd g:\EFI
|
||||
6.When you do a directory listing you will see a folder for Ubuntu. Type dir.
|
||||
7.There should be options for grubx64.efi and shimx64.efi
|
||||
8.Run the following command to set grubx64.efi as the bootloader:
|
||||
|
||||
bcdedit /set {bootmgr} path \EFI\ubuntu\grubx64.efi
|
||||
|
||||
9:Reboot your computer
|
||||
10:You should now have a GRUB menu appear with options for Ubuntu and Windows.
|
||||
11:If your computer still boots straight to Windows repeat steps 1 through 7 again but this time type:
|
||||
|
||||
bcdedit /set {bootmgr} path \EFI\ubuntu\shimx64.efi
|
||||
|
||||
12:Reboot your computer
|
||||
|
||||
What you are doing here is logging into the Windows administration command prompt, mapping a drive to the EFI partition so that you can see where the Ubuntu bootloaders are installed and then either choosing grubx64.efi or shimx64.efi as the bootloader.
|
||||
|
||||
So [what is the difference between grubx64.efi and shimx64.efi][4]? You should choose grubx64.efi if secureboot is turned off. If secureboot is turned on you should choose shimx64.efi.
|
||||
|
||||
In my steps above I have suggested trying one and then trying another. The other option is to install one and then turn secure boot on or off within the UEFI firmware for your computer depending on the bootloader you chose.
|
||||
|
||||
### 2. Use rEFInd To Dual Boot Windows 8 And Ubuntu ###
|
||||
The [rEFInd boot loader][5] works by listing all of your operating systems as icons. You will therefore be able to boot Windows, Ubuntu and operating systems from USB drives simply by clicking the appropriate icon.
|
||||
|
||||
To download rEFInd for Windows 8 [click here][6].
|
||||
|
||||
After you have downloaded the file extract the zip file.
|
||||
|
||||
Now follow these steps to install rEFInd.
|
||||
|
||||
1.Go to the desktop
|
||||
2.Right click on the start button and choose administrator command prompt
|
||||
3.Type mountvol g: /s (This maps your EFI folder structure to the G drive)
|
||||
4.Navigate to the extracted rEFInd folder. For example:
|
||||
|
||||
cd c:\users\gary\downloads\refind-bin-0.8.4\refind-bin-0.8.4
|
||||
|
||||
When you type dir you should see a folder for refind
|
||||
5.Type the following to copy refind to the EFI partition:
|
||||
|
||||
xcopy /E refind g:\EFI\refind\
|
||||
|
||||
6.Type the following to navigate to the refind folder
|
||||
|
||||
cd g:\EFI\refind
|
||||
|
||||
7.Rename the sample configuration file:
|
||||
|
||||
rename refind.conf-sample refind.conf
|
||||
8.Run the following command to set rEFInd as the bootloader
|
||||
|
||||
bcdedit /set {bootmgr} path \EFI\refind\refind_x64.efi
|
||||
|
||||
9.Reboot your computer
|
||||
10.You should now have a menu similar to the image above with options to boot Windows and Ubuntu
|
||||
|
||||
This process is fairly similar to choosing the GRUB bootloader.
|
||||
|
||||
Basically it involves downloading rEFInd, extracting the files. copying the files to the EFI partition, renaming the configuration file and then setting rEFInd as the boot loader.
|
||||
|
||||
### Summary ###
|
||||
|
||||
Hopefully this guide has solved the issues that some of you have been having with dual booting Ubuntu and Windows 8.1. If you are still having issues feel free to get back in touch using the email link above.
|
||||
|
||||
|
||||
作者:[Gary Newell][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
via:http://linux.about.com/od/LinuxNewbieDesktopGuide/tp/3-Ways-To-Fix-The-UEFI-Bootloader-When-Dual-Booting-Windows-And-Ubuntu.htm
|
||||
[a]:http://linux.about.com/bio/Gary-Newell-132058.htm
|
||||
[1]:http://linux.about.com/od/LinuxNewbieDesktopGuide/ss/The-Ultimate-Windows-81-And-Ubuntu-
|
||||
[2]:http://linux.about.com/od/howtos/ss/How-To-Create-A-UEFI-Bootable-Ubuntu-USB-Drive-Using-Windows_3.htm#step-heading
|
||||
[3]:http://linux.about.com/od/howtos/ss/How-To-Create-A-UEFI-Bootable-Ubuntu-USB-Drive-Using-Windows.htm
|
||||
[4]:https://wiki.ubuntu.com/SecurityTeam/SecureBoot
|
||||
[5]:http://www.rodsbooks.com/refind/installing.html#windows
|
||||
[6]:http://sourceforge.net/projects/refind/files/0.8.4/refind-bin-0.8.4.zip/download
|
@ -0,0 +1,85 @@
|
||||
How To Run Linux Programs From The Terminal In Background Mode
|
||||
========================================================================
|
||||
|
||||

|
||||
|
||||
This is a short but useful guide to show how to run Linux applications from the terminal whilst allowing the terminal to retain control.
|
||||
|
||||
There are various ways of opening a terminal window in Linux and it largely depends on your choice of distribution and the desktop environment.
|
||||
|
||||
Using Ubuntu you can open a terminal by using the CTRL + ALT + T key combination. You can also open a terminal window by pressing the super key (Windows Key), on the keyboard, to [bring up the Dash][1] and search for "TERM". Clicking on the "Term" icon will open a terminal window.
|
||||
|
||||
For other desktop environments such as XFCE, KDE, LXDE, Cinnamon and MATE you will find the terminal within the menu. Some distributions will have a terminal icon in a dock or as a launcher on a panel.
|
||||
|
||||
You can generally start an application from the terminal by simply entering the name of the program. For instance you can start Firefox by typing "firefox".
|
||||
|
||||
The benefit of running an application from the terminal is that you can include additional options.
|
||||
|
||||
For instance if you type the following a new Firefox browser window will open and the default search engine will be used to search for the term between quotes:
|
||||
|
||||
firefox -search "Linux.About.Com"
|
||||
|
||||
You will notice that if you run Firefox, the application will open and the control will be returned to the terminal which means you can continue working within the terminal.
|
||||
|
||||
Generally if you run an application from within the terminal, the application will open and you won't regain control of the terminal until the application is closed. This is because you opened the program in the foreground.
|
||||
|
||||
To be able to open a program in the Linux terminal and return control to the terminal you need to open the application as a background process,
|
||||
|
||||
In order to open a program as a background process simply add the ampersand (&) symbol to the command as shown below:
|
||||
|
||||
libreoffice &
|
||||
|
||||
An application might not run just by providing the program's name in the terminal. If the program doesn't reside in one of the folders set within the PATH variable then you will need to specify the whole path name in order to run the program.
|
||||
|
||||
/path/to/yourprogram &
|
||||
|
||||
If you aren't sure where a program resides within the Linux folder structure use the [find][2] or [locate][3] command to find the application.
|
||||
|
||||
The syntax for finding a file is as follows:
|
||||
|
||||
find /path/to/start/from -name programname
|
||||
|
||||
For instance if you wanted to find the location of Firefox use the following command:
|
||||
|
||||
find / -name firefox
|
||||
|
||||
The output will whizz past quite quickly and so you will want to pipe the output to either [less][4] or [more][5] as follows:
|
||||
|
||||
find / -name firefox | more
|
||||
|
||||
find / -name firefox | less
|
||||
|
||||
The find command will return a number of permission denied errors for folders that you don't have permissions to search.
|
||||
|
||||
You can alway provide the [sudo command to elevate your permissions][6]. If sudo isn't installed you will need to switch to a user that has permissions.
|
||||
|
||||
sudo find / -name firefox | more
|
||||
|
||||
If you know that the file you are looking for is within the folder structure in which you are currently located then you can replace the forward slash with a period as follows:
|
||||
|
||||
sudo find . -name firefox | more
|
||||
|
||||
You may or may not need the elevated permissions provided by sudo. If you are looking for something within your home folder structure then it won't be required.
|
||||
|
||||
Some applications require elevated permissions to run and you may get a lack of permissions error unless you use either a user with adequate permissions or elevate those permissions using sudo.
|
||||
|
||||
Here is a neat trick. If you run an application and it requires elevated permissions to run, type the following:
|
||||
|
||||
sudo !!
|
||||
|
||||
|
||||
via : http://linux.about.com/od/commands/fl/How-To-Run-Linux-Programs-From-The-Terminal-In-Background-Mode.htm
|
||||
|
||||
作者:[Gary Newell][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://linux.about.com/bio/Gary-Newell-132058.htm
|
||||
[1]:http://linux.about.com/od/howtos/fl/Learn-Ubuntu-The-Unity-Dash.htm
|
||||
[2]:http://linux.about.com/od/commands/l/blcmdl1_find.htm
|
||||
[3]:http://linux.about.com/od/commands/l/blcmdl1_locate.htm
|
||||
[4]:http://linux.about.com/library/cmd/blcmdl1_less.htm
|
||||
[5]:http://linux.about.com/library/cmd/blcmdl1_more.htm
|
||||
[6]:http://linux.about.com/od/commands/l/blcmdl8_sudo.htm
|
@ -0,0 +1,90 @@
|
||||
如何在终端使用后台运行模式启动一个Linux应用程序
|
||||
========================================================================
|
||||
|
||||

|
||||
|
||||
这是一个篇幅不长但是十分有用的教程,可以帮助你在终端启动一个Linux应用程序,并且使终端窗口不会丢失焦点。
|
||||
|
||||
我们有很多方法可以在Linux系统中打开一个终端窗口,这取决与你的选择以及你的桌面环境。
|
||||
|
||||
如果是使用Ubuntu的话,你可以利用CTRL+ALT+T组合键打开终端。当然你也可以使用超级键(Windows键)[打开Dash][1],搜索“TERM”,然后点击“Term”图标来打开终端窗口。
|
||||
|
||||
对于其他的桌面环境来说,例如XFCE、KDE、LXDE、Cinnamon以及MATE,你可以在菜单中找到终端。有些环境会在停靠栏或者面板上面包含终端图标。
|
||||
|
||||
通常情况下,你可以在终端里面直接输入应用程序名来启动一个应用程序。比如说,你可以通过输入“firefox”来启动Firefox。
|
||||
|
||||
在终端启动应用程序的好处是,你可以包含一些额外的参数。
|
||||
|
||||
例如,你可以通过下列命令来打开一个Firefox浏览窗口,然后利用默认的搜索引擎搜索相关信息:
|
||||
|
||||
firefox -search "linux.cn"
|
||||
|
||||
你可能会注意到,当你启动Firefox的时候,如果程序打开以后,焦点重新会到终端窗口的话,你就可以继续在终端进行工作。
|
||||
|
||||
通常情况下,如果你在终端启动了应用程序,焦点会切换到新启动的应用程序,只有程序被关闭以后焦点才会重新切换到终端。这是因为你在前台启动了这个程序。
|
||||
|
||||
如果要实现焦点仍然保持在终端窗口的目的,那么你需要将应用程序启动为后台进程。
|
||||
|
||||
向下面所列的命令一样,我们可以通过增加一个(&)符号,将应用程序在后台启动。
|
||||
|
||||
libreoffice &
|
||||
|
||||
>译者注:如果需要加参数的话,记得把&符号放在最后。
|
||||
|
||||
>译者注:一般情况下,关闭终端时,在这个终端启动的后台程序也会被终止,要使终端关闭以后,后台程序依然保持执行可以使用下列命令
|
||||
|
||||
> nohup command [arg...] &
|
||||
|
||||
如果应用程序目录没有安装在PATH变量包含的目录里面的话,我们就没有办法直接通过应用程序名来启动程序,必须输入应用程序的整个路径来启动它。
|
||||
|
||||
/path/to/yourprogram &
|
||||
|
||||
如果你不确定程序输入哪个Linux目录结构的话,可以使用[find][2]或者[location][3]命令来定位它。
|
||||
|
||||
可以输入下列符号来找到一个文件:
|
||||
|
||||
find /path/to/start/from -name programname
|
||||
|
||||
例如,你可以输入下列命令来找到Firefox:
|
||||
|
||||
find / -name firefox
|
||||
|
||||
命令运行的结果会嗖的一下输出一大堆,别担心,你也可以通过[less][4]或者[more][5]来进行分页查看。
|
||||
|
||||
find / -name firefox | more
|
||||
|
||||
find / -name firefox | less
|
||||
|
||||
当find命令查找到没有权限访问的文件夹时,会报出一条拒绝访问错误,
|
||||
|
||||
你可以通过[sudo命令来提示权限][6]。当然,如果你没有安装sudo的话,就只能切换到一个拥有权限的用户了。
|
||||
|
||||
sudo find / -name firefox | more
|
||||
|
||||
如果你知道你要查找的文件在你的当前目录及其子目录中,那么你可以使用点来代替斜杠:
|
||||
|
||||
sudo find . -name firefox | more
|
||||
|
||||
你可能需要sudo来提升权限,也可能根本就不需要,如果这个文件在你的跟目录里面,那么就不需要使用sudo。
|
||||
|
||||
有些应用程序则必须要提升权限才能运行,否则你就会得到一大堆拒绝访问错误,除非你使用一个具有权限的用户,或者使用sudo提升权限。
|
||||
|
||||
这里有个小窍门。如果你运行了一个程序,但是它报了权限错误以后,输入下面命令试试:
|
||||
|
||||
sudo !!
|
||||
|
||||
via : http://linux.about.com/od/commands/fl/How-To-Run-Linux-Programs-From-The-Terminal-In-Background-Mode.htm
|
||||
|
||||
作者:[Gary Newell][a]
|
||||
译者:[zhouj-sh](https://github.com/zhouj-sh)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://linux.about.com/bio/Gary-Newell-132058.htm
|
||||
[1]:http://linux.about.com/od/howtos/fl/Learn-Ubuntu-The-Unity-Dash.htm
|
||||
[2]:http://linux.about.com/od/commands/l/blcmdl1_find.htm
|
||||
[3]:http://linux.about.com/od/commands/l/blcmdl1_locate.htm
|
||||
[4]:http://linux.about.com/library/cmd/blcmdl1_less.htm
|
||||
[5]:http://linux.about.com/library/cmd/blcmdl1_more.htm
|
||||
[6]:http://linux.about.com/od/commands/l/blcmdl8_sudo.htm
|
Loading…
Reference in New Issue
Block a user