2010-07-08 22:03:41 +04:00
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
< html xmlns = "http://www.w3.org/1999/xhtml" lang = "en-US" xml:lang = "en-US" >
< head >
<!--
*
2010-11-22 22:42:54 +03:00
* Copyright 2008-2010, Haiku. All rights reserved.
2010-07-08 22:03:41 +04:00
* Distributed under the terms of the MIT License.
*
* Authors:
* Humdinger < humdingerb @ gmail . com >
2010-08-02 20:51:09 +04:00
* Translators:
* Pengphei Han
2010-07-08 22:03:41 +04:00
*
-->
< meta http-equiv = "content-type" content = "text/html; charset=utf-8" / >
< meta http-equiv = "Content-Style-Type" content = "text/css" / >
< meta name = "robots" content = "all" / >
2010-08-02 20:51:09 +04:00
< title > 终端< / title >
2010-07-08 22:03:41 +04:00
< link rel = "stylesheet" type = "text/css" href = "../../Haiku-doc.css" / >
< / head >
< body >
< div id = "banner" >
2010-08-02 20:51:09 +04:00
< div > < span > 用户指南< / span > < / div >
2010-07-08 22:03:41 +04:00
< / div >
< div class = "nav" >
< div class = "inner" >
< ul class = "lang-menu" >
< li class = "now" > < img src = "../../images/flags/zh_CN.png" alt = "" / > 中文 [中文]< / li >
< li > < a href = "../../fr/applications/terminal.html" > < img src = "../../images/flags/fr.png" alt = "" / > Français< / a > < / li >
< li > < a href = "../../de/applications/terminal.html" > < img src = "../../images/flags/de.png" alt = "" / > Deutsch< / a > < / li >
< li > < a href = "../../it/applications/terminal.html" > < img src = "../../images/flags/it.png" alt = "" / > Italiano< / a > < / li >
< li > < a href = "../../ru/applications/terminal.html" > < img src = "../../images/flags/ru.png" alt = "" / > Русский< / a > < / li >
< li > < a href = "../../es/applications/terminal.html" > < img src = "../../images/flags/es.png" alt = "" / > Español< / a > < / li >
< li > < a href = "../../sv_SE/applications/terminal.html" > < img src = "../../images/flags/sv_SE.png" alt = "" / > Svensk< / a > < / li >
< li > < a href = "../../jp/applications/terminal.html" > < img src = "../../images/flags/jp.png" alt = "" / > 日本語< / a > < / li >
< li > < a href = "../../uk/applications/terminal.html" > < img src = "../../images/flags/uk.png" alt = "" / > Українська< / a > < / li >
< li > < a href = "../../pt_PT/applications/terminal.html" > < img src = "../../images/flags/pt_PT.png" alt = "" / > Português< / a > < / li >
< li > < a href = "../../en/applications/terminal.html" > < img src = "../../images/flags/gb.png" alt = "" / > English< / a > < / li >
< / ul >
< span >
2010-08-02 20:51:09 +04:00
« < a href = "stylededit.html" > 文本编辑器< / a >
2010-07-08 22:03:41 +04:00
:: < a href = "../applications.html#list-of-apps" class = "uplink" > 应用程序< / a >
2010-08-02 20:51:09 +04:00
:: < a href = "textsearch.html" > 文本搜索< / a > »
2010-07-08 22:03:41 +04:00
< / span > < / div >
< / div >
< div id = "content" >
< div >
2010-11-22 22:42:54 +03:00
< div class = "box-info" > 本节的翻译还未完成。在未完成之前,所有的未完成部分都将使用英语原文。< / div >
2010-07-08 22:03:41 +04:00
2010-08-02 20:51:09 +04:00
< h2 > < img src = "../../images/apps-images/terminal-icon_64.png" alt = "terminal-icon_64.png" width = "64" height = "64" / > 终端< / h2 >
2010-07-08 22:03:41 +04:00
< table summary = "layout" border = "0" cellspacing = "0" cellpadding = "2" >
2010-08-02 20:51:09 +04:00
< tr > < td > 桌面栏:< / td > < td style = "width:15px;" > < / td > < td > < span class = "menu" > 应用程序< / span > < / td > < / tr >
2010-07-08 22:03:41 +04:00
< tr > < td > 位置:< / td > < td > < / td > < td > < span class = "path" > /boot/system/apps/Terminal< / span > < / td > < / tr >
< tr > < td > 设置:
< / td > < td > < / td > < td > < span class = "path" > ~/config/settings/Terminal< / span > < br / >
2010-08-02 20:51:09 +04:00
< span class = "path" > ~/.profile< / span > - 添加或者覆盖默认的 < span class = "path" > /boot/system/etc/profile< / span > < br / >
< span class = "path" > ~/.inputrc< / span > - 添加或者覆盖默认的 < span class = "path" > /boot/system/etc/inputrc< / span > < / td > < / tr >
2010-07-08 22:03:41 +04:00
< / table >
< p > < br / > < / p >
2010-08-02 20:51:09 +04:00
< p > 终端是Haiku中具有用户界面的bash, 即 Bourne Again Shell。< / p >
< p > 请参考 < a href = "../bash-scripting.html" > 脚本< / a > 这一主题获取有关Shell的在线教程, 同时也可以阅读< a href = "cli-apps.html" > Haiku的命令行程序< / a > 。在本文中,我们重点关注终端本身的使用。< / p >
2010-07-08 22:03:41 +04:00
2010-11-22 22:42:54 +03:00
< h2 >
2010-07-08 22:03:41 +04:00
< a href = "#" > < img src = "../../images/up.png" style = "border:none;float:right" alt = "index" / > < / a >
2010-11-22 22:42:54 +03:00
< a id = "windows-tabs" name = "windows-tabs" > Windows and tabs< / a > < / h2 >
2010-08-02 20:51:09 +04:00
< p > 您可以根据需要打开任意数量的终端,可以简单的启动,或者从正在运行的终端中使用 < span class = "key" > ALT< / span > < span class = "key" > N< / span > 组合键来打开多个终端窗口。您也可以使用终端的标签视图方式,使用 < span class = "key" > ALT< / span > < span class = "key" > T< / span > 组合键打开新的终端标签。< / p >
2010-11-22 22:42:54 +03:00
< img src = "../images/apps-images/terminal.png" alt = "terminal.png" / >
< br / >
< p > Double-clicking into the emtpy part of the tab bar opens a new tab; onto a tab opens a dialog to rename its title. There are several %-designated variables that are explained with a tooltip when you hover the mouse over the text field.< br / >
By default, < tt > %1d: %p< / tt > , a tab shows the current directory and, separated by a < tt > :< / tt > , the name of the currently running process (or < tt > --< / tt > if it's just bash running, probably idling). The screenshot above shows the first tab with a FTP session in the < span class = "path" > Desktop< / span > folder and a second tab idling at < span class = "path" > home< / span > .< br / >
Via < span class = "menu" > Edit|Window title...< / span > the Terminal window's title can be edited in a similar way.< / p >
< p > Right-clicking a tab shows a context menu to < span class = "menu" > Close tab< / span > , < span class = "menu" > Close other tabs< / span > or, like double-clicking, < span class = "menu" > Edit tab title...< / span > .< / p >
2010-08-02 20:51:09 +04:00
< p > 终端的窗口和其他窗口一样可以调整尺寸,或者使用 < span class = "menu" > Settings | Window Size< / span > 菜单中的预置尺寸。 < span class = "key" > ALT< / span > < span class = "key" > ENTER< / span > 组合键将会切换到全屏模式。< / p >
< p > 调整的窗口尺寸和文字编码只有通过 < span class = "menu" > Settings | Save as default< / span > 才可以进行保持不变。< / p >
2010-11-22 22:42:54 +03:00
< h2 > < a href = "#" > < img src = "../../images/up.png" style = "border:none;float:right" alt = "index" / > < / a >
< a id = "settings" name = "settings" > Settings< / a > < / h2 >
< p > < span class = "menu" > Settings | Settings...< / span > opens a panel to configure the standard settings of a Terminal.< / p >
< img src = "../images/apps-images/terminal-settings.png" alt = "terminal-settings.png" / >
2010-07-08 22:03:41 +04:00
< br / >
2010-11-22 22:42:54 +03:00
< p > It starts off with the "formulas" for naming tab and window titles. Again, tooltips show the available variables. Below that you set font type, font size and the different text and background colors. You can choose a pre-defined color schema like < span class = "menu" > Black on white< / span > or < span class = "menu" > White on black< / span > or create a < span class = "menu" > Custom< / span > one using the color picker below.< br / >
Activate the checkbox to < span class = "menu" > Confirm exit if active programs exist< / span > and you'll be warned when trying to close a Terminal window while an app is still being executed.< br / >
You can save different settings as separate profiles, which on double-click open an accordingly configured Terminal.< br / >
Pressing < span class = "button" > OK< / span > will save the current settings as default.< / p >
< h2 >
< a href = "#" > < img src = "../../images/up.png" style = "border:none;float:right" alt = "index" / > < / a >
< a id = "shortcuts" name = "shortcuts" > 快捷键< / a > < / h2 >
< p > 您可以在 < a href = "../keyboard-shortcuts.html#terminal" > 快捷键和组合键< / a > 主题中找到非常有用的快捷键的列表。< / p >
2010-07-08 22:03:41 +04:00
2010-11-22 22:42:54 +03:00
< h2 >
2010-07-08 22:03:41 +04:00
< a href = "#" > < img src = "../../images/up.png" style = "border:none;float:right" alt = "index" / > < / a >
2010-11-22 22:42:54 +03:00
< a id = "customization" name = "customization" > Bash的定制< / a > < / h2 >
2010-08-02 20:51:09 +04:00
< p > 由于bash来自于Unix, 它具有无数的可定制的方式。对于用户, 有两个文件至关重要: < span class = "cli" > .profile< / span > 和 < span class = "cli" > .inputrc< / span > 。
< br / >
这两个文件可以在 < span class = "path" > home/< / span > 文件夹中予以创建, 然后将会添加到或者覆盖系统默认在 < span class = "path" > /boot/system/etc/< / span > 中定义的配置文件。< / p >
2010-07-08 22:03:41 +04:00
2010-11-22 22:42:54 +03:00
< h3 > .profile< / h3 >
2010-08-02 20:51:09 +04:00
< p > 在您每次打开新的终端时, < span class = "cli" > .profile< / span > 都会被载入程序。在该文件中, 设置了所有影响到bash行为和外观的各种类型的设备接口和变量。你可以在网络上找到许多资源, 它们将会给出所有可能性的详细介绍。< / p >
< p > Haiku/BeOS Tip Server提供了许多入门的技巧, 例如: < / p >
2010-07-08 22:03:41 +04:00
< ul >
2010-08-02 20:51:09 +04:00
< li > < a href = "http://betips.net/1997/09/09/customize-your-terminal-prompt/" > 定制终端的提示信息< / a > < / li >
< li > < a href = "http://betips.net/1997/09/09/more-prompt-customizations/" > 更多提示信息的定制< / a > < / li >
< li > < a href = "http://betips.net/1997/09/09/enhancing-bash/" > bash的优化和增强< / a > < / li >
< li > < a href = "http://betips.net/1997/09/09/custom-keyboard-shortcuts/" > 定制快捷键< / a > < / li >
2010-07-08 22:03:41 +04:00
< / ul >
2010-08-02 20:51:09 +04:00
< p > 还有很多类似的信息,< a href = "http://betips.net/index.php?s=.profile" > 请参阅< / a > 。< / p >
2010-07-08 22:03:41 +04:00
2010-11-22 22:42:54 +03:00
< h3 > .inputrc< / h3 >
2010-08-02 20:51:09 +04:00
< p > < span class = "cli" > .inputrc< / span > 用于处理键盘关联的配置。由于Haiku默认提供了非常有用的配置, 您不需要修改相关的设置。如果您确实有特殊的需要, 可以参考许多在线的资源, 例如< a href = "http://tiswww.case.edu/php/chet/readline/rluserman.html" > GNU 的命令行读取库< / a > 。< / p >
2010-07-08 22:03:41 +04:00
2010-11-22 22:42:54 +03:00
< h2 >
2010-07-08 22:03:41 +04:00
< a href = "#" > < img src = "../../images/up.png" style = "border:none;float:right" alt = "index" / > < / a >
2010-11-22 22:42:54 +03:00
< a id = "hints" name = "hints" > 关于终端的提醒< / a > < / h2 >
2010-08-02 20:51:09 +04:00
< ul > < li > < p > 从Tracker窗口中拖拽文件或者文件夹到终端将会在光标的位置插入它的路径。而使用右键拖拽将会弹出一个右键菜单, 显示附加的操作: < / p >
2010-07-08 22:03:41 +04:00
< table summary = "layout" border = "0" cellpadding = "2" cellspacing = "0" >
2010-08-02 20:51:09 +04:00
< tr > < td > < span class = "menu" > Insert Path< / span > < / td > < td > < / td > < td > 插入一个文件的路径,与左键拖拽文件到终端类似。< / td > < / tr >
< tr > < td > < span class = "menu" > Change Directory< / span > < / td > < td > < / td > < td > 切换到所拖拽文件所在的文件夹。< / td > < / tr >
< tr > < td > < span class = "menu" > Create Link Here< / span > < / td > < td > < / td > < td > 在终端当前工作的目录为拖拽的文件创建链接。< / td > < / tr >
< tr > < td > < span class = "menu" > Move Here< / span > < / td > < td > < / td > < td > 移动拖拽的文件到终端当前工作的目录。< / td > < / tr >
< tr > < td > < span class = "menu" > Copy Here< / span > < / td > < td > < / td > < td > 复制拖拽的文件到终端当期工作的目录。< / td > < / tr >
2010-07-08 22:03:41 +04:00
< / table > < / li >
2010-08-02 20:51:09 +04:00
< li > < p > 您可以使用< span class = "cli" > open < i > [filename]< / i > < / span > 命令以首选程序打开任何的文件。该命令也作用于当前文件夹("< span class = "cli" > .< / span > ")和父文件夹("< span class = "cli" > ..< / span > ") , 它们分别以Tracker窗口打开。所以, 如果希望打开当前工作的目录, 您可以输入: < / p >
2010-07-08 22:03:41 +04:00
< pre class = "terminal" > open .< / pre >
< / li > < / ul >
< / div >
< / div >
< div class = "nav" >
< div class = "inner" > < span >
2010-08-02 20:51:09 +04:00
« < a href = "stylededit.html" > 文本编辑器< / a >
2010-07-08 22:03:41 +04:00
:: < a href = "../applications.html#list-of-apps" class = "uplink" > 应用程序< / a >
2010-08-02 20:51:09 +04:00
:: < a href = "textsearch.html" > 文本搜索< / a > »
2010-07-08 22:03:41 +04:00
< / span > < / div >
< / div >
< / body >
< / html >