LinuxCommandLibrary

exch

utility to swap two file paths

TLDR

Swap filepaths of two files
$ exch [path/to/file1] [path/to/file2]
copy

SYNOPSIS

exch file1 file2

DESCRIPTION

exch swaps the filepaths and filenames of two files. After the operation, file1 will have the contents that were at file2's path and vice versa.
Useful for quickly swapping configuration files or backups.

PARAMETERS

file1

First file to swap
file2
Second file to swap

CAVEATS

Both files must exist. Atomic operation using rename(). Files must be on the same filesystem.

SEE ALSO

mv(1), cp(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard