\chapentry{Introduction}{1}{1} \chapentry{Common options}{2}{2} \secentry{Backup options}{2}{1}{2} \secentry{Block size}{2}{2}{3} \secentry{Target directory}{2}{3}{5} \secentry{Trailing slashes}{2}{4}{6} \secentry{Standards conformance}{2}{5}{6} \chapentry{Output of entire files}{3}{7} \secentry{\command {cat}: Concatenate and write files}{3}{1}{7} \secentry{\command {tac}: Concatenate and write files in reverse}{3}{2}{8} \secentry{\command {nl}: Number lines and write files}{3}{3}{8} \secentry{\command {od}: Write files in octal or other formats}{3}{4}{10} \chapentry{Formatting file contents}{4}{14} \secentry{\command {fmt}: Reformat paragraph text}{4}{1}{14} \secentry{\command {pr}: Paginate or columnate files for printing}{4}{2}{15} \secentry{\command {fold}: Wrap input lines to fit in specified width}{4}{3}{20} \chapentry{Output of parts of files}{5}{21} \secentry{\command {head}: Output the first part of files}{5}{1}{21} \secentry{\command {tail}: Output the last part of files}{5}{2}{21} \secentry{\command {split}: Split a file into fixed-size pieces}{5}{3}{24} \secentry{\command {csplit}: Split a file into context-determined pieces}{5}{4}{25} \chapentry{Summarizing files}{6}{27} \secentry{\code {wc}: Print byte, word, and line counts}{6}{1}{27} \secentry{\command {sum}: Print checksum and block counts}{6}{2}{28} \secentry{\command {cksum}: Print CRC checksum and byte counts}{6}{3}{28} \secentry{\command {md5sum}: Print or check message-digests}{6}{4}{28} \chapentry{Operating on sorted files}{7}{30} \secentry{\command {sort}: Sort text files}{7}{1}{30} \secentry{\command {uniq}: Uniquify files}{7}{2}{35} \secentry{\command {comm}: Compare two sorted files line by line}{7}{3}{36} \secentry{\command {tsort}: Topological sort}{7}{4}{37} \secentry{\command {tsort}: Background}{7}{5}{39} \secentry{\command {ptx}: Produce permuted indexes}{7}{6}{39} \subsecentry{General options}{7}{6}{1}{40} \subsecentry{Charset selection}{7}{6}{2}{40} \subsecentry{Word selection and input processing}{7}{6}{3}{40} \subsecentry{Output formatting}{7}{6}{4}{42} \subsecentry{The \sc {gnu} extensions to \command {ptx}}{7}{6}{5}{45} \chapentry{Operating on fields within a line}{8}{46} \secentry{\command {cut}: Print selected parts of lines}{8}{1}{46} \secentry{\command {paste}: Merge lines of files}{8}{2}{47} \secentry{\command {join}: Join lines on a common field}{8}{3}{47} \chapentry{Operating on characters}{9}{50} \secentry{\command {tr}: Translate, squeeze, and/or delete characters}{9}{1}{50} \subsecentry{Specifying sets of characters}{9}{1}{1}{50} \subsecentry{Translating}{9}{1}{2}{52} \subsecentry{Squeezing repeats and deleting}{9}{1}{3}{52} \subsecentry{Warning messages}{9}{1}{4}{54} \secentry{\command {expand}: Convert tabs to spaces}{9}{2}{54} \secentry{\command {unexpand}: Convert spaces to tabs}{9}{3}{55} \chapentry{Directory listing}{10}{56} \secentry{\command {ls}: List directory contents}{10}{1}{56} \subsecentry{Which files are listed}{10}{1}{1}{56} \subsecentry{What information is listed}{10}{1}{2}{57} \subsecentry{Sorting the output}{10}{1}{3}{60} \subsecentry{More details about version sort}{10}{1}{4}{62} \subsecentry{General output formatting}{10}{1}{5}{62} \subsecentry{Formatting file timestamps}{10}{1}{6}{64} \subsecentry{Formatting the file names}{10}{1}{7}{65} \secentry{\command {dir}: Briefly list directory contents}{10}{2}{67} \secentry{\command {vdir}: Verbosely list directory contents}{10}{3}{67} \secentry{\command {dircolors}: Color setup for \code {ls}}{10}{4}{67} \chapentry{Basic operations}{11}{68} \secentry{\command {cp}: Copy files and directories}{11}{1}{68} \secentry{\command {dd}: Convert and copy a file}{11}{2}{72} \secentry{\command {install}: Copy files and set attributes}{11}{3}{73} \secentry{\command {mv}: Move (rename) files}{11}{4}{75} \secentry{\command {rm}: Remove files or directories}{11}{5}{76} \secentry{\command {shred}: Remove files more securely}{11}{6}{77} \chapentry{Special file types}{12}{81} \secentry{\command {link}: Make a hard link via the link syscall}{12}{1}{81} \secentry{\command {ln}: Make links between files}{12}{2}{81} \secentry{\command {mkdir}: Make directories}{12}{3}{83} \secentry{\command {mkfifo}: Make FIFOs (named pipes)}{12}{4}{84} \secentry{\command {mknod}: Make block or character special files}{12}{5}{84} \secentry{\command {rmdir}: Remove empty directories}{12}{6}{85} \secentry{\command {unlink}: Remove files via the unlink syscall}{12}{7}{85} \chapentry{Changing file attributes}{13}{86} \secentry{\command {chown}: Change file owner and group}{13}{1}{86} \secentry{\command {chgrp}: Change group ownership}{13}{2}{87} \secentry{\command {chmod}: Change access permissions}{13}{3}{88} \secentry{\command {touch}: Change file timestamps}{13}{4}{89} \chapentry{Disk usage}{14}{91} \secentry{\command {df}: Report filesystem disk space usage}{14}{1}{91} \secentry{\command {du}: Estimate file space usage}{14}{2}{93} \secentry{\command {stat}: Report file or filesystem status}{14}{3}{95} \secentry{\command {sync}: Synchronize data on disk with memory}{14}{4}{96} \chapentry{Printing text}{15}{97} \secentry{\command {echo}: Print a line of text}{15}{1}{97} \secentry{\command {printf}: Format and print data}{15}{2}{97} \secentry{\command {yes}: Print a string until interrupted}{15}{3}{98} \chapentry{Conditions}{16}{99} \secentry{\command {false}: Do nothing, unsuccessfully}{16}{1}{99} \secentry{\command {true}: Do nothing, successfully}{16}{2}{99} \secentry{\command {test}: Check file types and compare values}{16}{3}{99} \subsecentry{File type tests}{16}{3}{1}{100} \subsecentry{Access permission tests}{16}{3}{2}{100} \subsecentry{File characteristic tests}{16}{3}{3}{100} \subsecentry{String tests}{16}{3}{4}{101} \subsecentry{Numeric tests}{16}{3}{5}{101} \subsecentry{Connectives for \command {test}}{16}{3}{6}{101} \secentry{\command {expr}: Evaluate expressions}{16}{4}{102} \subsecentry{String expressions}{16}{4}{1}{102} \subsecentry{Numeric expressions}{16}{4}{2}{103} \subsecentry{Relations for \command {expr}}{16}{4}{3}{103} \subsecentry{Examples of using \command {expr}}{16}{4}{4}{104} \chapentry{Redirection}{17}{105} \secentry{\command {tee}: Redirect output to multiple files}{17}{1}{105} \chapentry{File name manipulation}{18}{106} \secentry{\code {basename}: Strip directory and suffix from a file name}{18}{1}{106} \secentry{\command {dirname}: Strip non-directory suffix from a file name}{18}{2}{106} \secentry{\command {pathchk}: Check file name portability}{18}{3}{106} \chapentry{Working context}{19}{107} \secentry{\command {pwd}: Print working directory}{19}{1}{107} \secentry{\command {stty}: Print or change terminal characteristics}{19}{2}{107} \subsecentry{Control settings}{19}{2}{1}{108} \subsecentry{Input settings}{19}{2}{2}{108} \subsecentry{Output settings}{19}{2}{3}{109} \subsecentry{Local settings}{19}{2}{4}{110} \subsecentry{Combination settings}{19}{2}{5}{110} \subsecentry{Special characters}{19}{2}{6}{111} \subsecentry{Special settings}{19}{2}{7}{112} \secentry{\command {printenv}: Print all or some environment variables}{19}{3}{113} \secentry{\command {tty}: Print file name of terminal on standard input}{19}{4}{113} \chapentry{User information}{20}{114} \secentry{\command {id}: Print real and effective uid and gid}{20}{1}{114} \secentry{\command {logname}: Print current login name}{20}{2}{114} \secentry{\command {whoami}: Print effective user id}{20}{3}{114} \secentry{\command {groups}: Print group names a user is in}{20}{4}{115} \secentry{\command {users}: Print login names of users currently logged in}{20}{5}{115} \secentry{\command {who}: Print who is currently logged in}{20}{6}{115} \chapentry{System context}{21}{117} \secentry{\command {date}: Print or set system date and time}{21}{1}{117} \subsecentry{Time directives}{21}{1}{1}{117} \subsecentry{Date directives}{21}{1}{2}{118} \subsecentry{Literal directives}{21}{1}{3}{119} \subsecentry{Padding}{21}{1}{4}{119} \subsecentry{Setting the time}{21}{1}{5}{119} \subsecentry{Options for \command {date}}{21}{1}{6}{120} \subsecentry{Examples of \command {date}}{21}{1}{7}{121} \secentry{\command {uname}: Print system information}{21}{2}{122} \secentry{\command {hostname}: Print or set system name}{21}{3}{123} \secentry{\command {hostid}: Print numeric host identifier.}{21}{4}{123} \chapentry{Modified command invocation}{22}{125} \secentry{\command {chroot}: Run a command with a different root directory}{22}{1}{125} \secentry{\command {env}: Run a command in a modified environment}{22}{2}{125} \secentry{\command {nice}: Run a command with modified scheduling priority}{22}{3}{126} \secentry{\command {nohup}: Run a command immune to hangups}{22}{4}{126} \secentry{\command {su}: Run a command with substitute user and group id}{22}{5}{127} \chapentry{Process control}{23}{129} \secentry{\command {kill}: Send a signal to processes}{23}{1}{129} \chapentry{Delaying}{24}{131} \secentry{\command {sleep}: Delay for a specified time}{24}{1}{131} \chapentry{Numeric operations}{25}{132} \secentry{\command {factor}: Print prime factors}{25}{1}{132} \secentry{\command {seq}: Print numeric sequences}{25}{2}{132} \chapentry{File permissions}{26}{135} \secentry{Structure of File Permissions}{26}{1}{135} \secentry{Symbolic Modes}{26}{2}{135} \subsecentry{Setting Permissions}{26}{2}{1}{136} \subsecentry{Copying Existing Permissions}{26}{2}{2}{137} \subsecentry{Changing Special Permissions}{26}{2}{3}{137} \subsecentry{Conditional Executability}{26}{2}{4}{138} \subsecentry{Making Multiple Changes}{26}{2}{5}{138} \subsecentry{The Umask and Protection}{26}{2}{6}{139} \secentry{Numeric Modes}{26}{3}{139} \chapentry{Date input formats}{27}{141} \secentry{General date syntax}{27}{1}{141} \secentry{Calendar date items}{27}{2}{142} \secentry{Time of day items}{27}{3}{143} \secentry{Time zone items}{27}{4}{144} \secentry{Day of week items}{27}{5}{144} \secentry{Relative items in date strings}{27}{6}{144} \secentry{Pure numbers in date strings}{27}{7}{145} \secentry{Authors of \code {getdate}}{27}{8}{145} \chapentry{Opening the Software Toolbox}{28}{146} \unnumbsecentry{Toolbox Introduction}{28}{0}{146} \unnumbsecentry{I/O Redirection}{28}{0}{146} \unnumbsecentry{The \command {who} Command}{28}{0}{147} \unnumbsecentry{The \command {cut} Command}{28}{0}{148} \unnumbsecentry{The \command {sort} Command}{28}{0}{148} \unnumbsecentry{The \command {uniq} Command}{28}{0}{148} \unnumbsecentry{Putting the Tools Together}{28}{0}{148} \appendixentry{GNU Free Documentation License}{A}{154} \unnumbsecentry{ADDENDUM: How to use this License for your documents}{28}{0}{159} \unnumbchapentry{Index}{28}{160}