sed command in unix

Learn about sed command in unix, we have the largest and most updated sed command in unix information on alibabacloud.com

Use the SED command in the shell to replace/\/

SED command Related:Https://www.cnblogs.com/ggjucheng/archive/2013/01/13/2856901.htmlHttps://www.cnblogs.com/DragonFire/p/6600121.htmlHere we have to do the function is:Enter a directory "/data/data8"Transform it to "\/data\/data8" in the shell (this is to be used directly in the SED command behind the shell)Let's take

Shell command usage and common use cases under Linux: SED

Tags: text file http file matching HTTPS shell command TPS NET ReadClick to view the original blog.sedis the abbreviation for Stream editor, which is a non-interactive stream editor for filtering or converting text.Not to be continued ...ProfileSed Options ... Script [Input File ...]DescribesedThe editor is called the Stream editor, which is the opposite of the normal interactive text editor. In an interactive text editor, such as VIM, you can use key

Linux System Management-(--sed) command

the contents of the mode space to the specified fileR/path/from/somefile: reads the text stream from the specified file into the matching pattern=: Prints line numbers for lines in pattern space;! : Reverse condition (for address range)S//: Replace, support using other separators, [email protected]@@,s###s/what to look for/replace with content/modifiers Modifier:P: Show the rows that were successfully replacedG: global substitution; By default, each line replaces only the first time: Back refer

Makefile shell script; sed command

1. To use the shell script in makefile, you need to add the "@" symbol, for example:@if [-D xxx]; Then \//-d to determine the existence, in the shell, with the [] number instead of parenthesesRM-RF xxx; \Fi@cp-FV xxx xxxx//-f Delete the existing target file without prompting the-v CP command will tell the user what is being doneExample: CP-FV temp TEMP2Display: ' Temp ', ' temp2 'Find all the KO files and copy@find sor_dir-name "*.ko"-exec sudo cp-vf

An example of application of sed command and Shell's if statement

if [-f/etc/syslog.conf]; #判断文件是否存在Thensystest= ' sed-n '/^auth.info/p '/etc/syslog.conf '; #匹配 the/etc/syslog.conf file has a auto.info string and returns a string, Systest variable is received.if [-n \ "\ $systest \"]; #判断字符串是否存在ThenSed-e ' s/^auth.info.*/auth.info \\/var\\/adm\\/authlog/g '/etc/syslog.conf > config.tmp mv config.tm p/etc/syslog.conf; #存在则替换Elseawk ' {print \$0} end{print \ "Auth.info/var/adm/authlog\"} '/etc/syslog.conf > config.tm

sed command in Linux

specified line, with the contents of StringI \string: Adds a new row before the specified line, with the contents of StringR file: Adds the contents of the specified file to the qualifying lineW File: Save the row in the range specified by the address as the specified files/pattern/string/modifier: Find and Replace, default replaces only the first string in each line that is matched to the patternModifier: G: Global substitution I: ignore character caseIn fact S///,s###,[email protected]@@ 都 th

Grep command series: How to Use grep commands in Linux/UNIX

contain a match. The output content only contains rows that do not contain the given word. For example, output all rows that do not contain the bar word: $ grep -v bar /path/to/file UNIX/Linux pipelines and grep commands Grep is often used with pipelines. In this example, the name of the hard disk device is displayed: # dmesg | egrep '(s|h)d[a-z]' Display CPU model: # cat /proc/cpuinfo | grep -i 'Model' However, the preceding commands can also be use

Linux/Unix Command Line full version

ArticleDirectory Linux Command Line cheat sheets Solaris cheat sheets Debian/Ubuntu cheat sheets Package management cheat sheets UNIX cheat sheets Bash cheat sheets Awk cheat sheets Ed cheat sheets Sed cheat sheets Gdb debugger cheat sheets The Linux/Unix System in

Efficient text editing in Unix Command Line Mode (1)

A Brief Study of some basic command line text editing programs that can save time and effort. Text editing is usually performed interactively in the text editor application. However, some tasks can be conveniently and quickly completed directly from the UNIX command line. In addition, you can use these single-command-l

Getting started with C Programming in Unix/Linux (39) shell Command System Management, getting started with shell

Getting started with C Programming in Unix/Linux (39) shell Command System Management, getting started with shellDf command This function is used to detect disk space usage and free space in a file system. It displays the usage of nodes and disk blocks in all file systems. The command format is as follows:Df [Option]

Using Iconv command to deal with Chinese garbled characters of text files under Linux/unix system

The Iconv command is a file-encoded reload tool that runs on the Linux/unix platform. When we look at the text file in the Linux/unix system shell, we often find that the file is garbled in Chinese, this is due to the encoding of the text file and the current operating system settings, which can be encoded by using the ICONV conversion, to solve the garbled probl

Linux/Unix Command Line complete http://www.cnbeta.com/articles/48871.htm

The Linux/Unix System in command line mode is always confusing to cainiao. We have published a set of Linux Command lines, but it does not seem perfect.Today, we are bringing you a list of command lines that collect Linux/Unix systems from various websites. The list is a col

Unix/Linux Command memorandum, unixlinux Memorandum

Unix/Linux Command memorandum, unixlinux Memorandum Arp: The ARP cache contains one or more tables used to store IP addresses and resolved MAC addresses. // Extract all Bound0 ip and mac Information Arp-n-I bond0 | awk '$5 = "bond0" {print $1, $3 }' Sed: used to edit the text in a document or string through a series of commands // Read a single row of data

Unix Common Command Index (ECHO,FIND,XARGS)

Echoecho [OPTIONS] [string]-print STRING plus a line break-N Do not print end of line break-E After the string is escaped and printed-E does not escape string for direct printingFindFind [-h| l| P] [starting-point] [expression]The default starting-point is the current directory ".".-H/L/P:-H is not a trace symbolic link,-l is a trace symbolic link,-h is a symbol link only in command parametersExpression list: (Can be used in front of each expression!

Make command in Linux/unix environment (GO)

Make is a very important compilation command, both in Linux and in the UNIX environment. Whether you are developing your own projects or installing applications, we often use make or makes install. With make tools, we can break down large-scale development projects into more manageable modules, and for an application that includes hundreds of source files, using the Make and makefile tools, you can easily a

Introduction to basic UNIX command sets

The UNIX command set is a very distinctive set of commands. It is designed to be used to fully control UNIX machines. This section will discuss part of the UNIX command set. This section focuses on UNIX commands that are frequentl

Make command in Linux/Unix environment

Make is a very important compilation command in both Linux and UNIX environments. Make or make install is often used for project development and application software installation. With the make tool, we can break down large development projects into multiple modules that are easier to manage. For an application that includes hundreds of source files, by using make and makefile, You can streamline the comple

The hidden trouble of the tar command of UNIX operating system and the solving method

Unix| solution at present, Unix operating system in China's financial sector is widely used, UNIX with its powerful functions (time-sharing, multitasking, multi-user, network interconnection, graphics interface, etc.), much favored by financial enterprises. Agricultural Bank of China is currently applying the SCO UNIX

command-line debugging tools in a UNIX environment: GDB

Label:command-line debugging tools in a UNIX environment: gdb If you need to use the GDB debugger, add the-G option to GCC. The following command section is a simplified version, such as using L instead of list and so on. 1. Basic Commands 1) Enter GDB #gdb test Test is the program to debug, generated by GCC test.c-g-o test. Enter the post prompt into (GDB). 2) View Source (GDB) L Source code will be a lin

Unix command line Idioms

UNIX® has its own dialect, and its command vocabulary is very large. But you don't need to master all the content at once. This article describes a number of command line combinations that promote your mastery of UNIX languages. When you travel to a country that uses different languages, you may need to master some of

Total Pages: 15 1 .... 11 12 13 14 15 Go to: Go

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.