background preloader

Sed - An Introduction and Tutorial

Sed - An Introduction and Tutorial
Your browser does not have Javascript enabled. I use Javascript for analytics, and to show ads which pay for the maintenance Last modified: Thu Apr 23 16:37:48 EDT 2015 Quick Links Table of Contents Note - You can click on the table of contents sections to jump to that section. Then click on the section header of any section to jump back to the table of contents. Copyright 1994, 1995 Bruce Barnett and General Electric Company Copyright 2001,2005,2007,2011,2013 Bruce Barnett All rights reserved You are allowed to print copies of this tutorial for your personal use, and link to this page, but you are not allowed to make electronic copies, or redistribute this tutorial in any form without permission. Original version written in 1994 and published in the Sun Observer Introduction to Sed How to use sed, a special editor for modifying files automatically. There are a few programs that are the real workhorse in the UNIX toolbox. The Awful Truth about sed Sed is the ultimate stream editor. Do not fret! or .

Related:  BashCommandsLinux

egrep mini-tutorial egrep is an acronym for "Extended Global Regular Expressions Print". It is a program which scans a specified file line by line, returning lines that contain a pattern matching a given regular expression. The standard egrep command looks like: sed, a stream editor sed, a stream editor This file documents version 4.2.1 of GNU sed, a stream editor. Copyright © 1998, 1999, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This document is released under the terms of the GNU Free Documentation License as published by the Free Software Foundation; either version 1.1, or (at your option) any later version. You should have received a copy of the GNU Free Documentation License along with GNU sed; see the file COPYING.DOC. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02110-1301, USA.

Table of keyboard shortcuts In computing, a keyboard shortcut is a sequence or combination of keystrokes on a computer keyboard which invokes commands in software. Some keyboard shortcuts require the user to press a single key or a sequence of keys one after the other. Other keyboard shortcuts require pressing and holding several keys simultaneously (indicated in the tables below by this sign: +). Keyboard shortcuts may depend on the keyboard layout (localization). Comparison of keyboard shortcuts[edit]

[Chapter 35] 35.10 Splitting Files by Context: csplit Let's look at search patterns first. Suppose you have an outline consisting of three main sections. You could create a separate file for each section by typing: % csplit outline /I./ /II./ /III./ 28 number of characters in each file 415 . 372 . 554 . % ls outline xx00 outline title, etc. xx01 Section I xx02 Section II xx03 Section III This command creates four new files (outline remains intact). csplit displays the character counts for each file.

How to Extend/Reduce LVM's (Logical Volume Management) in Linux - Part II Previously we have seen how to create a flexible disk storage using LVM. Here, we are going to see how to extend volume group, extend and reduce a logical volume. Here we can reduce or extend the partitions in Logical volume management (LVM) also called as flexible volume file-system. Vim tips and tricks Vim tips and tricks Vim Tips and Tricks Save and quit :w => Save [:w filename writes the content to the specified file from current file] BashFAQ/011 One dirty (but not quick) way is: sed -n "${n}p" "$file" But this reads the entire file even if only the third line is desired, which can be avoided by printing line $n using the p command, followed by a q to exit the script: sed -n "$n{p;q;}" "$file" Another method is to grab the last line from a listing of the first n lines:

Introduction to if 7.1.1. General At times you need to specify different courses of action to be taken in a shell script, depending on the success or failure of a command. The if construction allows you to specify such conditions. The most compact syntax of the if command is: rsync 22 Jun 2014 rsync - a fast, versatile, remote (and local) file-copying tool Local: rsync [OPTION...] Vim Commands Cheat Sheet How to Exit Editing a File Inserting Text Inserting a file Deleting Text

BashFAQ These are answers to frequently asked questions on channel #bash on the freenode IRC network. These answers are contributed by the regular members of the channel (originally heiner, and then others including greycat and r00t), and by users like you. If you find something inaccurate or simply misspelled, please feel free to correct it! All the information here is presented without any warranty or guarantee of accuracy. Use it at your own risk.

Related:  Linuxlanguages