linux命令行界面_Linux中的命令行界面

linux命令行界面

If you are like most people, you are probably most familiar with using a Graphical User Interface (GUI) to control your 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,某些用于图形和视频的工具将不实用。

Prior to the popularity of the GUI, the Command Line Interface (CLI) was the preferred way to control a computer. The CLI relies solely on keyboard input. Everything you want the computer to do is relayed by typing commands rather than clicking on icons.

在GUI流行之前, 命令行界面(CLI)是控制计算机的首选方法。 CLI仅依靠键盘输入。 您希望计算机执行的所有操作都通过键入命令(而不是单击图标)进行中继。

If you are new to a CLI, it is very tedious to memorizing commands and their options, but with time you can master it. However, a CLI provides more precise control, greater speed and the ability to easily automate tasks through scripting (see sidebar). Although Linux does have many GUI environments, there can be things which are not possible with GUI but with CLI everything is possible ( except graphical tools *wink*).

如果您不熟悉CLI ,则记住命令及其选项非常繁琐,但是随着时间的流逝您就可以掌握它。 但是, CLI提供了更精确的控制,更快的速度以及通过脚本轻松自动化任务的能力(请参见侧栏)。 尽管Linux确实有很多GUI环境,但有些地方是GUI不可能实现的,但是CLI可以实现所有功能(图形工具* wink *除外)。

命令行界面(CLI) (Command Line Interface (CLI))

The Command Line Interface (CLI), is a text-based interface to the computer, where the user types in a command and the computer then executes it. The CLI environment is provided by an application on the computer known as a terminal.

命令行界面(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的终端和虚拟终端:

1) A GUI terminal is a program within the GUI environment that emulates a terminal window. GUI terminals can be accessed through the menu system. For example, on a CentOS machine, you could click on Applications on the menu bar, then System Tools → and, finally, Terminal:

1) GUI终端是GUI环境中模拟终端窗口的程序。 可以通过菜单系统访问GUI终端。 例如,在CentOS机器上,您可以单击菜单栏上的应用程序,然后单击系统工具 →,最后单击终端

CLI Terminal


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 can execute commands (as they would before accessing the GUI interface). Most systems have multiple virtual terminals that can be accessed by pressing a combination of keys, for example, CTRL+ALT+F1.

2)虚拟终端可以与GUI同时运行,但是要求用户通过虚拟终端登录才能执行命令(就像访问GUI界面之前一样)。 大多数系统具有多个虚拟终端,可以通过按组合键来访问这些终端,例如CTRL + ALT + F1

提示 (Prompt)

A terminal window displays a prompt; the prompt appears when no commands are being run and when 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:

提示的结构在各个发行版之间可能会有所不同,但通常会包含有关用户和系统的信息。 下面是一个常见的提示结构:

CLI - prompt


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 is an interpreter that translates commands entered by a user into actions to be performed by the operating system. The most commonly used shell for Linux distributions is called the BASH shell. Shell provides many advanced features, such as command history, which can be re-execute previously executed commands.

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的信息。 这些变量可用于修改命令和功能。

翻译自: https://www.includehelp.com/linux/command-line-interface.aspx

linux命令行界面

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/377547.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

一道小小面试题的细节分析

一道小小面试题的细节分析 今天突然想到以前遇到的一个问题,题目如下(可能绝大多数人都遇到过): 1 class A2 {3 public A()4 {5 PrintFields();6 }7 public virtual void Pr…

十四、OPTIM

一、torch.optim torch.optim.Optimizer(params, defaults)优化器官网说明 由官网给的使用说明打开看出来优化器实验步骤: ①构造选择优化器 例如采用随机梯度下降优化器SGD torch.optim.SGD(beyond.parameters(),lr0.01),放入beyond模型的参数param…

Windows下运行jekyll,编码已不再是问题

很久没更新jekyll了,所以好奇着去官网看了下更新记录,发现如下更新条目(版本1.3.0/2013-11-04发布): Add encoding configuration option (#1449)之前在windows下安装jekyll运行编写的代码时,如果有中文&am…

leetcode 滑动窗口小结 (二)

目录424. 替换后的最长重复字符思考分析1优化1004. 最大连续1的个数 III友情提醒方法1,基于当前最大频数方法2,基于历史最大频数424. 替换后的最长重复字符 https://leetcode-cn.com/problems/longest-repeating-character-replacement/ 给你一个仅由大…

软件故障_一些主要的软件故障

软件故障The need for software engineering was realized by the software industry after some of its major failures. Some of these failures are listed below, 在经历了一些重大失败之后,软件行业意识到了对软件工程的需求 。 下面列出了其中一些故障&#x…

十五、修改VGG16网络来适应自己的需求

一、VGG-16 VGG-16神经网络是所训练的数据集为ImageNet ImageNet数据集中验证集和测试集一万五千张,有一千个类别 二、加载VGG-16神经网络模型 VGG16模型使用说明 torchvision.models.vgg16(pretrainedFalse) 其中参数pretrained表示是否下载已经通过ImageNet数…

leetcode 滑动窗口小结 (三)

目录978. 最长湍流子数组题目思路分析以及代码1052. 爱生气的书店老板题目思考分析与初步代码优化思路以及优化代码1208. 尽可能使字符串相等题目思考分析以及代码978. 最长湍流子数组 https://leetcode-cn.com/problems/longest-turbulent-subarray/ 题目 当 A 的子数组 A[…

JAVA多线程学习3--线程一些方法

一、通过sleep方法睡眠 在指定的毫秒数内让当前正在执行的线程休眠(暂停执行)。该线程不丢失任何监视器的所属权。 二、线程优先级 线程具有优先级,范围为1-10。 MAX_PRIORITY线程可以具有的最高优先级。int类型,值为10. MIN_PRIO…

mcq 队列_MCQ | 量子密码学

mcq 队列1) Which possible Attacks in Quantum Cryptography can take place? 1)量子密码术中可能发生哪些攻击? Possible Attacks in Quantum Cryptography and Birthday Attack 量子密码术和生日攻击的可能攻击 Birthday attack and Boomerang attack 生日袭击…

《inside the c++ object model》读书笔记 之一:对象

关于对象 ...引子:在C语言中,"数据"和"处理数据的操作(函数)"是分开来声明的,语言本身并没有支持"数据和函数"之间关联性,这种程序成为"程序性的",由一组"分布在各个一功能为向导的函数中"的算法驱动,他们处理的是共同的外部…

十六、保存和加载自己所搭建的网络模型

一、保存自己搭建的模型方法一 例如:基于VGG16网络模型架构的基础上加上了一层线性层,最后的输出为10类 torch.save(objmodule,f"path"),传入需要保存的模型名称以及要保存的路径位置 保存模型结构和模型的参数,保存文…

uC/OS-II OS_TASK.C中有关任务管理的函数

函数大致用途 OS_TASK.C是uC/OS-II有关任务管理的文件,它定义了一些函数:建立任务、删除任务、改变任务的优先级、挂起和恢复任务,以及获取有关任务的信息。 函数用途OSTaskCreate()建立任务OSTaskCreateExt()扩展建立任务OSTaskStkChk()堆…

windows下写的脚本,在linux下执行失败

Windows中的换行符为CRLF, 即正则表达式的rn(ASCII码为13和10), 而Unix(或Linux)换行符为LF, 即正则表达式的n. 在Windows和Linux下协同工作的时候, 往往这个细小的差别就导致问题, 如 1)Windows下写的Shell脚本, 在Linux下运行时往往出现rn是无效参数, 不能执行; 2)vi 等编器下…

Scala中的do ... while循环

做...在Scala循环 (do...while loop in Scala) do...while loop in Scala is used to run a block of code multiple numbers of time. The number of executions is defined by an exit condition. If this condition is TRUE the code will run otherwise it runs the first …

十七、完整神经网络模型训练步骤

以CIFAR-10数据集为例,训练自己搭建的神经网络模型架构 一、准备CIFAR-10数据集 CIFAR10官网使用文档 torchvision.datasets.CIFAR10(root"./CIFAR_10",trainTrue,downloadTrue) 参数描述root字符串,指明要下载到的位置,或已有数…

μC/OS-Ⅱ 操作系统内核知识

目录μC/OS-Ⅱ任务调度1.任务控制块2.任务管理3.任务状态μC/OS-Ⅱ时间管理μC/OS-Ⅱ内存管理内存控制块MCBμC/OS-Ⅱ任务通信1.事件2.事件控制块ECB3.信号量4.邮箱5.消息队列操作系统内核:在多任务系统中,提供任务调度与切换、中断服务 操作系统内核为每…

第二版tapout

先说说上次流回来的芯片的测试情况。 4月23日, 芯片采用裸片直接切片, bond在板子上,外面加了一个小塑料壳来保护,我们就直接拿回来测试了。 测试的主要分为模拟和数字两部分, 数字部分的模块基本都工作正常&#xff0…

cd-rom门锁定什么意思_CD-ROM的完整形式是什么?

cd-rom门锁定什么意思CD-ROM:光盘只读存储器 (CD-ROM: Compact Disc Read-Only Memory) CD-ROM is an abbreviation of "Compact Disc Read-Only Memory". It is a data storage memory in the form of an optical compact disc, which is read by a syst…

远程工作时的协作工具

远程工作时的协作工具 Google Hangout 用于日常会议和面对面交谈,在国内其实可以用qq来带起。Campfire 用于一天来的持续对话。Screenhero 用于分享屏幕,一起写代码,这个比较有用,可以一起写代码。Balsamiq 用于计划要制作的 UI。Asana 用于管理任务Google Docs 用于…

十八、完整神经网络模型验证步骤

网络训练好了,需要提供输入进行验证网络模型训练的效果 一、加载测试数据 创建python测试文件,beyond_test.py 保存在dataset文件夹下a文件夹里的1.jpg小狗图片 二、读取测试图片,重新设置模型所规定的大小(32,32),并转为tens…