↑ ↓ select, Enter open, Esc close

Put two files side by side line by line

Adjust the values, the command updates live
user@server
paste -d ';' domains.txt ips.txt

Reads both files in parallel and prints line 1 of the first next to line 1 of the second, and so on. If one file is shorter, the missing fields stay empty. Conversely, paste -sd ',' datei turns all lines of a file into a single comma-separated line.

Note: Lines are matched only by their position. To combine lines by a common key, join is the right tool.

Also searched as

  • merge two files side by side linux
  • combine two lists into columns
  • join lines of a file into one line

Related one-liners

All in Text processing

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.