个人工具

“Lts0010”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
Xterm、 Gnome、Konsole之类都是什么?
 
(未显示4个用户的16个中间版本)
第5行: 第5行:
 
在大多数的linux计算机中,安装有个一个叫bash(bash是Bourne Again SHell的简写,这是有Steve Bourne编写的一个早期shell的升级版。),它充当shell的角色。通常在Linux计算机上有多种可用的shell,比如:ksh、tcsh、 zsh。
 
在大多数的linux计算机中,安装有个一个叫bash(bash是Bourne Again SHell的简写,这是有Steve Bourne编写的一个早期shell的升级版。),它充当shell的角色。通常在Linux计算机上有多种可用的shell,比如:ksh、tcsh、 zsh。
  
== Xterm、 GNOME终端、Konsole之类都是什么? ==
+
== Xterm、 Gnome-Terminal、Konsole之类都是什么? ==
  
These are called "terminal emulators." They are programs that put a window up and let you interact with the shell. There are a bunch of different terminal emulators you can use. Most Linux distributions supply several, such as: <code><nowiki>xterm</nowiki></code>, <code><nowiki>rxvt</nowiki></code>, <code><nowiki>konsole</nowiki></code>, <code><nowiki>kvt</nowiki></code>, <code><nowiki>gnome-terminal</nowiki></code>, <code><nowiki>nxterm</nowiki></code>, and <code><nowiki>eterm</nowiki></code>.
+
<br>这些都是所谓的“终端模拟器”,这是一些可以让您的计算机界面变得易于操作,并解可以帮助您和对话的程序。现在有很多的终端模拟器供我们使用。一般的Linux系统通常包含多种终端模拟器,就像:xterm、rxvt、konsole、kvt、gnome-terminal、nxterm、eterm.
  
== Starting a Terminal ==
+
== 启动终端  ==
Your window manager probably has a way to launch programs from a menu. Look through the list of programs to see if anything looks like a terminal emulator program. In KDE, you can find "konsole" and "terminal" on the Utilities menu. In Gnome, you can find "color xterm," "regular xterm," and "gnome-terminal" on the Utilities menu. You can start up as many of these as you want and play with them. While there are a number of different terminal emulators, they all do the same thing. They give you access to a shell session. You will probably develop a preference for one, based on the different bells and whistles each one provides.
+
  
== Testing the Keyboard ==
+
您的窗口管理器可以通过菜单来启动程序,查看程序清单,您也许会发现一个像终端模拟器的程序。 在 KDE中,在主菜单中,终端模拟器通常是 Konsole和Tterminal.而在 Gnome中,您发现的却是"color xterm"、 "regular xterm,"和 "gnome-terminal". 您可以随意的启动这些终端模拟器, 尝试不同模拟器。他们都可以给您一个访问shell的对话。 You will probably develop a preference for one, based on the different bells and whistles each one provides.
Ok, let's try some typing. Bring up a terminal window. You should see a shell prompt that contains your user name and the name of the machine followed by a dollar sign. Something like this:
+
  
<code><nowiki>[me@linuxbox me]$</nowiki></code>
+
==  测试键盘  ==
  
Excellent! Now type some nonsense characters and press the enter key.
 
  
<code><nowiki>[me@linuxbox me]$</nowiki></code> <code><nowiki>kdkjflajfks</nowiki></code>
 
  
If all went well, you should have gotten an error message complaining that it cannot understand you:
+
  让我们开始测试吧, 打开一个 terminal终端窗口,您会看到一个shell提示符,这个提示符包括您的用户名、机器名、$.就像下面这样:
 +
[usrname@machinename]$:
 +
  随便输入一些字符试试看。
 +
  
<code><nowiki>[me@linuxbox me]$</nowiki></code> <code><nowiki>kdkjflajfks</nowiki></code>
+
[usrname@machinename]$kdkjflajfks 如果一切顺利的话,您会看到系统返回的一些无法理解的错误提示:
  
<code><nowiki>bash: kdkjflajfks: command not found</nowiki></code>
+
[usrname@machinename]$: kdkjflajfks  
  
Wonderful! Now press the up-arrow key. Watch how our previous command "kdkjflajfks" returns. Yes, we have ''command history''. Press the down-arrow and we get the blank line again.
+
bash: kdkjflajfks: command not found
  
Recall the "kdkjflajfks" command using the up-arrow key if needed. Now, try the left and right-arrow keys. You can position the text cursor anywhere in the command line. This allows you to easily correct mistakes.
+
如果您安 键盘向上的箭头,您会惊奇的发现,我们以前输入的字符被保存了,并且有个一个历史记录。
  
== You're not logged in as root, are you? ==
+
如果我们需要,可以调用历史记录的命令,现在试试向右的箭头,您会发现光标在向右移动,通过这个操作我们可以轻易的修改错误。
Don't operate the computer as the superuser. You should only become the superuser when absolutely necessary. Doing otherwise is dangerous, stupid, and in poor taste. Create a user account for yourself now!
+
  
== Using the Mouse ==
+
== 您还没有用管理员的身份登录?  ==
Even though the shell is a command line interface, you can still use the mouse for several things. That is, if you have a 3-button mouse; and you should have a 3-button mouse if you want to use Linux.
+
  
First, you can use the mouse to scroll backwards and forwards through the output of the terminal window. To demonstrate, hold down the enter key until it scrolls off the window. Now, with your mouse, you can use the scroll bar at the side of the terminal window to move the window contents up and down. If you are using <code><nowiki>xterm</nowiki></code>, you may find this difficult, since the middle button is required for this operation. If you have a 2-button mouse, it may have been configured to emulate a 3-button mouse. This means the middle button can be simulated by pressing down both the left and right buttons at the same time.
+
不要用管理员的账号操作计算机,除非您确实需要时才使用.如果不是这样做的话,往往是非常危险的,现在就去创建一个非管理员帐号吧。
  
Next, you can copy text with the mouse. Drag your mouse over some text (for example, "kdkjflajfks" right here on the browser window) while holding down the left button. The text should highlight. Now move your mouse pointer to the terminal window and press the middle mouse button. The text you highlighted in the browser window should be copied into the command line. Did I mention that you will need a 3-button mouse?
+
== 使用鼠标==
 +
即使shell使用的是命令行界面,你依然可以使用鼠标做一些事情。对了,前提是你得有一个三键鼠标,而且使用Linux你应该有一个三键鼠标。
  
== A few words about focus... ==
+
首先,你可以使用鼠标向前和向后滚动终端的输出窗口。为了证实这一点,请按住回车键直至滚动了整个窗口,然后你可以用你的鼠标拖动终端窗口边上的滚动条来显示上下文。如果你使用的是 <code><nowiki>xterm</nowiki></code>的话,你可能会发现不同之处,因为鼠标中键可以实现这个操作。如果你使用的是两键鼠标,你可以通过设置实现对三键鼠标的模拟。也就是说,你可以同时按住左右键达到按下中键的效果。
When you installed your Linux system and its window manager (most likely Gnome or KDE), it was configured to behave in some ways like that legacy operating system.
+
  
In particular, it probably has its ''focus policy'' set to "click to focus." This means that in order for a window to gain focus (become active) you have to click in the window. This is contrary to traditional X windows behavior. If you take my advice and get a 3-button mouse, you will want to set the focus policy to "focus follows mouse". This will make using the text copying feature of X windows much easier to use. You may find it strange at first that windows don't raise to the front when they get focus (you have to click on the title bar to do that), but you will enjoy being able to work on more than one window at once without having the active window obscuring the the other. Try it and give it a fair trial; I think you will like it. You can find this setting in the configuration tools for your window manager.
+
然后,你可以用鼠标拷贝文字。按住鼠标左键不放拖动一些文字(例如,在当前窗口的"kdkjflajfks"),这些文字应该可以高亮显示。然后把鼠标移动到终端窗口中,按下鼠标中键。那些在浏览器窗口中高亮显示的文字就被复制到了命令行中。知道我为什么说你需要三键鼠标了吧?
 +
 
 +
(译者注:这是我第一次在wiki上编辑,翻译的不好的地方,还请大家指正,管理员看到可以删除此注)
 +
 
 +
[[Category:入门]]

2010年7月10日 (六) 11:53的最新版本

什么是Shell?

简单的说, shell就是一个小程序,这个小程序可以接受来自键盘的命令并把这些命令发送到操作系统,再有系统来执行。在过去,在安装有Unix的计算机上,这是唯一的可用的交互式操作。而如今,我们可以通过图形化界面来输入命令行,比如shell.

在大多数的linux计算机中,安装有个一个叫bash(bash是Bourne Again SHell的简写,这是有Steve Bourne编写的一个早期shell的升级版。),它充当shell的角色。通常在Linux计算机上有多种可用的shell,比如:ksh、tcsh、 zsh。

Xterm、 Gnome-Terminal、Konsole之类都是什么?


这些都是所谓的“终端模拟器”,这是一些可以让您的计算机界面变得易于操作,并解可以帮助您和对话的程序。现在有很多的终端模拟器供我们使用。一般的Linux系统通常包含多种终端模拟器,就像:xterm、rxvt、konsole、kvt、gnome-terminal、nxterm、eterm.

启动终端

您的窗口管理器可以通过菜单来启动程序,查看程序清单,您也许会发现一个像终端模拟器的程序。 在 KDE中,在主菜单中,终端模拟器通常是 Konsole和Tterminal.而在 Gnome中,您发现的却是"color xterm"、 "regular xterm,"和 "gnome-terminal". 您可以随意的启动这些终端模拟器, 尝试不同模拟器。他们都可以给您一个访问shell的对话。 You will probably develop a preference for one, based on the different bells and whistles each one provides.

测试键盘

 让我们开始测试吧, 打开一个 terminal终端窗口,您会看到一个shell提示符,这个提示符包括您的用户名、机器名、$.就像下面这样: 
[usrname@machinename]$:
 随便输入一些字符试试看。 

[usrname@machinename]$: kdkjflajfks 如果一切顺利的话,您会看到系统返回的一些无法理解的错误提示:

[usrname@machinename]$: kdkjflajfks

bash: kdkjflajfks: command not found

如果您安 键盘向上的箭头,您会惊奇的发现,我们以前输入的字符被保存了,并且有个一个历史记录。

如果我们需要,可以调用历史记录的命令,现在试试向右的箭头,您会发现光标在向右移动,通过这个操作我们可以轻易的修改错误。

您还没有用管理员的身份登录?

不要用管理员的账号操作计算机,除非您确实需要时才使用.如果不是这样做的话,往往是非常危险的,现在就去创建一个非管理员帐号吧。

使用鼠标

即使shell使用的是命令行界面,你依然可以使用鼠标做一些事情。对了,前提是你得有一个三键鼠标,而且使用Linux你应该有一个三键鼠标。

首先,你可以使用鼠标向前和向后滚动终端的输出窗口。为了证实这一点,请按住回车键直至滚动了整个窗口,然后你可以用你的鼠标拖动终端窗口边上的滚动条来显示上下文。如果你使用的是 xterm的话,你可能会发现不同之处,因为鼠标中键可以实现这个操作。如果你使用的是两键鼠标,你可以通过设置实现对三键鼠标的模拟。也就是说,你可以同时按住左右键达到按下中键的效果。

然后,你可以用鼠标拷贝文字。按住鼠标左键不放拖动一些文字(例如,在当前窗口的"kdkjflajfks"),这些文字应该可以高亮显示。然后把鼠标移动到终端窗口中,按下鼠标中键。那些在浏览器窗口中高亮显示的文字就被复制到了命令行中。知道我为什么说你需要三键鼠标了吧?

(译者注:这是我第一次在wiki上编辑,翻译的不好的地方,还请大家指正,管理员看到可以删除此注)