background preloader

Linux

Facebook Twitter

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.

Using Grep & Regular Expressions to Search for Text Patterns in Linux

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. Its ability to sort input based on complex rules makes it a popular link in many command chains. 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 The first argument, "GNU", is the pattern we are searching for, while the second argument, "GPL-3", is the input file we wish to search. The resulting output will be every line containing the pattern text. Common Options. Working with PDF Files on Linux. PDF (Portable Document Format) is a popular file format created by Adobe in the early 1990s.

Working with PDF Files on Linux

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. Adobe has developed nine versions (specifications) of PDF, and each new version is backward-inclusive, meaning that it supports all features added in previous versions.

Creating PDF Files "Export to PDF" dialog box in LibreOffice. Regular expression - grep: Trailing backslash. Sed - An Introduction and Tutorial. Your browser does not have Javascript enabled.

Sed - An Introduction and Tutorial

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. Undelete Files on Linux Systems. Unix/Linux "find" Command Tutorial. ©2002–2013 by Wayne Pollock, Tampa Florida USA.

Unix/Linux "find" Command Tutorial

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.

Linux Man Pages: General Commands. Linux Man Pages. The Linux Documentation Project: Guides. The Linux Documentation Project (LDP) is working on developing good, reliable documentation for the Linux operating system.

The Linux Documentation Project: Guides

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.

It assumes no previous knowledge of scripting or programming, but progresses rapidly toward an intermediate/advanced level of instruction . . . all the while sneaking in little nuggets of UNIX® wisdom and lore. Online regex tester and debugger: JavaScript, Python, PHP, and PCRE. AutoKey : Linux Utility for Text Substitution , Hotkeys and Desktop Automation.

In this post, I talk about one of my favorite utilities I use regularly – AutoKey.

AutoKey : Linux Utility for Text Substitution , Hotkeys and Desktop Automation

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. I intend to talk about some of my favorite features which I use regularly. I use AutoKey’s GTK version in Ubuntu but most of the points in the post will be applicable to other Linux variants and KDE. Appendix A. Installation Howto. GNU/Linux Installation Guide. Permissions - How can I become the owner of a file/folder that root owns. Linux.