Graph (Unix)

Last updated
graph
Original author(s) Douglas McIlroy
(AT&T Bell Laboratories)
Developer(s) Various open-source and commercial developers
Operating system Unix, Unix-like
Platform Cross-platform
Type Command

In Unix, graph is a command-line utility used to draw plots from tabular data.

Contents

History

The graph utility, written by Douglas McIlroy, was present in the first version of Unix, and every later version, for instance:

Its output is a sequence of commands for the plot utility, which creates plots using ASCII graphics.

This design demonstrates the Unix philosophy: defining the plot (graph) and drawing it (plot) are separate tools, so they can be recombined with other tools. For instance, plot can be substituted with a different utility, that accepts the same plot commands, but creates the plot in a graphics file format, or sends it to a plotter.

Unix v7 also provided device drivers for plotting the results to various graphics devices; [3] this was announced as now standard. [4]

The GNU plotutils package provides a free non-exact reimplementation, available for Linux and many other systems. It can create plots in various graphics formats.

Usage

In its simplest use, the graph utility takes a textfile containing pairs of numbers, indicating the points of a line plot.

It outputs the line plot. Several options can be supplied to modify its behavior.

Example (Unix)

These screenshots demonstrate basic operation on SunOS 5.10, on which graph and plot come preinstalled. The example input is from the first example in the GNU plotutils manual.

Example (GNU plotutils)

These screenshots demonstrate the GNU plotutils version of graph when run in an xterm, exploiting xterm's ability to emulate a Tektronix 4010 plotter.

This demo was run on Ubuntu, which makes GNU plotutils available as an optional package; many other Linux distributions and other Unix-like systems do the same.

Related Research Articles

The Single UNIX Specification (SUS) is a standard for computer operating systems, compliance with which is required to qualify for using the "UNIX" trademark. The standard specifies programming interfaces for the C language, a command-line shell, and user commands. The core specifications of the SUS known as Base Specifications are developed and maintained by the Austin Group, which is a joint working group of IEEE, ISO/IEC JTC 1/SC 22/WG 15 and The Open Group. If an operating system is submitted to The Open Group for certification, and passes conformance tests, then it is deemed to be compliant with a UNIX standard such as UNIX 98 or UNIX 03.

gnuplot Command-line and GUI plotting program

gnuplot is a command-line and GUI program that can generate two- and three-dimensional plots of functions, data, and data fits. The program runs on all major computers and operating systems . Originally released in 1986, its listed authors are Thomas Williams, Colin Kelley, Russell Lang, Dave Kotz, John Campbell, Gershon Elber, Alexander Woo "and many others." Despite its name, this software is not part of the GNU Project.

uniq is a utility command on Unix, Plan 9, Inferno, and Unix-like operating systems which, when fed a text file or standard input, outputs the text with adjacent identical lines collapsed to one, unique line of text.

In software development, Make is a build automation tool that builds executable programs and libraries from source code by reading files called makefiles which specify how to derive the target program. Though integrated development environments and language-specific compiler features can also be used to manage a build process, Make remains widely used, especially in Unix and Unix-like operating systems.

uname Standard UNIX utility that prints name and other details about the machine

uname is a computer program in Unix and Unix-like computer operating systems that prints the name, version and other details about the current machine and the operating system running on it.

dd is a command-line utility for Unix, Plan 9, Inferno, and Unix-like operating systems and beyond, the primary purpose of which is to convert and copy files. On Unix, device drivers for hardware and special device files appear in the file system just like normal files; dd can also read and/or write from/to these files, provided that function is implemented in their respective driver. As a result, dd can be used for tasks such as backing up the boot sector of a hard drive, and obtaining a fixed amount of random data. The dd program can also perform conversions on the data as it is copied, including byte order swapping and conversion to and from the ASCII and EBCDIC text encodings.

join is a command in Unix and Unix-like operating systems that merges the lines of two sorted text files based on the presence of a common field. It is similar to the join operator used in relational databases but operating on text files.

tr (Unix) Unix text formatting utility

tr is a command in Unix, Plan 9, Inferno, and Unix-like operating systems. It is an abbreviation of translate or transliterate, indicating its operation of replacing or removing specific characters in its input data set.

wc (Unix) Unix command utility

wc is a command in Unix, Plan 9, Inferno, and Unix-like operating systems. The program reads either standard input or a list of computer files and generates one or more of the following statistics: newline count, word count, and byte count. If a list of files is provided, both individual file and total statistics follow.

pax is an archiving utility available for various operating systems and defined since 1995. Rather than sort out the incompatible options that have crept up between tar and cpio, along with their implementations across various versions of Unix, the IEEE designed new archive utility pax that could support various archive formats with useful options from both archivers. The pax command is available on Unix and Unix-like operating systems and on IBM i, and Microsoft Windows NT until Windows 2000.

cksum Unix command

cksum is a command in Unix and Unix-like operating systems that generates a checksum value for a file or stream of data. The cksum command reads each file given in its arguments, or standard input if no arguments are provided, and outputs the file's 32-bit cyclic redundancy check (CRC) checksum and byte count. The CRC output by cksum is different from the CRC-32 used in zip, PNG and zlib.

nl is a Unix utility for numbering lines, either from a file or from standard input, reproducing output on standard output.

cmp (Unix)

In computing, cmp is a command-line utility on Unix and Unix-like operating systems that compares two files of any type and writes the results to the standard output. By default, cmp is silent if the files are the same; if they differ, the byte and line number at which the first difference occurred is reported. The command is also available in the OS-9 shell.

tail is a program available on Unix, Unix-like systems, FreeDOS and MSX-DOS used to display the tail end of a text file or piped data.

In computing, tee is a command in command-line interpreters (shells) using standard streams which reads standard input and writes it to both standard output and one or more files, effectively duplicating its input. It is primarily used in conjunction with pipes and filters. The command is named after the T-splitter used in plumbing.

cpio is a general file archiver utility and its associated file format. It is primarily installed on Unix-like computer operating systems. The software utility was originally intended as a tape archiving program as part of the Programmer's Workbench (PWB/UNIX), and has been a component of virtually every Unix operating system released thereafter. Its name is derived from the phrase copy in and out, in close description of the program's use of standard input and standard output in its operation.

<span class="mw-page-title-main">Graphics Layout Engine</span> Graphics programming language

Graphics Layout Engine (GLE) is a graphics scripting language designed for creating publication quality graphs, plots, diagrams, figures and slides. GLE supports various graph types such as function plots, histograms, bar graphs, scatter plots, contour lines, color maps and surface plots through a simple but flexible set of graphing commands. More complex output can be created by relying on GLE's scripting language, which is full featured with subroutines, variables, and logic control. GLE relies on LaTeX for text output and supports mathematical formula in graphs and figures. GLE's output formats include EPS, PS, PDF, JPEG, and PNG.

GNU plotutils is a set of free software command-line tools and software libraries for generating 2D plot graphics based on data sets. It is used in projects such as PSPP and UMLgraph, and in many areas of academic research, and is included in many Linux distributions such as Debian. Windows and Mac OS X versions are also available. The library provides bindings for the C and C++ languages. Its stand-alone command-line tools can generate graphs and perform numerical calculation of spline curves and systems of ordinary differential equations. Plotutils is a GNU package and is distributed under a free software licence, the GPL.

sar (Unix) Unix command to collect, report or save system activity information

System Activity Report (sar) is a Unix System V-derived system monitor command used to report on various system loads, including CPU activity, memory/paging, interrupts, device load, network and swap space utilization. Sar uses /proc filesystem for gathering information.

cat (Unix) Unix command utility

cat is a standard Unix utility that reads files sequentially, writing them to standard output. The name is derived from its function to (con)catenate files . It has been ported to a number of operating systems.

References

  1. "graph". Unix v7 manual pages. Bell Labs. 1979. Retrieved Nov 24, 2018.
  2. "graph". SunOS 5.10 manual pages. Sun Microsystems. 2005. Retrieved Nov 24, 2018.
  3. Herrmann, Robert B., ed. (2004). Computer programs in Seismology: CALPLOT graphics (PDF). 3.30. p. vi. Retrieved Nov 24, 2018.
  4. "7th Edition UNIX — Summary" (PDF). Murray Hill, New Jersey 07974: Bell Laboratories. September 6, 1978. p. 1. Retrieved Nov 24, 2018.{{cite news}}: CS1 maint: location (link)