Sortix rw is a program that reads blocks from the standard input and copies them to the standard output until the end of the standard input. rw(1) is designed to be a replacement for dd(1), providing only the the core blockwise I/O. It has a standard command line interface with dashed options, useful and efficient defaults, and is simpler because it doesn't support converting the input (e.g. converting ASCII to/from EBCDIC).
rw is developed as part of the Sortix operating system and comes with Sortix. rw compiles and works on at least DragonFly, Haiku, Hurd, Illumos, Linux, macOS, Midipix, Minix, NetBSD, OpenBSD, Sortix, and Windows Subsystem for Linux.
The latest version of rw is 1.0, released April 2018. The version number increments by 0.1 on every release. rw is licensed under the ISC license.
The latest rw documentation can be found in the rw(1) Sortix manual.
rw has been packaged for the following operating systems:
- Arch Linux:
pacaur -S rw.
pkg install rw(Temporarily 2018-04-21: You may need to switch url to from
port install rw.
- Midipix: rw is part of the base Midipix system.
- OpenBSD: A draft
sysutils/rwhas been proposed.
- Sortix: rw is part of the base system as of Sortix 1.1 (upcoming release).
- Void Linux:
xbps-install -S rw.
- Other systems: No known package is available, you need to compile and install the source code yourself. If you'd like to maintain a port of rw for an operating system, please let me know so I can mention it here.
The latest rw-portable source code release is rw-portable-1.0.tar.gz.
Always verify you are viewing this page over HTTPS and that
rw-portable-1.0.tar.gz has the correct cryptographic SHA256
hash by running:
sha256sum -c << EOF 50009730e36991dfe579716f91f4f616f5ba05ffb7bf69c03d41bf305ed93b6d rw-portable-1.0.tar.gz EOF
Instructions on how to compile rw using make can be found in the included
The latest upstream rw source code can be found in rw/rw.c in the Sortix source code.
Differences from dd
rw is similar to dd(1), but has a distinct design and improvements:
- The command line options use the conventional option format.
- The output file is not truncated by default. One has to use
- The input and output block sizes default to the preferred I/O block sizes instead of 512 bytes.
-Ooptions accept byte quantities by default instead of block counts, but can be specified in block counts by using the ‘r, w’, and ‘x’ suffixes.
- Statistics are not written by default. One has to use
-p. The statistics contain more useful information and is machine readable as it contains no localized information. A human readable statistics format is available using
-h. Statistics can occasionally be written out using
- There is no support for converting ASCII to EBCDIC, converting ASCII to a different EBCDIC, EBCDIC to ASCII, swapping pairs of bytes, converting the bytes to lower-case or upper-case, converting line-delimited data into fixed-size blocks, or converting fixed-sized blocks into line-delimited data.
- Offsets can be specified relative to the end of the input/output.
- Input errors stop the copying immediately rather than writing out a partial output block.
rw is not yet able to determine the size of block devices on Illumos, Minix, NetBSD, and OpenBSD.
rw does not handle tape archives specially, as dd does on some operating systems.
rw does not support copying sparse files, a feature found on some operating systems.
rw does not work around buggy operating systems that may report the preferred IO
st_blksize as 0 for some files.