Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there replacement for cat on Windows

I need to join two binary files with a *.bat script on Windows.

How can I achieve that?

like image 601
Artem Tikhomirov Avatar asked Sep 13 '08 01:09

Artem Tikhomirov


People also ask

Does cat work in PowerShell?

The cat command in Linux is used to concatenate files and print to a standard output. The type command is a Windows cat equivalent that works across a command-line prompt (CMD) and a Windows PowerShell.

What is cat command in command prompt?

The cat (short for “concatenate“) command is one of the most frequently used commands in Linux/Unix-like operating systems. cat command allows us to create single or multiple files, view content of a file, concatenate files and redirect output in terminal or files.

Is there a grep for Windows?

The findstr command is a Windows grep equivalent in a Windows command-line prompt (CMD). In a Windows PowerShell the alternative for grep is the Select-String command.

What is rm command in Windows?

Use the rm command to remove files you no longer need. The rm command removes the entries for a specified file, group of files, or certain select files from a list within a directory.


2 Answers

Windows type command works similarly to UNIX cat.

Example 1:

type file1 file2 > file3 

is equivalent of:

cat file1 file2 > file3 

Example 2:

type  *.vcf > all_in_one.vcf   

This command will merge all the vcards into one.

like image 134
Nathan Jones Avatar answered Sep 20 '22 21:09

Nathan Jones


You can use copy /b like this:

copy /b file1+file2 destfile 
like image 24
Greg Hewgill Avatar answered Sep 17 '22 21:09

Greg Hewgill