Linux & unix shells programing学习笔记
linux 标准

linux 标准
Linux标准是一系列规范和指导原则,旨在确保不同Linux发
行版之间的兼容性和互操作性。
以下是几个重要的Linux标准:
1. Linux标准基础规范(LSB):这是一个定义Linux发行版
所需的核心组件和接口的规范。
其目的是促进应用程序在不同的Linux发行版之间的可移植性。
2. 文件系统层次标准(FHS):FHS定义了在Linux系统中文
件和目录的布局和命名规则。
它确保了不同Linux发行版之间
的一致性,使得开发人员和系统管理员能够更轻松地管理和维护Linux系统。
3. POSIX标准:POSIX(可移植操作系统接口)是由IEEE
(国际电气和电子工程师协会)制定的一组操作系统接口标准。
Linux符合POSIX标准,这使得开发人员能够编写可在Linux
系统以及其他符合POSIX标准的操作系统上运行的应用程序。
4. X Window系统:X Window系统是Linux和其他Unix-like
系统上用于图形用户界面(GUI)的标准。
它定义了用于显示、窗口管理和用户输入的协议和接口。
这些标准的存在有助于确保Linux发行版之间的兼容性和互操
作性,使开发人员和用户能够更轻松地在不同的Linux环境中
工作和交流。
linux系统基础知识

linux系统基础知识Linux系统基础知识Linux是一种自由和开放源代码的类Unix操作系统,它是由Linus Torvalds在1991年首次发布的。
Linux系统具有高度的可定制性和灵活性,因此在服务器、超级计算机、移动设备等领域得到了广泛的应用。
本文将介绍Linux系统的基础知识,包括Linux的发行版、文件系统、用户和权限、命令行和图形界面等方面。
一、Linux的发行版Linux系统有许多不同的发行版,每个发行版都有自己的特点和用途。
常见的Linux发行版有Ubuntu、Debian、Fedora、CentOS、Red Hat等。
这些发行版都是基于Linux内核开发的,但它们的软件包管理、安装方式、默认桌面环境等方面有所不同。
选择适合自己的Linux发行版可以提高工作效率和使用体验。
二、文件系统Linux系统的文件系统采用树形结构,根目录为/。
在根目录下有许多子目录,如bin、etc、home、usr等。
其中,/bin目录存放系统命令,/etc目录存放系统配置文件,/home目录存放用户的主目录,/usr目录存放系统软件和库文件等。
Linux系统支持多种文件系统,如ext4、NTFS、FAT32等。
文件系统的选择取决于使用场景和需求。
三、用户和权限Linux系统是一个多用户系统,每个用户都有自己的用户名和密码。
用户可以通过命令行或图形界面登录系统,并执行各种操作。
Linux 系统采用权限控制机制,每个文件和目录都有自己的权限。
权限分为读、写、执行三种,分别对应数字4、2、1。
文件和目录的权限可以通过chmod命令进行修改。
Linux系统还有超级用户root,拥有系统的最高权限,可以执行任何操作。
四、命令行Linux系统的命令行界面是其最基本的界面,也是最强大的界面。
通过命令行可以执行各种操作,如创建文件、修改权限、安装软件等。
Linux系统的命令行界面有许多命令,如ls、cd、mkdir、rm、chmod等。
《linux概述》课件

软件仓库
APT使用软件仓库来存储和管理软件包。用户可以通过配 置软件仓库来添加或删除软件源,以便获取最新的软件包 版本。
安全性和稳定性
APT软件源经过严格审查,确保安全性和稳定性。同时, APT会自动处理软件包的数字签名,验证软件包的完整性 和来源。
Red Hat系列的YUM/DNF软件包管理
YUM/DNF简介
和自动补全功能,提高命
令行效率。
命令行基本操作
介绍如何在命令行中输入 命令、查看命令帮助、执 行命令等。
Linux的常用命令
01 文件操作命令
介绍如`ls`、`cp`、`mv`、 `rm`等常用文件操作命令 及其参数。
03 系统信息命令
介绍如`uname`、`df`、
`du`等获取系统信息的命
令。
06
Linux网络配置与管理
网络基础知识
IP地址
IP地址是网络中计算机的唯一标识,分为IPv4和IPv6两种 。
01
子网掩码
用于划分IP地址的网络部分和主机部分 。
02
03
默认网关
指明数据包应发送到的下一个路由器 。
常用网络命令
ping
测试与目标主机的连接状态。
ifconfig
查看和配置网络接口信息。
桌面领域
Linux桌面操作系统如Ubuntu、 Fedora等,为用户提供了一个稳定、 安全和个性化的使用环境。
物联网与嵌入式系统
Linux的小型化和定制化特性使其在 物联网设备和嵌入式系统中得到广泛 应用。
02
Linux系统基础
Linux的文件系统
01
文件类型
详细解释Linux中的文件类型, 如普通文件、目录、符号链接、 设备文件等。
linux常用20个命令

linux常用20个命令以下是Linux 中常用的20 个命令:1.ls:列出目录中的文件和子目录。
ls2.cd:切换当前工作目录。
cd directory_name3.pwd:显示当前工作目录的路径。
pwd4.cp:复制文件或目录。
cp source_file destination5.mv:移动或重命名文件或目录。
mv source destination6.rm:删除文件或目录。
rm file_name7.mkdir:创建新目录。
mkdir directory_name8.rmdir:删除空目录。
rmdir directory_name9.touch:创建空文件或更新文件的访问和修改时间。
touch file_name10.cat:将文件内容输出到终端。
cat file_name11.more/less:逐页查看文件内容。
more file_name12.nano/vi:文本编辑器,用于编辑文件。
nano file_name # 或vi file_name13.echo:将文本输出到终端或文件。
echo "Hello, World!"14.grep:在文件中搜索文本。
grep "search_term" file_name15.ps:显示当前运行的进程。
ps16.kill:终止进程。
kill process_id17.chmod:更改文件或目录的权限。
chmod permissions file_name18.chown:更改文件或目录的所有者。
chown owner:group file_name19.df:显示磁盘空间使用情况。
df -h20.du:显示目录空间使用情况。
du -h这只是Linux 中一些最常用的命令。
对于每个命令,可以使用命令后加上--help查看更多用法和选项。
Linux操作系统介绍

Linux操作系统介绍Linux操作系统是一种开源的、免费的操作系统,广泛应用于各种计算设备,包括个人电脑、服务器、嵌入式设备等。
它的灵活性、稳定性和安全性使得它成为许多用户和开发者的首选。
一、Linux的起源和发展Linux操作系统最早是由芬兰计算机科学家Linus Torvalds在上世纪90年代初开发的。
当时,他通过互联网向全球公开发布他开发的操作系统内核,并邀请其他开发者进行贡献。
这种开放的合作模式成为开源软件开发的里程碑,也推动了Linux的迅速发展。
Linux操作系统的设计灵感主要来自于另一种名为UNIX的操作系统。
UNIX是一种商业操作系统,但因为其强大的功能和稳定性而受到广泛认可。
而Linux操作系统则以开源的方式免费提供给用户,使得更多的人能够使用这个强大的操作系统。
二、Linux的特点和优势1. 开放源代码:Linux采用开源模式,任何人都可以获取其源代码进行查看和修改。
这使得用户能够自定义和优化操作系统,提高性能和安全性。
2. 多用户和多任务:Linux操作系统支持多用户同时登录和执行多个任务。
这使得多个用户能够以独立的方式使用计算机,并同时进行不同的任务。
3. 稳定性和安全性:相对于其他操作系统,Linux系统具有更高的稳定性和安全性。
它能够处理大量的并发任务,减少崩溃和故障的概率。
同时,Linux社区的开发者积极修复操作系统中的漏洞,确保用户的安全。
4. 跨平台性:Linux操作系统可以运行在多种硬件平台上,包括个人电脑、服务器、手机、平板电脑等。
无论是高性能的服务器还是嵌入式设备,Linux都可以提供强大的功能和性能。
5. 丰富的应用软件:Linux操作系统有丰富的应用软件可供选择。
这些应用软件涵盖了各个领域,包括办公、图像处理、编程开发等。
用户可以根据自己的需求自由选择软件,满足个性化的需求。
三、常用的Linux发行版由于Linux系统的开源特性,许多开发者都发布了自己的Linux发行版。
Linux从入门到精通

6 文件目录管理
6.4 移动、复制和删 除
6.4.1 移动和重命名:mv 6.4.2 复制文件和目录: cp 6.4.3 删除目录和文件: rmdir和rm
6 文件目录管理
6.5 文件和目录的权 限
6.5.1 权限设置针对的用户 6.5.2 需要设置哪些权限 6.5.3 查看文件和目录的属性 6.5.4 改变文件所有权:chown和 chgrp 6.5.5 改变文件权限:chmod 6.5.6 文件权限的八进制表示
9 用户与用户组管理
9.1 用户与用户组基础
9.3 添加用户
9.5 管理用户账号: usermod
9.2 快速上手:为朋友 John添加账户
9.4 删除用户:userdel
9.6 查看用户信息:id
9 用户与用户组管理
9.7 用户间切换: su
9.8 受限的特权: sudo
9.9 进阶 1:/etc/passwd文件
2.2 安装Linux至硬盘
2.4 进阶:修复受损的 Grub
2 Linux安装
2.1 安装前的准备工 作
2.1.1 我能从哪里获得Linux 2.1.2 硬件要求 2.1.3 与Windows“同处一室” 2.1.4 虚拟机的使用 2.1.5 免费的虚拟机软件: VMware Server
2 Linux安装
6 文件目录管理
6.1 Linux文件系 统的架构
6.2 快速上手:和 你的团队共享文件
6.3 建立文件和目 录
6.4 移动、复制和 删除
6.5 文件和目录的 权限
6.6 文件类型
6 文件目录管理
6.7 输入输出重定向和管 道
6.8 小结
6 文件目录管理
常用linux系统

常用linux系统常用Linux系统Linux是一种广泛使用的开源操作系统,它具有稳定性、安全性和灵活性的特点。
由于Linux系统的开放性和免费性,它已经成为许多企业、个人和组织的首选操作系统。
在本文中,我们将讨论一些常用的Linux操作系统以及它们的特点。
1. Ubuntu:Ubuntu是最受欢迎的Linux发行版之一。
它提供了一个简单易用的桌面环境,适合新手用户。
Ubuntu还有一个庞大的软件仓库,可以让用户轻松地安装各种应用程序。
此外,Ubuntu还提供长期支持(LTS)版本,可以确保系统的稳定性和安全性。
因此,Ubuntu是许多用户的首选操作系统之一。
2. CentOS:CentOS是一种基于Red Hat Enterprise Linux(RHEL)的免费操作系统。
它提供了一个稳定的平台,适合服务器和企业使用。
CentOS支持各种企业级应用程序和服务,并提供广泛的安全补丁和更新。
由于CentOS是基于RHEL开发的,因此它与RHEL兼容,并且可以享受到RHEL的广泛支持和生态系统。
3. Fedora:Fedora是由社区支持的免费操作系统,由Red Hat赞助。
它提供了最新的软件包和技术,适合技术爱好者和开发者使用。
Fedora采用了一种滚动发布的模式,可以快速推出新的功能和更新。
它还提供了一个活跃的社区和开发者支持,使用户可以快速解决问题和获取帮助。
4. Debian:Debian是一种广泛使用的免费Linux发行版,以其稳定性和安全性而闻名。
Debian提供了一个庞大的软件仓库,用户可以自由地选择和安装各种应用程序。
它还提供了一个强大的软件包管理系统,可以轻松地升级和管理系统。
由于它的稳定性和可靠性,Debian被广泛用于服务器和嵌入式设备。
5. Arch Linux:Arch Linux是一种轻量级和高度定制的Linux发行版。
它提供了一个简洁的操作系统,用户可以根据自己的需求进行定制。
Linux操作系统简介

Linux操作系统简介Linux操作系统,是一种自由和开源的操作系统,由Linus Torvalds在1991年首次发布。
它极其灵活和可定制化,被广泛应用于服务器、超级计算机、嵌入式设备和个人计算机等各个领域。
一、Linux的发展历程Linux的出现源于学术界的需求,最初只是作为一个个人爱好项目而被创建出来。
1991年,Linus Torvalds开始着手开发Linux操作系统,并在同年将其首次发布。
通过开源的方式,Linus吸引了众多开发者的关注和加入,从而推动了Linux的迅速发展。
二、Linux的特点1. 开源性:Linux以GNU通用公共许可证(GPL)发布,这意味着用户可以自由查看、修改和分发源代码,这种自由性为Linux获得了广泛的开发者和用户支持。
2. 多用户和多任务:Linux支持多用户同时登录,并且可以同时运行多个程序,满足了不同用户对计算资源的需求。
3. 强大的网络能力:Linux作为一个服务器操作系统,具备出色的网络支持,能够轻松构建复杂的网络环境。
4. 高度稳定性:Linux的稳定性是其最大的优点之一,长时间运行后系统资源利用率也能保持高效。
5. 强大的安全性:Linux为用户提供了多层次的安全机制,包括访问控制、防火墙、数据加密等,有效保护了系统和数据的安全。
三、Linux的应用领域1. 服务器领域:Linux在服务器领域是最为广泛应用的操作系统之一,其稳定性和高度可定制化的特性使其成为企业级服务器的首选。
2. 嵌入式设备:Linux能够适应各种硬件平台,因此在嵌入式设备方面也占有重要地位,如智能手机、路由器、电视等。
3. 超级计算机:由于Linux具备出色的网络支持和可扩展性,使其成为超级计算机领域的首选操作系统。
4. 个人计算机:虽然Windows依然是个人计算机最主要的操作系统,但Linux也有着一定的市场份额,被一些技术人员和开发者用于个人使用环境。
四、常见的Linux发行版Linux有许多不同的发行版,每个发行版都基于Linux内核,但在软件包和用户界面方面有所差异。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Linux&unix Shells programing学习笔记一、introduction to unix/linux shells1、what is unix ? what is Linux a Little History2、The kernel、The shell、and User4、Unix shellBoume shell 、c shell、kom shell5、Linux shellBash6、Cat /etc/shells(列出系统中所包含的shell)7、Echo $SHELL(列出目前正在使用的shell)8、Cat /etc/passwd(查看用户所对应的shell)9、What is posix?Portable operating system interface of unix10、History of the shell11、Uses of the shellA、when running interactivery, one of the major functions of a shell is interpretcommands entered at the command-line prompt.(交互式下解释命令行输入的命令)B、Another important function of the shell is customize the user‟s environment,normally done in shell initialization files.(定制用户的环境)C、The shell can also be used as an interpreted programming language.(作为解释性的变成语言)12、Responsibilities of the shellThe shell is ultimately responsible for making sure that any commands typed at the prompt get executed properly. Included in those responsibilities are:A、reading input and parsing the command line(读取输入并解析命令行)B、e valuation special characters, such as wildcards and the history character(替换特殊字符)C、s etting up pipes, redirection, and background processing(设置管道、重定向和后台处理)D、handing signals(处理信号)E、setting up programs for execution(程序执行的相关设计)13、System Startup and the login shellA、parsing the command linewhen you type a command at the prompt, the shell read a line of input and parses the command line, breaking the line into words, called tokens. Tokens are separated by spaces and tabs and the command line is terminated by a newline. The shell then checks to see whether the first word is a built-in command or an executable.●History substitution is performed (if applicable).(执行命令替换)●Command line is broken up into tokens, or words.(命令行分解为tokens)●History is update (if applicable).(命令更新)●Quotes are processed.(引入的处理)●Alias substitution and functions are defined (if applicable)(别名替换,和函数的定义)●Redirection , background, and pipes are set up.(设置重定向、后台管理和管道)●Variable substitution( $user, $name, etc.) is performed.(执行变量的替换)●Command substitution (echo “Today is …data‟”) is performed.(执行命令替换)●Filename substitution, called globbing (cat abc.??, rm *.c, etc.) is performed.(执行globbing的文件替换)●Command is executed.(执行命令)B、T ype of commands●Aliases●Keywords●Functions●Built-in commands●Executable programsC、P rocesses and the shell1、what processes are running?●the ps command●the pstree/ptree command2、Whet are system calls?3、Creating processesD、Environment and inheritance1、ownership and permissions2、the file creation mask3、changing permissions and ownership●chmod command●chown command4、the working directory5、variablesE、redirection and pipes1、file descriptors (0:标准输入1:标准输出2:标准错误输出)2、redirection3、pipesF、the shell and signalsA.the signal can be ignoredB.the processes can be stoppedC.the processes can be continuedD.the signal can be caught by a function defined in the program.G、Executing commands from scriptsGo into your favorite editor and type in a set of unix/Linux commands, one per line.Indicate what shell you want by placing the pathname of the shell after the #! On thefirst line.Save your file and turn on the execute permissions so that you can run it.Execute your program just as you would any other unix/Linux command.二、Shell programming Quick Start1、Taking a peek at shell scriptsA.The c shell and TC shell emulate the c language syntax whereas Bourne shell isbased on an older programming language called Algol.B.The bash and korn shells tend to be combination of both the Bourne and C shells,although these shells originated from the Bourne shell2、Sample scripts: Comparing the Major shellsA.Before Getting StartedYou must have a good handle on UNIX/Linux commands. If you do not know the basic commands, you cannot do much with shell programming.B.VI3、The c and TC shell syntax and constructsA、The shbang lineExample: #!/bin/csh or #!/bin/tcshB、C ommentsExample: #This is a comment.C、W ildcardsExample:rm * ; ls ??;cat file[1-3];!!Echo “How are you?”Echo Oh boy\!D、Displaying outputExampleEcho “Hello to you\!”E、Local variablesSet variables_name = valueSet name=”Tom Jones”F、Global variablesSetenv V ARIABLE_NAME valueSetenv PRINTER shakespeareG、Extracting values from variablesEcho $variable_nameEcho $nameEcho $PRINTERH、Reading user inputEcho “what is your name?”Set name = $<I、ArgumentsScriptname arg1 arg2 arg3 …Echo $1 $2 $3Echo $*J、ArraysSet word_list = (word1 word2 word3)Echo $word_list[2]Echo $word_list[1]Echo $word_list or $word_list[*]K、Command substitutioinSet variable_name = `command`Echo $variable_nameL、Arithmetic@n =5+5Echo $nM、OperatorsN、Conditional statementsO、LoopsP、File testing4、The bourne shell syntax and constructsA、the shbang lineB、c ommentsC、w ildcards(通配符)D、displaying outputE、local variablesvariable_name = valueF、global variablesV ARIABLE_NAME=valueExport V ARIABLE_NAMEG、Extracting values from variablesH、Read user inputEcho “what is your name?”Read nameRead name1 name2 …I、Arguments (positional parameters)$scriptname arg1 arg2 arg3 …J、Arrays (positional parameters)Set word1 word2 word3Echo $1 $2 $3K、Command substitutionVariable_name = `command`Echo $variable_nameL、ArithmeticN = `expr 5+5`Echo $nM、Opterators5、The korn shell ConstructsA、the shbang line#!/bin/kshB、c omments#this program will test some filesC、w ildcardsrm *;ls ??;cat file[1-3];echo “How are you?”D、displaying outputecho “who are you?”print “how are you?”E、local variablesvariable_name = valuetypeset variable_name = valuename = “John Doe”F、global variablesexport V ARIABLE_NAME = valueexport PA TH=/bin:/usr/bin;G、extracting values from variablesecho $variable_nameecho $nameH、read user inputprint –n “what is your name?”read nameI、arguments$scriptname arg1 arg2 arg3 …J、arraysset apples pears peachesecho $1 $2 $3K、arithmetictypeset –ivariable_nameL、command substitutionvariable_nae = `command‟variable_name = $(command)echo $variable_nameM、operatorsN、conditional statementsO、loopsP、file testing6、the bash shell constructs三、regular expressions and pattern matching1、definition and examplewhat is a regular expression? A regular expression is just a pattern of characters used to match the same characters in a search.Vim 编辑器::1,$s/kernel/admin/g (替换文中的kernel为admin,做一个全局替换)撤销操作:按键盘上的u;2、regular expression metacharactersvim 编辑器::1,$s/\<[Kk]ernel\>/admin/g (替换稳重的K/kernel为admin,做一个全局替换)3、combining regular expression matacharacters四、The grep family1、the meaning of grep●the name grep can be traced back to the editor. If you invoked that editor andwanted to search for a string, you would type at the ex prompt:⏹ /pattern/p●The first line containing the string pattern would be printed as “p”by the printcommand. If you wanted all the lines that contained pattern to be printed, you wouldtype:⏹g/pattern/p●when g precedes pattern, it means “all lines in the file,”or “perform g globalsubstitution.”Because the search pattern is called a regular expression, we cansubstitute RE for pattern and the command reads⏹g/RE/P2、how grep works●the grep command searches for a pattern of characters in a file or multiple files. Ifthe pattern contains whitespace, it must be quoted. The pattern is either a quotedstring or a single word, and all other words following it are treated as filenames.Grep sends its ouput to the screen and does not change or affect the input file inanyway.●FormatGrep word filename filename●Metacharacters3、MetacharactersA metacharacter is a character that represents something other than itself. ^ and $ areexamples of metacharacters.4、Grep and exit statusThe grep command is very useful in shell scripts, because it always returns and exit status to indicate whether it was able to locate the pattern or the file you were looking for.If the pattern is found, grep returns an exit status of 0, indicating success; if grep cannot find the pattern, it returns 1 as its exit status; and if the file cannot be found, grep returns an exit status of 25、Grep with pipesInstead of taking its input from a file, grep often gets its input from a pipeEtc. Ls –l | grep …^d‟6、FgrepThe fgrep command behaves like grep, but does not recognize any regular expression metacharacters as being special. All characters represent only themselves. A caret is simply a caret, a dollar sign is a dollar sign, and so forth.7、Linux and GNU grep8、 Grep –E or egrep五、Sed the streamlined editor1、what is sed?Sed is a streamlined, noninteractive editor. It allows you to perform the same kind of editing tasks used in the vi and ex editors.2、Version of sedLinux uses the GNU version of sed, copyrighted by the free software foundation. This version is almost identical to the sed provided by standard UNIX distributions.Sed –version3、How does sed work?4、Regular expressionsSed, like grep, searches for patterns in files using regular expressions. Regular expressions are patterns of characters enclosed in forward slashes for searches and substitutions.5、Addressing⏹FormatSed …command‟ filename(s)⏹ExampleSed …1,3d‟ myfileSed –n …/[Jj]ohn/p‟ datafile6、Command and options7、 How to modify a file with sedSed is a nondestructive editor. It will display the edits you make on your screen, but it will not change the file you are editing. To really reflect the edits in the file, you must redirect the output to another file, and then rename the orginal fileExample:Sed …1,3d‟ filex > tempMv temp filex8、Error messages and exit statusWhen sed encounters a syntax error, it sends a pretty straightforward error message to standard error, but if it cannot figure out what you did wrong, sed gets “garbled” which we could guess means confused. If the syntax is error-free, the exit status that sed returns to the shell is a zero for success and nonzero integer for failure.9、MetacharactersLike grep, sed supports a number of special metacharacters to control pattern seaching.10、Sed example⏹Printing: the p commandSed …/north/p‟ datafileSed –n …/north/p‟ datafile⏹Deleting: the d commandSed …3d‟ datafileSed –n …3,$d‟ datafileSed …$d‟ datafileSed …/north/d‟ datafile⏹Substitution: the s commandSed …s/west/north/g‟ datafileSed –n …s/^west/north/p‟ datafileSed …s/[0-9][0-9]$/&.5/‟ datafileSed –n …s/hemenway/jones/gp‟ datafileSed –n …s/\(Mar\)got/\1ianne/p‟ datafileSed …s#3#88#g‟ datafile⏹Range fo selected lines: the commaSed –n …/west/,/east/p‟ datafileSed –n …5,/^northeast/p‟ datafileSed …west/,/east/s/$/**/V ACA**/‟ datafile⏹Multiple edits: the e commandSed –e …1,3d‟–e …s/hemenway/jones/‟ datafile⏹Reading from files: the r commandSed …/suan/r newfile‟ datafile⏹Writing to files: the w commandSed –n …/north/w newfile‟ datafile⏹Appending: the a commandSed …^north /a\-→BOOKBOOKE←--… datafile⏹Inserting: the I commandSed …/eastern/i\-→BOOBOOKE←-… datafile⏹Changing: the c commandSed …/eastern/c\ -→ BOOBOOKE←-… datafile⏹Next: the n commandSed …/eastern/{n;s/AM/Archie/;}‟ datafile⏹Transform: the y commandSed …1,3y/asdfgajasdflawehfihaiwehfihasd/ADSFASKDHFLIASFI/‟ datafile⏹Quit: the q commandSed …5q‟ datafileSed …/Lewis/{s/Lewis/Joseph/;q;}‟ datafile⏹Holding and getting: the h and g commandsSed –e …/northeast/h‟–e …$G‟ datafileSed –e …/WE/{h;d;}‟–e …/CT/{G;}‟ datafileSed –e …/northeast/h‟–e …$g‟ datafileSed –e …/WE/{h;d;}‟–e …/CT/{g;}‟ datafile⏹Holding and exchanging: the h and x commandSed –e …/Patricia/h‟–e …/Margot/x‟ datafile11、Sed scripting⏹Sed script examples⏹⏹。