课程: Ubuntu Linux: Essential Commands
今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Change files programmatically
- [Instructor] Sed and AWK are common tools for changing the content of files programmatically. They both work at the command line and they each have a programming language of their own to determine how to treat the content of a file. In this video, I want to show you some basics, and if you're interested in a lot more detail, be sure to check out our courses dedicated to each tool. Here though, we'll take a look at using regular expressions to change the content of some files. Sed or stream editor, is a great choice for replacing content in a file or as part of a piped command. At its most basic, a sed statement is a command followed by some parameters. The s command, just the letter s, means a substitute, and then we would give it something to look for and something to substitute that with when it finds it. Let's take a look at that with our users.txt file. First, let's take a look at the contents of the file with cat users.txt, and then, we can pipe that into sed, and between two…
内容
-
-
-
-
(已锁定)
Files on Linux10 分钟 27 秒
-
(已锁定)
Text files8 分钟 52 秒
-
(已锁定)
Work with files and directories10 分钟 16 秒
-
File links7 分钟 27 秒
-
(已锁定)
Finding files4 分钟 40 秒
-
(已锁定)
Input/output redirection6 分钟 18 秒
-
(已锁定)
Compare text files4 分钟 43 秒
-
(已锁定)
Compare non-text files3 分钟 20 秒
-
(已锁定)
Compress and decompress files9 分钟 12 秒
-
(已锁定)
Explore regular expressions3 分钟 36 秒
-
(已锁定)
Change files programmatically4 分钟 42 秒
-
(已锁定)
-
-