什么是终端,如何打开和使用它?

kei*_*ant 81 command-line

  • 什么是终端?
  • 如何打开终端窗口?
  • 如何使用终端?

Cas*_*Cas 73

它是什么:

终端是一个界面,您可以在其中键入和执行基于文本的命令。

终端截图


为什么使用它:

使用终端完成某些任务比使用图形应用程序和菜单要快得多。另一个好处是允许访问更多的命令和脚本。

与通过软件中心或 Synaptic 管理器导航相比,安装应用程序的常见终端任务可以在单个命令中完成。

例如,以下将安装 Deluge bittorrent 客户端:

sudo apt-get install deluge
Run Code Online (Sandbox Code Playgroud)

要将当前目录树中文件的详细列表保存到名为 的文件中listing.txt

find -type f > listing.txt
Run Code Online (Sandbox Code Playgroud)

有时您还会看到以下符号:

$ whoami
calum
$ ls
Downloads  Documents
Run Code Online (Sandbox Code Playgroud)

这意味着将whoami执行calum作为输出的命令。在该命令之后,ls执行输出Downloads Documents.

类似的符号是:

# apt-get update
Run Code Online (Sandbox Code Playgroud)

这意味着该命令应该以 root 身份运行,即使用sudo

$ sudo apt-get update
Run Code Online (Sandbox Code Playgroud)

请注意,该#字符也用于注释

# this command will give your username
whoami
# the next command will show the contents of the current directory
ls
Run Code Online (Sandbox Code Playgroud)

如何打开终端:

  • 打开Dash(超级键)或 应用程序并输入terminal

    在此处输入图片说明

  • Ctrl+ Alt+使用键盘快捷键T

  • 对于旧版本或 Ubuntu 版本:(更多信息)

    应用 → 配件 → 终端


终端的替代名称:

  • 安慰
  • 贝壳
  • 命令行
  • 命令提示符

(虽然从技术上讲它们的意思不同


常用命令和更多信息

  • **懒人提示:** 您可以使用 [拖放](http://en.wikipedia.org/wiki/Drag_and_drop) 将文件和文件夹从文件管理器拖放到终端中,这将为您提供完整的路径对文件应用命令。这是两全其美的。 (3认同)

Mar*_*ing 6

终端是您通过 shell(通常是 bash)与底层操作系统的接口。它是一个命令行。

过去,终端是连接到服务器的屏幕+键盘。今天,它通常只是一个程序。

您可以通过应用程序菜单的实用程序部分打开它,或按Alt+F2并键入gnome-terminal