linux命令⾏界⾯_Linux中的命令⾏界⾯
linux命令⾏界⾯
Graphical User Interface (GUI) to control your
If you are like most people, you are probably most familiar with using a Graphical User Interface (GUI)
computer. Introduced to the masses by Apple on the Macintosh computer and popularized by Microsoft, a GUI provides an easy, discoverable way to manage your system. Without a GUI, some tools for graphics and video would not be practical.
图形⽤户界⾯(GUI)来控制计算机。 GUI在Macintosh计算机上由Apple引⼊并由Microsoft⼴泛如果您像⼤多数⼈⼀样,可能最熟悉使⽤图形⽤户界⾯(GUI)
使⽤,GUI提供了⼀种易于发现的管理系统的⽅法。 没有GUI,某些⽤于图形和视频的⼯具将不实⽤。
Command Line Interface (CLI) was the preferred way to control a computer. The Prior to the popularity of the GUI, the Command Line Interface (CLI)
CLI relies solely on keyboard input. Everything you want the computer to do is relayed by typing commands rather than
CLI
clicking on icons.
CLI仅依靠键盘输⼊。 您希望计算机执⾏的所有操作都通过键⼊命令(⽽不命令⾏界⾯(CLI)是控制计算机的⾸选⽅法。 CLI
在GUI流⾏之前, 命令⾏界⾯(CLI)
是单击图标)进⾏中继。
CLI, it is very tedious to memorizing commands and their options, but with time you can master it.
If you are new to a CLI
CLI provides more precise control, greater speed and the ability to easily automate tasks through scripting (see However, a CLI
sidebar). Although Linux does have many GUI environments, there can be things which are not possible with GUI but with CLI
CLI everything is possible ( except graphical tools *wink*).
CLI ,则记住命令及其选项⾮常繁琐,但是随着时间的流逝您就可以掌握它。 但是, CLI
CLI提供了更精确的控制,更快的速度如果您不熟悉CLI
CLI可以实现所以及通过脚本轻松⾃动化任务的能⼒(请参见侧栏)。 尽管Linux确实有很多GUI环境,但有些地⽅是GUI不可能实现的,但是CLI
有功能(图形⼯具* wink *除外)。
命令⾏界⾯(CLI) (Command Line Interface (CLI))
Command Line Interface (CLI), is a text-based interface to the computer, where the user types in a command and The Command Line Interface (CLI)
CLI environment is provided by an application on the computer known as a terminal.
the computer then executes it. The CLI
CLI环境由称为终端的计算机上的应⽤程命令⾏界⾯(CLI)
命令⾏界⾯(CLI)是计算机的基于⽂本的界⾯,⽤户在其中键⼊命令,然后计算机将执⾏该命令。 CLI
序提供。
The terminal accepts what the user types and passes to a shell. The shell interprets what the user has typed into
instructions that can be executed by the operating system. If the output is produced by the command, then this text is displayed in the terminal. If problems with the command are encountered, then an error message is displayed.
终端接受⽤户输⼊的内容并传递给外壳。 该外壳程序将⽤户键⼊的内容解释为可由操作系统执⾏的指令。 如果输出是由命令产⽣的,那么此⽂本将显⽰在终端中。 如果遇到命令问题,则会显⽰错误消息。
访问终端 (Accessing a Terminal)
There are many ways to access a terminal window. Some systems will boot directly to a terminal. This is often the case with servers, as a Graphical User Interface (GUI) can be resource intensive and may not be needed to perform server-based operations.
有很多⽅法可以访问终端窗⼝。 某些系统将直接引导到终端。 服务器通常是这种情况,因为图形⽤户界⾯(GUI)可能会占⽤⼤量资源,并且可能不需要执⾏基于服务器的操作。
A good example of a server that doesn't necessarily require a GUI is a web server. Web servers need to be as fast as possible and a GUI would just slow the system down.
Web服务器是不⼀定需要GUI的服务器的⼀个很好的例⼦。 Web服务器需要尽可能快,⽽GUI只会降低系统速度。
On systems that boot to a GUI, comes with two ways to access a terminal, a GUI-based terminal, and a virtual terminal:
在引导⾄GUI的系统上,提供了两种访问终端的⽅法:基于GUI的终端和虚拟终端:
linux登录命令1) A GUI terminal is a program within the GUI environment that emulates a terminal window. GUI terminals can be accessed 1)
menu bar, then through the menu system. For example, on a CentOS machine, you could click on Applications on the menu bar
Terminal:
System Tools → and, finally, Terminal
System Tools
菜单栏上的应⽤1) GUI终端是GUI环境中模拟终端窗⼝的程序。 可以通过菜单系统访问GUI终端。 例如,在CentOS机器上,您可以单击菜单栏
1)
系统⼯具 →,最后单击终端
终端 :
程序,然后单击系统⼯具
2) A virtual terminal can be run at the same time as a GUI but requires the user to log in via the virtual terminal before they 2)
can execute commands (as they would before accessing the GUI interface). Most systems have multiple virtual terminals
CTRL+ALT+F1.
that can be accessed by pressing a combination of keys, for example, CTRL+ALT+F1
2)虚拟终端可以与GUI同时运⾏,但是要求⽤户通过虚拟终端登录才能执⾏命令(就像访问GUI界⾯之前⼀样)。 ⼤多数系统具有多个虚拟终2)
CTRL + ALT + F1 。
端,可以通过按组合键来访问这些终端,例如CTRL + ALT + F1
提⽰ (Prompt)
A terminal window displays a prompt; the prompt appears when no commands are being run and wh
en all command output has been printed to the screen. The prompt is designed to tell the user to enter a command.
终端窗⼝显⽰提⽰; 当没有命令正在运⾏并且所有命令输出都已打印到屏幕上时,将出现提⽰。 该提⽰旨在告诉⽤户输⼊命令。
The structure of the prompt may vary between distributions, but will typically contain information about the user and the system. Below is a common prompt structure:
提⽰的结构在各个发⾏版之间可能会有所不同,但通常会包含有关⽤户和系统的信息。 下⾯是⼀个常见的提⽰结构:
The previous prompt provides the name of the user that is logged in (sysadmin), the name of the system (localhost) and the current directory (~). The ~ symbol is used as shorthand for the user's home directory (typically the home directory for the user is under the /homedirectory and named after the user account name, for example: /home/sysadmin).
上⼀个提⽰提供了登录⽤户的名称( sysadmin ),系统名称( localhost )和当前⽬录( 〜 )。 该符号〜⽤
作简写为⽤户的主⽬录(通常是⽤户的主⽬录是/ home⽬录下和⽤户帐户名称命名,例如:/家庭/系统管理员 )。
贝壳 (Shell)
A shell
shell is an interpreter that translates commands entered by a user into actions to be performed by the operating system.
BASH shell. Shell provides many advanced features, The most commonly used shell for Linux distributions is called the BASH shell
such as command history, which can be re-execute previously executed commands.
BASH外壳 。 Shell提供了许多⾼Shell是解释器,可将⽤户输⼊的命令转换为操作系统要执⾏的操作。 Linux发⾏版中最常⽤的外壳称为BASH外壳
Shell
级功能,例如命令历史记录,可以重新执⾏以前执⾏的命令。
The BASH shell also has other popular features:
BASH shell还具有其他受欢迎的功能:
Scripting:
脚本编写:
The ability to place commands in a file and execute the file, resulting in all of the commands being executed. This feature also has some programming features, such as conditional statements and the ability to create functions (AKA, subroutines).
将命令放置在⽂件中并执⾏⽂件的能⼒,导致所有命令都被执⾏。 此功能还具有⼀些编程功能,例如条件语句和创建函数(AKA,⼦例程)的能⼒。
Aliases:
别名:
The ability to create short "nicknames" for longer commands.
为较长的命令创建简短的“昵称”的功能。
Variables:
变量:
Variables are used to store information for the BASH shell. These variables can be used to modify commands and features.
变量⽤于存储BASH Shell的信息。 这些变量可⽤于修改命令和功能。
linux命令⾏界⾯

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。