Developerworks : Linux : Tip: Sorting Files with Sort and Tsort

Total Page:16

File Type:pdf, Size:1020Kb

Developerworks : Linux : Tip: Sorting Files with Sort and Tsort Search within for: Use only ( ) " " + - Search help IBM home | Products & services | Support & downloads | My account IBM developerWorks : Linux : Linux articles Tip: Sorting files with sort and tsort Get to know your textutils Contents: Resources Jacek Artymiak ([email protected]) Freelance author and consultant About the author March 6, 2003 Rate this article Save time and headaches by using sort and tsort -- instead of resorting to more complex solutions utilizing Perl or Awk. Jacek Related content: Artymiak explains how. Get to know your textutils Although it is possible to write advanced sorting applications in Perl or Concatenating files with cat Awk, doing so may not always be necessary -- and is often a pain. Most Reading text streams in things you'll ever need are equally possible -- and lots easier -- with the sort command, which can sort lines in more than one file, merge files, and chunks with head and tail even check to see if sorting them is necessary. You can specify sort keys Subscribe to the (portions of lines used for comparisons) or not, in which case sort just developerWorks newsletter compares whole lines. Also in the Linux zone: So, if you want to sort your password file, you could just use the following. Tutorials (Note that you cannot send the output straight to the input file, because it will corrupt the input file. That's why you need to send it to a temporary file Tools and products and then rename that file to /etc/passwd -- as shown below.) Code and components Listing 1. Simple sort Articles $ su - # sort /etc/passwd > /etc/passwd-new # mv /etc/passwd-new /etc/passwd -r Should you want to reverse the order of sorting, use the option. You More on sort and tsort -u can also suppress printing of identical lines with the option. Follow along in the man A very practical feature of sort is its ability to sort using field keys. A page by opening the GNU field is a string of text separated from other fields with a certain single manual's pages on sort character. For example, the fields in /etc/passwd are separated with a operations, or view these colon (:). So, if you wanted, you could sort /etc/passwd by the user ID, options in your man or info group ID, comments field, home catalog, or shell. To do this, use the -t pages in a new terminal option followed by the character used as the separator, and the number of window by typing man the field that will be used as the sort key followed by the number of the sort or man tsort at the last field where the key will end; for example, sort -t : -k 5,5 command line. /etc/passwd sorts the password file by the comment field, which is the place where full user names like "John Smith" are stored. But sort -t : -k 3,4 /etc/passwd sorts the same file using both the user ID and the group ID. If you omit the second number, sort will assume that the key starts at the given field and continues to the end of each line. Try this yourself, and observe the differences. (When numeric sorting looks wrong, add the -g option). Also, note that a whitespace transition is the default separator -- so if fields are already separated by blank characters, you may omit the separator and use -t alone. (Notice also that numbering of fields starts with 1.) For even finer control, you can use keys and offsets. Offsets are separated from keys with a dot, as in -k 1.3,5.7, which means that the sort key should start on the third character of the first field, and end at the seventh character of the fifth field (offsets too are numbered from 1). When would you need this? Well, I use it from time to time for sorting Apache logs; the key and offset notation lets me skip the date fields. Another option to watch out for is -b, which tells sort to ignore blank characters (spaces, tabs, etc.) and treat the first non-blank character on the line as the start of the sort key. Also, if you use that option, offsets will be counted from the first non-blank character (useful when the field separator is not a blank character and when the fields may contain strings starting with blank characters). Further modifications of the sorting algorithm are possible with these options: -d (use only letters, digits, and blanks for sort keys), -f (turn off case recognition and treat lowercase and uppercase characters as identical), -i (ignores non-printing ASCII characters), -M (sorts lines using three-letter abbreviations of month names: JAN, FEB, MAR, ...), -n (sorts lines using only digits, -, and commas, or other thousands separator). These options, as well as -b and -r, can be used as part of a key number, in which case they apply to that key only and not globally, like they do when they are used outside key definitions. As an example of the use of a key number, consider: sort -t: -k 4g,4 -k 3gr,3 /etc/passwd This will sort the passwd file by group ID and within groups by userid, backwards. But that's not all that sort is capable of. It can also resolve ties that happen when the keys you used cannot be used to decide which line is first. To add hints for resolving ties, add another -k option and follow it with the field and (optional) offset, using the same notation as the one you used for defining keys; for example, sort -k 3.4,4.5 -k 7.3,9.4 /etc/passwd sorts lines using keys that begin at the fourth character of the third key and end at the fifth character of the fourth key and use the third character of the seventh field and the fourth character of the ninth field to resolve ties. The last group of options deals with input, output, and temporary files. For example, the -c option, when used in sort -c < file, checks if the input file has been sorted yet (you can use other options as well), and if it has, reports an error. This is handy for making checks before processing large files that may take a long time to sort. When you use the -u option together with the -c option, it will be interpreted as a request to check that there are no two identical line in the input file. Also important when you are processing large files is the -T option used to specify an alternative directory for temporary files (they are removed after sort finishes work) instead of the default /tmp. You can use sort to process more than one file at a time, and there are basically two ways to do it: you can use cat to concatenate them first, as in: cat file1 file2 file3 | sort > outfile Or, you could use this command: sort -m file1 file2 file3 > outfile There is one condition in the second case: each input file must be sorted before they are all sent to sort -m together. That may look like an unnecessary burden, but in fact it speeds up work and saves precious system resources. Oh, and don't forget the -m option. You can use the -u option here to suppress printing of identical lines. If you need a more esoteric kind of sort routine, you might want to check out the tsort command, which performs a topological sort on a file. The difference between a topological and standard sort is shown in Listing 2 (you can download happybirthday.txt from Resources). Listing 2. Difference between topological and standard sort $ cat happybirthday.txt Happy Birthday to You! Happy Birthday to You! Happy Birthday Dear Tux! Happy Birthday to You! $ sort happybirthday.txt Happy Birthday Dear Tux! Happy Birthday to You! Happy Birthday to You! Happy Birthday to You! $ tsort happybirthday.txt Dear Happy to Tux! Birthday You! Of course, that isn't a very useful demonstration of what you'd use tsort for -- just an illustration of how different the output of the two commands is. tsort is generally used for solving a logic problem in which it's necessary to predict a total order from observed partial orders; for example, (from the tsort info page): tsort <<EOF a b c d e f b c d e EOF will produce the output a b c d e f Questions or comments? I'd love to hear from you -- send mail to [email protected]. Next time, we'll delve into tr. Resources ● Download the example file for Listing 2, happybirthday.txt. ● Find even more info on these useful tools in the GNU text utilities manual. (An expanded view of the same TOC lives at MIT, where you can also find this great list of even more useful GNU tools.) ● Windows users can find these tools in the Cygwin package. ● Mac OS X users may want to try Fink, which installs a rich UNIX environment under the sleek new Mac OS X. ● Something just not working for you? Try checking the Frequently asked questions for GNU textutils. ● Need more introductory info before delving in to the tools we've covered here? Try starting with UNIXhelp for users. ● Of course, the classic work in this field is Unix Power Tools, from O'Reilly and Associates (Jerry Peek, Tim O'Reilly, and Mike Loukides: 1997; ISBN 1-56592-260-3). ● Lest we forget, the Jargon File has an amusing entry on the topic of sorting.
Recommended publications
  • The AWK Programming Language
    The Programming ~" ·. Language PolyAWK- The Toolbox Language· Auru:o V. AHo BRIAN W.I<ERNIGHAN PETER J. WEINBERGER TheAWK4 Programming~ Language TheAWI(. Programming~ Language ALFRED V. AHo BRIAN w. KERNIGHAN PETER J. WEINBERGER AT& T Bell Laboratories Murray Hill, New Jersey A ADDISON-WESLEY•• PUBLISHING COMPANY Reading, Massachusetts • Menlo Park, California • New York Don Mills, Ontario • Wokingham, England • Amsterdam • Bonn Sydney • Singapore • Tokyo • Madrid • Bogota Santiago • San Juan This book is in the Addison-Wesley Series in Computer Science Michael A. Harrison Consulting Editor Library of Congress Cataloging-in-Publication Data Aho, Alfred V. The AWK programming language. Includes index. I. AWK (Computer program language) I. Kernighan, Brian W. II. Weinberger, Peter J. III. Title. QA76.73.A95A35 1988 005.13'3 87-17566 ISBN 0-201-07981-X This book was typeset in Times Roman and Courier by the authors, using an Autologic APS-5 phototypesetter and a DEC VAX 8550 running the 9th Edition of the UNIX~ operating system. -~- ATs.T Copyright c 1988 by Bell Telephone Laboratories, Incorporated. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopy­ ing, recording, or otherwise, without the prior written permission of the publisher. Printed in the United States of America. Published simultaneously in Canada. UNIX is a registered trademark of AT&T. DEFGHIJ-AL-898 PREFACE Computer users spend a lot of time doing simple, mechanical data manipula­ tion - changing the format of data, checking its validity, finding items with some property, adding up numbers, printing reports, and the like.
    [Show full text]
  • GNU Coreutils Cheat Sheet (V1.00) Created by Peteris Krumins ([email protected], -- Good Coders Code, Great Coders Reuse)
    GNU Coreutils Cheat Sheet (v1.00) Created by Peteris Krumins ([email protected], www.catonmat.net -- good coders code, great coders reuse) Utility Description Utility Description arch Print machine hardware name nproc Print the number of processors base64 Base64 encode/decode strings or files od Dump files in octal and other formats basename Strip directory and suffix from file names paste Merge lines of files cat Concatenate files and print on the standard output pathchk Check whether file names are valid or portable chcon Change SELinux context of file pinky Lightweight finger chgrp Change group ownership of files pr Convert text files for printing chmod Change permission modes of files printenv Print all or part of environment chown Change user and group ownership of files printf Format and print data chroot Run command or shell with special root directory ptx Permuted index for GNU, with keywords in their context cksum Print CRC checksum and byte counts pwd Print current directory comm Compare two sorted files line by line readlink Display value of a symbolic link cp Copy files realpath Print the resolved file name csplit Split a file into context-determined pieces rm Delete files cut Remove parts of lines of files rmdir Remove directories date Print or set the system date and time runcon Run command with specified security context dd Convert a file while copying it seq Print sequence of numbers to standard output df Summarize free disk space setuidgid Run a command with the UID and GID of a specified user dir Briefly list directory
    [Show full text]
  • Constraints in Dynamic Symbolic Execution: Bitvectors Or Integers?
    Constraints in Dynamic Symbolic Execution: Bitvectors or Integers? Timotej Kapus, Martin Nowack, and Cristian Cadar Imperial College London, UK ft.kapus,m.nowack,[email protected] Abstract. Dynamic symbolic execution is a technique that analyses programs by gathering mathematical constraints along execution paths. To achieve bit-level precision, one must use the theory of bitvectors. However, other theories might achieve higher performance, justifying in some cases the possible loss of precision. In this paper, we explore the impact of using the theory of integers on the precision and performance of dynamic symbolic execution of C programs. In particular, we compare an implementation of the symbolic executor KLEE using a partial solver based on the theory of integers, with a standard implementation of KLEE using a solver based on the theory of bitvectors, both employing the popular SMT solver Z3. To our surprise, our evaluation on a synthetic sort benchmark, the ECA set of Test-Comp 2019 benchmarks, and GNU Coreutils revealed that for most applications the integer solver did not lead to any loss of precision, but the overall performance difference was rarely significant. 1 Introduction Dynamic symbolic execution is a popular program analysis technique that aims to systematically explore all the paths in a program. It has been very successful in bug finding and test case generation [3, 4]. The research community and industry have produced many tools performing symbolic execution, such as CREST [5], FuzzBALL [9], KLEE [2], PEX [14], and SAGE [6], among others. To illustrate how dynamic symbolic execution works, consider the program shown in Figure 1a.
    [Show full text]
  • 07 07 Unixintropart2 Lucio Week 3
    Unix Basics Command line tools Daniel Lucio Overview • Where to use it? • Command syntax • What are commands? • Where to get help? • Standard streams(stdin, stdout, stderr) • Pipelines (Power of combining commands) • Redirection • More Information Introduction to Unix Where to use it? • Login to a Unix system like ’kraken’ or any other NICS/ UT/XSEDE resource. • Download and boot from a Linux LiveCD either from a CD/DVD or USB drive. • http://www.puppylinux.com/ • http://www.knopper.net/knoppix/index-en.html • http://www.ubuntu.com/ Introduction to Unix Where to use it? • Install Cygwin: a collection of tools which provide a Linux look and feel environment for Windows. • http://cygwin.com/index.html • https://newton.utk.edu/bin/view/Main/Workshop0InstallingCygwin • Online terminal emulator • http://bellard.org/jslinux/ • http://cb.vu/ • http://simpleshell.com/ Introduction to Unix Command syntax $ command [<options>] [<file> | <argument> ...] Example: cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file target_file Introduction to Unix What are commands? • An executable program (date) • A command built into the shell itself (cd) • A shell program/function • An alias Introduction to Unix Bash commands (Linux) alias! crontab! false! if! mknod! ram! strace! unshar! apropos! csplit! fdformat! ifconfig! more! rcp! su! until! apt-get! cut! fdisk! ifdown! mount! read! sudo! uptime! aptitude! date! fg! ifup! mtools! readarray! sum! useradd! aspell! dc! fgrep! import! mtr! readonly! suspend! userdel! awk! dd! file! install! mv! reboot! symlink!
    [Show full text]
  • An Introduction to Ocaml
    An Introduction to OCaml Stephen A. Edwards Columbia University Spring 2021 The Basics Functions Tuples, Lists, and Pattern Matching User-Defined Types Modules and Compilation A Complete Interpreter in Three Slides Exceptions; Directed Graphs Standard Library Modules An Endorsement? A PLT student accurately summed up using OCaml: Never have I spent so much time writing so little that does so much. I think he was complaining, but I’m not sure. Other students have said things like It’s hard to get it to compile, but once it compiles, it works. Why OCaml? It’s Great for Compilers � I’ve written compilers in C++, Python, Java, and OCaml, and it’s much easier in OCaml. It’s Succinct � Would you prefer to write 10 000 lines of code or 5 000? Its Type System Catches Many Bugs � It catches missing cases, data structure misuse, certain off-by-one errors, etc. Automatic garbage collection and lack of null pointers makes it safer than Java. Lots of Libraries � All sorts of data structures, I/O, OS interfaces, graphics, support for compilers, etc. Lots of Support � Many websites, free online books and tutorials, code samples, etc. OCaml in One Slide Apply a function to each list element; save results in a list “Is recursive” Passing a function Case Pattern splitting # let rec map f = function Matching [] -> [] Polymorphic Local name | head :: tail -> declaration let r = f head in Types inferred r :: map f tail;; List support val map : (’a -> ’b) -> ’a list -> ’b list Recursion # map (function x -> x + 3) [1;5;9];; Anonymous - : int list = [4; 8; 12]
    [Show full text]
  • Gnu Coreutils Core GNU Utilities for Version 5.93, 2 November 2005
    gnu Coreutils Core GNU utilities for version 5.93, 2 November 2005 David MacKenzie et al. This manual documents version 5.93 of the gnu core utilities, including the standard pro- grams for text and file manipulation. Copyright c 1994, 1995, 1996, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled “GNU Free Documentation License”. Chapter 1: Introduction 1 1 Introduction This manual is a work in progress: many sections make no attempt to explain basic concepts in a way suitable for novices. Thus, if you are interested, please get involved in improving this manual. The entire gnu community will benefit. The gnu utilities documented here are mostly compatible with the POSIX standard. Please report bugs to [email protected]. Remember to include the version number, machine architecture, input files, and any other information needed to reproduce the bug: your input, what you expected, what you got, and why it is wrong. Diffs are welcome, but please include a description of the problem as well, since this is sometimes difficult to infer. See section “Bugs” in Using and Porting GNU CC. This manual was originally derived from the Unix man pages in the distributions, which were written by David MacKenzie and updated by Jim Meyering.
    [Show full text]
  • The Top 7000+ Pop Songs of All-Time 1900-2017
    The Top 7000+ Pop Songs of All-Time 1900-2017 Researched, compiled, and calculated by Lance Mangham Contents • Sources • The Top 100 of All-Time • The Top 100 of Each Year (2017-1956) • The Top 50 of 1955 • The Top 40 of 1954 • The Top 20 of Each Year (1953-1930) • The Top 10 of Each Year (1929-1900) SOURCES FOR YEARLY RANKINGS iHeart Radio Top 50 2018 AT 40 (Vince revision) 1989-1970 Billboard AC 2018 Record World/Music Vendor Billboard Adult Pop Songs 2018 (Barry Kowal) 1981-1955 AT 40 (Barry Kowal) 2018-2009 WABC 1981-1961 Hits 1 2018-2017 Randy Price (Billboard/Cashbox) 1979-1970 Billboard Pop Songs 2018-2008 Ranking the 70s 1979-1970 Billboard Radio Songs 2018-2006 Record World 1979-1970 Mediabase Hot AC 2018-2006 Billboard Top 40 (Barry Kowal) 1969-1955 Mediabase AC 2018-2006 Ranking the 60s 1969-1960 Pop Radio Top 20 HAC 2018-2005 Great American Songbook 1969-1968, Mediabase Top 40 2018-2000 1961-1940 American Top 40 2018-1998 The Elvis Era 1963-1956 Rock On The Net 2018-1980 Gilbert & Theroux 1963-1956 Pop Radio Top 20 2018-1941 Hit Parade 1955-1954 Mediabase Powerplay 2017-2016 Billboard Disc Jockey 1953-1950, Apple Top Selling Songs 2017-2016 1948-1947 Mediabase Big Picture 2017-2015 Billboard Jukebox 1953-1949 Radio & Records (Barry Kowal) 2008-1974 Billboard Sales 1953-1946 TSort 2008-1900 Cashbox (Barry Kowal) 1953-1945 Radio & Records CHR/T40/Pop 2007-2001, Hit Parade (Barry Kowal) 1953-1935 1995-1974 Billboard Disc Jockey (BK) 1949, Radio & Records Hot AC 2005-1996 1946-1945 Radio & Records AC 2005-1996 Billboard Jukebox
    [Show full text]
  • A Quickie Intro to UNIX, Linux, Macosx the Filesystem + Some Tools
    Introduction to UNIX Notes . Alistair Blachford A Quickie Intro to UNIX, Linux, MacOSX The Filesystem + some tools For Snooping Around 1) pwd • print the working directory 2) ls • list names of the files and subdirectories in the current directory ? ls -F list directory contents, with terminating marks to indicate subdirectories and executable files. ? ls -a list all files, even those begining with a ‘.’ ? ls -l list files in ‘long’ form giving a lot of information about each one 3) cd dirname • change the current working directory to dirname ? cd data.d change whatever the current working directory is to the directory data.d. This example assumes data.d is a subdirectory (child) of the current directory. ? cd .. change working directory to the one immediately above (parent). ? cd cd with no arguments means go to the default place — your home directory 4) who • print the list of users currently logged onto this computer 5) date • print the date and time 6) cat filename... • “copy all text” of filename(s) to the screen. When more than one filename is given, the files are concatenated end-to-end. 7) more filename • will “cat” a file to the screen, one screenfull at a time. Hit <return> to advance by only one line, <space bar> to advance by a screenfull, and <q> to quit. 8) file filename • this will make a good guess at what is contained in the file filename. Some possible responses are: binary data, ASCII text, C program text, shell commands text. 1 Introduction to UNIX Notes . Alistair Blachford For Shuffling Files 9) rm file.
    [Show full text]
  • Tsort: the Most Flexible Robotic Sortation System HOW FLEXIBLE IS YOUR SUPPLY CHAIN?
    Flexible. Simple. Powerful. tSort: The Most Flexible Robotic Sortation System HOW FLEXIBLE IS YOUR SUPPLY CHAIN? tSort, tSort Plus and tSort Mini - the warehouse sortation system unlike any other. Our new, innovative technology is building world-class supply chains while providing unmatched flexibility, speed, and scalability. Modularity ensures the perfect fit for everything from large FCs and DCs, down to a retail backrooms. E-commerce, store replenishment, returns, BOPIS and much more. Quickly deployed, configurable, portable. Flexible robotics innovation. Features & Benefits Optimal Flexibility - Flexible for any flow, process, SKU set, volume and any changes that may arise in business requirements. Unit and parcel sortation separately or combined. Broad Product Line – Three base sort models and robust features for a wide range of applications, products and process flows High Capacity & Capabilities – Higher capacity than a single traditional system with more robust features and abilities not found in competitors. Portable – A system can be relocated easily in a short time and there are no permits, electrical or sprinkler constraints. Less Space – Typically < 25% of traditional sortation space. Modular, Scalable & Configurable - Robots and all elements can be added at any time, in any space, and into any shape to meet peaks or increase throughput. Entire system has plug and play design. Low Cost & Low Labor – 40% to 50% less than traditional tilt tray or crossbelt systems. t-Sort system provides significantly improved productivity - picking has larger batches and induct / sort is more efficient. Range of Products – Handles a wide variety of products including apparel, shoe boxes, general merchandise, shipping bags and small-to-medium sized boxes.
    [Show full text]
  • GPL-3-Free Replacements of Coreutils 1 Contents
    GPL-3-free replacements of coreutils 1 Contents 2 Coreutils GPLv2 2 3 Alternatives 3 4 uutils-coreutils ............................... 3 5 BSDutils ................................... 4 6 Busybox ................................... 5 7 Nbase .................................... 5 8 FreeBSD ................................... 6 9 Sbase and Ubase .............................. 6 10 Heirloom .................................. 7 11 Replacement: uutils-coreutils 7 12 Testing 9 13 Initial test and results 9 14 Migration 10 15 Due to the nature of Apertis and its target markets there are licensing terms that 1 16 are problematic and that forces the project to look for alternatives packages. 17 The coreutils package is good example of this situation as its license changed 18 to GPLv3 and as result Apertis cannot provide it in the target repositories and 19 images. The current solution of shipping an old version which precedes the 20 license change is not tenable in the long term, as there are no upgrades with 21 bugfixes or new features for such important package. 22 This situation leads to the search for a drop-in replacement of coreutils, which 23 need to provide compatibility with the standard GNU coreutils packages. The 24 reason behind is that many other packages rely on the tools it provides, and 25 failing to do that would lead to hard to debug failures and many custom patches 26 spread all over the archive. In this regard the strict requirement is to support 27 the features needed to boot a target image with ideally no changes in other 28 components. The features currently available in our coreutils-gplv2 fork are a 29 good approximation. 30 Besides these specific requirements, the are general ones common to any Open 31 Source Project, such as maturity and reliability.
    [Show full text]
  • LINUX Commands
    LINUX Commands alias Create an alias apropos Search Help manual pages (man -k) awk Find and Replace text, database sort/validate/index break Exit from a loop builtin Run a shell builtin bzip2 Compress or decompress named file(s) cal Display a calendar case Conditionally perform a command cat Display the contents of a file cd Change Directory cfdisk Partition table manipulator for Linux chgrp Change group ownership chmod Change access permissions chown Change file owner and group chroot Run a command with a different root directory cksum Print CRC checksum and byte counts clear Clear terminal screen cmp Compare two files comm Compare two sorted files line by line command Run a command - ignoring shell functions continue Resume the next iteration of a loop cp Copy one or more files to another location cron Daemon to execute scheduled commands crontab Schedule a command to run at a later time csplit Split a file into context-determined pieces cut Divide a file into several parts date Display or change the date & time dc Desk Calculator dd Data Dump - Convert and copy a file ddrescue Data recovery tool declare Declare variables and give them attributes df Display free disk space diff Display the differences between two files diff3 Show differences among three files dig DNS lookup dir Briefly list directory contents dircolors Colour setup for `ls' dirname Convert a full pathname to just a path dirs Display list of remembered directories du Estimate file space usage echo Display message on screen egrep Search file(s) for lines that match an
    [Show full text]
  • GNU Coreutils Core GNU Utilities for Version 9.0, 20 September 2021
    GNU Coreutils Core GNU utilities for version 9.0, 20 September 2021 David MacKenzie et al. This manual documents version 9.0 of the GNU core utilities, including the standard pro- grams for text and file manipulation. Copyright c 1994{2021 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled \GNU Free Documentation License". i Short Contents 1 Introduction :::::::::::::::::::::::::::::::::::::::::: 1 2 Common options :::::::::::::::::::::::::::::::::::::: 2 3 Output of entire files :::::::::::::::::::::::::::::::::: 12 4 Formatting file contents ::::::::::::::::::::::::::::::: 22 5 Output of parts of files :::::::::::::::::::::::::::::::: 29 6 Summarizing files :::::::::::::::::::::::::::::::::::: 41 7 Operating on sorted files ::::::::::::::::::::::::::::::: 47 8 Operating on fields ::::::::::::::::::::::::::::::::::: 70 9 Operating on characters ::::::::::::::::::::::::::::::: 80 10 Directory listing:::::::::::::::::::::::::::::::::::::: 87 11 Basic operations::::::::::::::::::::::::::::::::::::: 102 12 Special file types :::::::::::::::::::::::::::::::::::: 125 13 Changing file attributes::::::::::::::::::::::::::::::: 135 14 File space usage ::::::::::::::::::::::::::::::::::::: 143 15 Printing text :::::::::::::::::::::::::::::::::::::::
    [Show full text]