background preloader

Sed - An Introduction and Tutorial

Sed - An Introduction and Tutorial
Last modified: Mon Dec 2 16:50:13 2019 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. One way to think of this is that the old, "classic" version was the basis of GNU, FreeBSD and Solaris verisons of sed. The Awful Truth about sed Sed is the ultimate stream editor. Anyhow, sed is a marvelous utility. .

regular expression - grep: Trailing backslash 13. Classes and objects — How to Think Like a Computer Scientist: Learning with Python 2nd Edition documentation 13.1. Object-oriented programming Python is an object-oriented programming language, which means that it provides features that support object-oriented programming ( OOP). Object-oriented programming has its roots in the 1960s, but it wasn’t until the mid 1980s that it became the main programming paradigm used in the creation of new software. It was developed as a way to handle the rapidly increasing size and complexity of software systems, and to make it easier to modify these large and complex systems over time. Up to now we have been writing programs using a procedural programming paradigm. 13.2. A class in essence defines a new data type. Consider the concept of a mathematical point. A natural way to represent a point in Python is with two numeric values. An alternative is to define a new user-defined compound type, also called a class. A class definition looks like this: This definition creates a new class called Point. class Point: "Point class for storing mathematical points." 13.3.

Unix/Linux "find" Command Tutorial ©2002–2013 by Wayne Pollock, Tampa Florida USA. All rights reserved. The find command is used to locate files on a Unix or Linux system. find will search any set of directories you specify for files that match the supplied search criteria. You can search for files by name, owner, group, type, permissions, date, and other criteria. The search is recursive in that it will search all subdirectories too. The syntax looks like this: find where-to-look criteria what-to-do All arguments to find are optional, and there are defaults for all parts. For example: find will display the pathnames of all files in the current directory and all subdirectories. find . do the exact same thing. find / -name foo This will search the whole system for any files named foo and display their pathnames. /home/wpollock/foo /home/ua02/foo /tmp/foo If find doesn't locate any matching files, it produces no output. The above example said to search the whole system, by specifying the root directory (“/”) to search. find .

How to Design Programs: An Introduction to Computing and Programming In the beginning, people thought of computers as number crunchers. And indeed, computers are very good at working with numbers. Since teachers start their first-graders on computing with numbers, we start with numbers, too. Once we know how computers deal with numbers, we can develop simple programs in no time; we just translate common sense into our programming notation. Still, even developing such simple programs requires discipline, and so we introduce the outline of the most fundamental design recipe and the basic programming guideline at the end of this section. 2.1 Numbers and Arithmetic Numbers come in many different flavors: positive and negative integers, fractions (also known as rationals), and reals are the most widely known classes of numbers: The first is an integer, the second one a negative integer, the next two are fractions, and the last one is an inexact representation of a real number. As in arithmetic or algebra, we can nest expressions: (sqrt 2) = #i1.4142135623731 but

The Linux Documentation Project: Guides The Linux Documentation Project (LDP) is working on developing good, reliable documentation for the Linux operating system. The overall goal of the LDP is to collaborate in taking care of all of the issues of Linux documentation, ranging from online documentation (man pages, HTML, and so on) to printed manuals covering topics such as installing, using, and running Linux. Here is the Linux Documentation Project Manifesto and Copyright License for LDP works. Translations of LDP works (languages other than English) can be found on the "Non-English Linux Info" links page. Advanced Bash-Scripting Guide This document is both a tutorial and a reference on shell scripting with Bash. Below is a table of translated guides that are available from pub/Linux/docs/ldp-archived/. "An important part of any operating system is documentation, the technical manuals that describe the operation and use of programs.

permissions - How can I become the owner of a file/folder that root owns AutoKey : Linux Utility for Text Substitution , Hotkeys and Desktop Automation | God, Your Book Is Great !! In this post, I talk about one of my favorite utilities I use regularly – AutoKey. AutoKey is a real life saver and a great productivity boost for me. There are not much articles about AutoKey and even those few cover very few of its features. What is AutoKey AutoKey’s homepage describes it concisely as : "AutoKey is a desktop automation utility for Linux and X11. If you have used AutoHotKey in Windows, then you will be immediately comfortable in AutoKey. AutoKey can be used in multiple scenarios : a) Text Substitution : Replace a short abbreviation with a long expansion. The biggest advantage of AutoKey is that it works across all applications. Installation You can read all about the utility at AutoKey’s homepage. There are many ways to install AutoKey and it depends on your OS. Starting AutoKey You can start AutoKey in Ubuntu by Applications -> Accessories -> AutoKey. Once you start using AutoKey , you will prefer to start it when the system starts. Some Basics AutoKey Usage : Phrases 1.

Working with PDF Files on Linux PDF (Portable Document Format) is a popular file format created by Adobe in the early 1990s. Even before it was released as an open standard in 2008, PDF was widely used for document exchange because of its universal compatibility. In other words, if you want your documents to look consistent everywhere, you should use PDF. It supports font embedding, which means that other users will see the text just like you formatted it, even if they don't have the same fonts as yours. Note that some fonts are not embeddable, so they are usually automatically replaced by standard system fonts.PDF files can contain interactive elements – form fields, annotations, even 3D objects – and can be digitally signed or encrypted. Creating PDF Files The easiest way to create a PDF document is to use the “Export to PDF” function available in OpenOffice and LibreOffice. "Export to PDF" dialog box in LibreOffice Export web pages to PDF in Firefox Converting PDF Files File conversion is best when it works both ways.

Using Grep & Regular Expressions to Search for Text Patterns in Linux Introduction One of the most useful and versatile commands in a Linux terminal environment is the "grep" command. The name "grep" stands for "global regular expression print". This means that grep can be used to see if the input it receives matches a specified pattern. This seemingly trivial program is extremely powerful when used correctly. We will explore some options and then dive into using regular expressions. Table of Contents Basic Usage In its simpest form, grep can be used to match literal patterns within a text file. Let's try an example. cd /usr/share/common-licenses grep "GNU" GPL-3 GNU GENERAL PUBLIC LICENSE The GNU General Public License is a free, copyleft license for the GNU General Public License is intended to guarantee your freedom to GNU General Public License for most of our software; it applies also to Developers that use the GNU GPL protect your rights with two steps: "This License" refers to version 3 of the GNU General Public License. 13. Common Options 1. Grouping

Related: