Команда cat linux аналог в windows

I want to do exactly what unix "cat" does, but on my PC. Is there a simple equivalent command for the Windows command line? Specifically I want to create a file from all the files of a given type...

I want to do exactly what unix «cat» does, but on my PC. Is there a simple equivalent command for the Windows command line?

Specifically I want to create a file from all the files of a given type in a folder

In Unix:

cat *fna >all_fna_files.fna

(which joins all the «.fna» text files into one big text file)

Sathyajith Bhat's user avatar

asked Jun 10, 2012 at 7:22

Kirt's user avatar

5

type

It works across command.com, cmd, and PowerShell (though in the latter it’s an alias for Get-Content, so is cat, so you could use either).
From the Wikipedia article (emphasis mine):

In computing, type is a command in various VMS. AmigaDOS, CP/M, DOS, OS/2 and Microsoft Windows command line interpreters (shells) such as COMMAND.COM, cmd.exe, 4DOS/4NT and Windows PowerShell. It is used to display the contents of specified files. It is analogous to the Unix cat command.

C:>echo hi > a.txt
C:>echo bye > b.txt
C:>type a.txt b.txt > c.txt
C:>type c.txt
hi
bye

Community's user avatar

answered Jun 10, 2012 at 7:47

ckhan's user avatar

ckhanckhan

7,4092 gold badges16 silver badges16 bronze badges

16

From the command shell:

copy a.txt + b.txt + c.txt output.txt

(But that follows the command shells use of control-Z as an end of file marker, so not suitable in some cases).

In PowerShell:

get-content a.txt,b.txt,c.txt | out-file output.txt

and you can control (using -Encoding parameter) the file encoding (which allows transcoding by using different encoding for the read and write).

answered Jun 10, 2012 at 7:33

Richard's user avatar

RichardRichard

8,9223 gold badges25 silver badges27 bronze badges

6

I have just used the cat command in DOS (Windows 7 Pro) in the following manner and successfully merged 3 files (log1.txt, log2.txt, log3.txt) into a single file:

cat log*.txt >> myBigLogFile.txt 

Note: cat log*.txt > myBigLogFile2.txt also provide the same result, but it’ll override the previous file.

kenorb's user avatar

kenorb

23.6k26 gold badges122 silver badges186 bronze badges

answered Mar 20, 2015 at 13:41

Heidi's user avatar

HeidiHeidi

671 silver badge1 bronze badge

3

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

How can I achieve that?

Demurgos's user avatar

Demurgos

1,48819 silver badges38 bronze badges

asked Sep 13, 2008 at 1:28

Artem Tikhomirov's user avatar

Artem TikhomirovArtem Tikhomirov

21.4k10 gold badges47 silver badges67 bronze badges

4

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.

Greg Dubicki's user avatar

Greg Dubicki

5,4172 gold badges54 silver badges64 bronze badges

answered Sep 13, 2008 at 1:53

Nathan Jones's user avatar

8

You can use copy /b like this:

copy /b file1+file2 destfile

answered Sep 13, 2008 at 1:29

Greg Hewgill's user avatar

Greg HewgillGreg Hewgill

927k180 gold badges1137 silver badges1275 bronze badges

3

If you have control over the machine where you’re doing your work, I highly recommend installing GnuWin32. Just «Download All» and let the wget program retrieve all the packages. You will then have access to cat, grep, find, gzip, tar, less, and hundreds of others.

GnuWin32 is one of the first things I install on a new Windows box.

answered Sep 13, 2008 at 3:45

David Citron's user avatar

David CitronDavid Citron

42.9k21 gold badges62 silver badges71 bronze badges

2

Shameless PowerShell plug (because I think the learning curve is a pain, so teaching something at any opportunity can help)

Get-Content file1,file2

Note that type is an alias for Get-Content, so if you like it better, you can write:

type file1,file2

answered Sep 13, 2008 at 2:00

Jay Bazuzi's user avatar

Jay BazuziJay Bazuzi

44.5k14 gold badges111 silver badges167 bronze badges

5

Just use the dos copy command with multiple source files and one destination file.

copy file1+file2 appendedfile

You might need the /B option for binary files

VFDan's user avatar

VFDan

81112 silver badges26 bronze badges

answered Sep 13, 2008 at 1:32

simon's user avatar

simonsimon

5,6477 gold badges30 silver badges36 bronze badges

0

In Windows 10’s Redstone 1 release, the Windows added a real Linux subsystem for the NTOS kernel. I think originally it was intended to support Android apps, and maybe docker type scenarios. Microsoft partnered with Canonical and added an actual native bash shell. Also, you can use the apt package manager to get many Ubuntu packages. For example, you can do apt-get gcc to install the GCC tool chain as you would on a Linux box.

If such a thing existed while I was in university, I think I could have done most of my Unix programming assignments in the native Windows bash shell.

answered May 17, 2016 at 20:15

sam msft's user avatar

sam msftsam msft

5035 silver badges15 bronze badges

If you simply want to append text to the end of existing file, you can use the >> pipe. ex:

echo new text >>existingFile.txt

answered May 30, 2014 at 3:49

Jahmic's user avatar

JahmicJahmic

11.2k11 gold badges65 silver badges77 bronze badges

So i was looking for a similar solution with the abillity to preserve EOL chars and found out there was no way, so i do what i do best and made my own utillity
This is a native cat executable for windows — https://mega.nz/#!6AVgwQhL!qJ1sxx-tLtpBkPIUx__iQDGKAIfmb21GHLFerhNoaWk

Usage: cat file1 file2 file3 file4 -o output.txt
-o | Specifies the next arg is the output, we must use this rather than ">>" to preserve the line endings

I call it sharp-cat as its built with C#, feel free to scan with an antivirus and source code will be made available at request

answered Jan 13, 2019 at 10:03

Ricky Divjakovski's user avatar

I try to rejoin tar archive which has been splitted in a Linux server.

And I found if I use type in Windows’s cmd.exe, it will causes the file being joined in wrong order.(i.e. type sometimes will puts XXXX.ad at first and then XXXX.ac , XXXX.aa etc …)

So, I found a tool named bat in GitHub https://github.com/sharkdp/bat which has a Windows build, and has better code highlight and the important thing is, it works fine on Windows to rejoin tar archive!

answered Nov 10, 2018 at 5:17

Aaron Xu's user avatar

1

Windows type command has problems, for example with Unicode characters on 512 bytes boundary. Try Cygwin’s cat.

answered May 13, 2020 at 14:44

user42391's user avatar

user42391user42391

211 silver badge1 bronze badge

If you have to use a batch script and have python installed here is a polyglot answer in batch and python:

1>2# : ^
'''
@echo off
python "%~nx0" " %~nx1" "%~nx2" "%~nx3"
exit /b
rem ^
'''
import sys
import os

sys.argv = [argv.strip() for argv in sys.argv]
if len(sys.argv) != 4:
    sys.exit(1)

_, file_one, file_two, out_file = sys.argv

for file_name in [file_one, file_two]:
    if not os.path.isfile(file_name):
        print "Can't find: {0}".format(file_name)
        sys.exit(1)

if os.path.isfile(out_file):
    print "Output file exists and will be overwritten"

with open(out_file, "wb") as out:
    with open(file_one, "rb") as f1:
        out.write(f1.read())

    with open(file_two, "rb") as f2:
        out.write(f2.read())

If saved as join.bat usage would be:

join.bat file_one.bin file_two.bin out_file.bin

Thanks too this answer for the inspiration.

YorSubs's user avatar

YorSubs

2,9023 gold badges31 silver badges50 bronze badges

answered Oct 15, 2014 at 13:40

Noelkd's user avatar

NoelkdNoelkd

7,5872 gold badges29 silver badges43 bronze badges

What is cat command and how to use cat in Windows or windows cat equivalent?

cat command ( short for concatenate) is one of the powerful command to create single or multiple files, view contents of the file, concatenate multiple files, copy the content to other files, and print output to terminal or file. Cat command is mostly used in Linux and other operating systems. The cat command is called cat as it is used to concatenate files. For example, to display the contents of a file, use cat filename.txt, to view the large file, use cat filename.txt | more

If you use cat command in windows cmd (command prompt/command line), it will throw an exception as ‘cat’ is not recognized as an internal or external command, operable program, or batch file.

cat command in windows cmd (command prompt)
cat command in windows cmd (command prompt)

In Microsoft Windows operating system, if you use the help cat command in windows PowerShell terminal, it gives below output

PS C:> help cat
NAME
    Get-Content

SYNTAX
    Get-Content [-Path] <string[]> [-ReadCount <long>] [-TotalCount <long>]
    [-Tail <int>] [-Filter <string>] [-Include
    <string[]>] [-Exclude <string[]>] [-Force] [-Credential <pscredential>] 
    [-UseTransaction] [-Delimiter <string>]
    [-Wait] [-Raw] [-Encoding {Unknown | String | Unicode | Byte | 
    BigEndianUnicode | UTF8 | UTF7 | UTF32 | Ascii |
    Default | Oem | BigEndianUTF32}] [-Stream <string>]  [<CommonParameters>]

    Get-Content -LiteralPath <string[]> [-ReadCount <long>] [-TotalCount <long>]
    [-Tail <int>] [-Filter <string>]
    [-Include <string[]>] [-Exclude <string[]>] [-Force] [-Credential <pscredential>]
     [-UseTransaction] [-Delimiter
    <string>] [-Wait] [-Raw] [-Encoding {Unknown | String | Unicode | Byte | 
    BigEndianUnicode | UTF8 | UTF7 | UTF32 |
    Ascii | Default | Oem | BigEndianUTF32}] [-Stream <string>]  [<CommonParameters>]


ALIASES
    gc
    cat
    type


REMARKS
    Get-Help cannot find the Help files for this cmdlet on this computer. 
    It is displaying only partial help.
        -- To download and install Help files for the module that includes 
     this cmdlet, use Update-Help.
        -- To view the Help topic for this cmdlet online, type: 
     "Get-Help Get-Content -Online" or
           go to https://go.microsoft.com/fwlink/?LinkID=113310.

Help cat command in windows PowerShell output.

Cool Tip: cat in Windows alias are type, gc, and Get-Content

In the above PowerShell terminal, the help cat command gives output as Get-Content and other aliases used for cat alternative in windows. You can use windows cat equivalent type, gc and Get-Content cmdlets.

The type command is a Windows cat equivalent that works across a command-line prompt (cmd) and a Window’s PowerShell. type command used in Windows to view contents of the given file without modifying it.

In this post, I will quickly show you how to display the contents of a file to the screen using cat equivalent in windows.

Windows Cat equivalent in cmd & PowerShell : type

type command syntax in windows

Syntax

type [<Drive>:][<Path>]<FileName>

Parameters

[<Drive>:][<Path>] : location and name of the file to use for view contents.

<FileName> : Single file name or separate multiple file names with spaces on cmd

Windows Cat equivalent – type command Examples

To get help on type command

type /?

The above command in cmd gets help on windows cat equivalent type command and displays contents of a text file or files. Help command gives output as

TYPE [drive:][path]filename

To view single file content using type command

C:>type file.txt

It will display a view of the file.txt file as given in the below image

powershell cat type view file content
window type command – view file content

Cool Tip: How to get permissions on folders and subfolders!

Windows Cat equivalent – view multiple file content using type

Sometimes, it is necessary to view content of the file which are locked by another program and also copy the content to another file. type command in windows provides an easy way of doing it.

C:> type file1.txt ,file2.txt > resultfile.txt
C:> type resultfile.txt

In the above command, we have used two files separated by , in PowerShell. If you are using a command prompt use separator as space. Two files concatenated output will be store in resultfile.txt.

The second command, type resultfile.txt display contents on the screen. windows cat equivalent type command doesn’t lock the file it is viewing on the screen.

Cool Tip: Use set-aduser to modify active directory user attributes!

To view large size file content

C:>type logs.txt | more

Sometimes, we may need to view the contents of a lengthy file like a log file. In order to view lengthy content, use more filter to view content on screen one line at a time.

type Command FAQ

What is cat equivalent command in windows?

The type command is a Windows cat equivalent that works on command-line prompt and a Windows PowerShell.

You can also use GC-Content alias of cat command in windows.

How to use cat command in windows?

Use type command in windows to view the contents of the text file or files. If you need more help, use type /?
type command syntax is TYPE [drive:][path]filename

what is the windows equivalent of the unix command cat?

cat command in unix is used to concatenate files and print content. windows type command is used to display content of text file. You can also use Get-Content cmdlet to display content

‘cat’ is not recognized as an internal or external command

cat command not used in windows. If you use cat in windows command prompt (cmd), it will display message as `cat` is not recognized as an internal or external command, operable command or batch script.

use type command in command line or PowerShell. However, if you use Get-Help cat on PowerShell, it gives output as Get-Content which is an alias of type command.

Best type command windows example

type command best feature is to view the content of the file without locking the file and event copy the contents of the file which are locked by another program to a different file

How to concatenate two text files in PowerShell?

Let’s consider two files file1.txt and file2.txt, to concatenate two files using PowerShell, use the below command

type file1.txt file2.txt > resultfile.txt

above command concatenate file1.txt and file2.txt into resultfile.txt file.

Does cat command works in Windows?

cat command use to create single or multiple files, concatenate files, view the contents of the file. cat command in windows doesn’t work. If you type cat in windows cmd, it will throw an error as `cat` is not recognized as an internal or external command. However, you can use cat alias command Get-Content or type to perform the same operation as cat command.

Cool Tip: Know more about how to get aduser using userprincipalname!

Conclusion:

Windows operating system doesn’t have cat command in window. using cat command in cmd line, it will throw an exception as “‘cat’ is not recognized as an internal or external command, operable program or batch file” however, using cat command in PowerShell displays its alias command as Get-Content and type.

type command is a built-in alias of Get-Content cmdlet which also displays the contents but with different syntax.

In the above post, I explained how to use cat equivalent command in Windows using built-in command type to display file contents, view lengthy files, and view multiple files contents.

You can find more topics about PowerShell Active Directory commands and PowerShell basics on ShellGeek home page.

I want to do exactly what unix «cat» does, but on my PC. Is there a simple equivalent command for the Windows command line?

Specifically I want to create a file from all the files of a given type in a folder

In Unix:

cat *fna >all_fna_files.fna

(which joins all the «.fna» text files into one big text file)

Sathyajith Bhat's user avatar

asked Jun 10, 2012 at 7:22

Kirt's user avatar

5

type

It works across command.com, cmd, and PowerShell (though in the latter it’s an alias for Get-Content, so is cat, so you could use either).
From the Wikipedia article (emphasis mine):

In computing, type is a command in various VMS. AmigaDOS, CP/M, DOS, OS/2 and Microsoft Windows command line interpreters (shells) such as COMMAND.COM, cmd.exe, 4DOS/4NT and Windows PowerShell. It is used to display the contents of specified files. It is analogous to the Unix cat command.

C:>echo hi > a.txt
C:>echo bye > b.txt
C:>type a.txt b.txt > c.txt
C:>type c.txt
hi
bye

Community's user avatar

answered Jun 10, 2012 at 7:47

ckhan's user avatar

ckhanckhan

7,4092 gold badges16 silver badges16 bronze badges

16

From the command shell:

copy a.txt + b.txt + c.txt output.txt

(But that follows the command shells use of control-Z as an end of file marker, so not suitable in some cases).

In PowerShell:

get-content a.txt,b.txt,c.txt | out-file output.txt

and you can control (using -Encoding parameter) the file encoding (which allows transcoding by using different encoding for the read and write).

answered Jun 10, 2012 at 7:33

Richard's user avatar

RichardRichard

8,9223 gold badges25 silver badges27 bronze badges

6

I have just used the cat command in DOS (Windows 7 Pro) in the following manner and successfully merged 3 files (log1.txt, log2.txt, log3.txt) into a single file:

cat log*.txt >> myBigLogFile.txt 

Note: cat log*.txt > myBigLogFile2.txt also provide the same result, but it’ll override the previous file.

kenorb's user avatar

kenorb

23.6k26 gold badges122 silver badges186 bronze badges

answered Mar 20, 2015 at 13:41

Heidi's user avatar

HeidiHeidi

671 silver badge1 bronze badge

3

I want to do exactly what unix «cat» does, but on my PC. Is there a simple equivalent command for the Windows command line?

Specifically I want to create a file from all the files of a given type in a folder

In Unix:

cat *fna >all_fna_files.fna

(which joins all the «.fna» text files into one big text file)

Sathyajith Bhat's user avatar

asked Jun 10, 2012 at 7:22

Kirt's user avatar

5

type

It works across command.com, cmd, and PowerShell (though in the latter it’s an alias for Get-Content, so is cat, so you could use either).
From the Wikipedia article (emphasis mine):

In computing, type is a command in various VMS. AmigaDOS, CP/M, DOS, OS/2 and Microsoft Windows command line interpreters (shells) such as COMMAND.COM, cmd.exe, 4DOS/4NT and Windows PowerShell. It is used to display the contents of specified files. It is analogous to the Unix cat command.

C:>echo hi > a.txt
C:>echo bye > b.txt
C:>type a.txt b.txt > c.txt
C:>type c.txt
hi
bye

Community's user avatar

answered Jun 10, 2012 at 7:47

ckhan's user avatar

ckhanckhan

7,4092 gold badges16 silver badges16 bronze badges

16

From the command shell:

copy a.txt + b.txt + c.txt output.txt

(But that follows the command shells use of control-Z as an end of file marker, so not suitable in some cases).

In PowerShell:

get-content a.txt,b.txt,c.txt | out-file output.txt

and you can control (using -Encoding parameter) the file encoding (which allows transcoding by using different encoding for the read and write).

answered Jun 10, 2012 at 7:33

Richard's user avatar

RichardRichard

8,9223 gold badges25 silver badges27 bronze badges

6

I have just used the cat command in DOS (Windows 7 Pro) in the following manner and successfully merged 3 files (log1.txt, log2.txt, log3.txt) into a single file:

cat log*.txt >> myBigLogFile.txt 

Note: cat log*.txt > myBigLogFile2.txt also provide the same result, but it’ll override the previous file.

kenorb's user avatar

kenorb

23.6k26 gold badges122 silver badges186 bronze badges

answered Mar 20, 2015 at 13:41

Heidi's user avatar

HeidiHeidi

671 silver badge1 bronze badge

3

Слово «кошка» происходит от «Объединить”. cat — это командная строка на базе Linux и Unix, которая в основном используется для конкатенации, а также для последовательного чтения, слияния и отображения содержимого файлов. В Windows есть некоторые команды, которые выполняют те же функции, что и команда cat.

В этой статье будут рассмотрены замены для команды cat в Windows:

  • С использованием Командная строка
  • С использованием Windows PowerShell

Давайте начнем!

Чем заменить команду cat в командной строке Windows?

Заменой команды cat в командной строке Windows является «тип» а также «копироватькоманда.

Следуйте приведенным ниже методам, чтобы использовать эти команды.

Способ 1: используйте «type» в качестве замены команды cat в Windows

Чтобы использовать «тип” в командной строке Windows, выполните приведенные ниже шаги.

Шаг 1: Откройте командную строку

Сначала нажмите «Окно+R», чтобы открыть «Бежать» и найдите «CMD», чтобы открыть командную строку:

Шаг 2: Создайте новый файл

Создайте новый текстовый файл с именем «

Файл.txt» с использованием «эхо.» и поместите в него текст, как мы добавили «Привет LinuxПодсказка”:

>эхо. Привет LinuxПодсказка > Файл.txt

Шаг 3: Используйте команду «type» для чтения и отображения содержимого файла

Затем используйте «тип» вместо команды «кошка” для чтения и отображения содержимого файла в командной строке:

>тип Файл.txt

Используйте команду «type» для объединения файлов

Давайте использовать «тип», чтобы объединить содержимое двух разных файлов в новый файл. Для этого выполните указанный шаг.

Шаг 1: Создайте файлы

Сначала создайте два новых файла с именами «Файл1.txt» а также «Файл2.txt” с помощью предоставленного “эхо” команды:

>эхо Привет, мир!>Файл1.txt

>эхо Добро пожаловать в LinuxHint > Файл2.txt

Шаг 2: Объедините файлы

Использовать «тип«, чтобы объединить два файла в «Новый.txt» файл:

>тип Файл1.txt Файл2.txt > Новый.txt

Шаг 3: Просмотр составного файла

Чтобы просмотреть объединенное содержимое, нажмите «тип” и укажите имя только что созданного файла:

>тип Новый.txt

Приведенный ниже вывод показывает, что мы успешно объединили содержимое в «Новый.txt» файл:

Переходим к следующему методу.

Способ 2: используйте «копировать» в качестве замены команды cat в Windows

копировать” также может использоваться как “кошка” для объединения содержимого. Но его нельзя использовать для чтения или отображения содержимого файла.

Шаг 1: Объедините файлы

Объедините два существующих файла в «Образец.txt” с помощью предоставленной команды:

>копировать /b Файл1.txt+Файл2.txt Образец.txt

копироватьКоманда скопирует содержимое «Файл1.txt» а также «Файл2.txt» и вставьте их в новый «Образец.txt» файл:

Шаг 2: Чтение и отображение объединенного файла

Давайте подтвердим составной контент, используя «типкоманда:

>тип Образец.txt

Взгляните на замену команды cat в Windows PowerShell.

Чем заменить команду cat в Windows PowerShell?

Псевдонимы или замены для команды cat в Windows PowerShell перечислены ниже:

  • Получить-контент команда
  • тип команда
  • gc команда

Теперь мы обсудим каждый из них один за другим!

Способ 1: используйте «Get-content» в качестве замены команды cat в Windows

Получить-контент» — это поддерживаемая Windows PowerShell команда, заменяющая «кошка«Он используется для извлечения содержимого выбранного файла.

Практиковаться в использовании «Получить-контент«, сначала откройте Windows PowerShell, выполнив поиск в папке «Запускатьменю:

Используйте «Get-content» для чтения и отображения содержимого файла

Теперь укажите имя прочитанного файла и распечатайте его содержимое с помощью кнопки «Получить-контенткоманда:

> Получить содержимое File1.txt

Используйте команду «Get-content» для объединения файлов

Чтобы использовать команду Get-content для объединения разных файлов, выполните указанные шаги.

Шаг 1: Объедините файлы

Используйте указанную команду для объединения разных файлов в новый файл:

> Получить содержимое File1.txt, File2.txt | выходной файл NewFile.txt

Здесь «Получить-контент” используется для получения содержимого файлов. Труба «|” отправит контент в “вне файла«, чтобы объединить содержимое этих файлов в «Новый файл.txtкоманда:

Шаг 2. Просмотрите содержимое файла

Проверьте объединение файлов с помощью приведенной ниже команды:

> Получить содержимое NewFile.txt

Способ 2: используйте команду «type» в качестве замены команды cat в Windows

тип” также является заменой “кошка” в Windows. Давайте попрактикуемся в «тип” Использование команды в Windows PowerShell.

Используйте команду «type» для чтения и отображения содержимого файла

Использовать «тип” в Windows PowerShell для чтения и отображения содержимого файла:

>тип Файл1.txt

Используйте команду «type» для объединения файлов

Объедините разные файлы в новый файл, используя «типкоманда «; как мы объединили «Файл1.txt» а также «Файл2.txt«в новый файл»Файл3.txt”:

>тип Файл1.txt, Файл2.txt > Файл3.txt

>тип Файл3.txt

Способ 3: используйте «gc» в качестве замены команды cat в Windows

Windows PowerShell»gc” – это еще один псевдоним для “кошкакоманда. Давайте используем его в PowerShell.

Используйте команду «gc» для чтения и отображения содержимого файла

Используйте «gc” для чтения и просмотра содержимого предоставленного файла:

>gc Файл1.txt

Используйте команду «gc» для объединения файлов

gcКоманда может использоваться для объединения указанных файлов в качестве «кошкакоманда. Для этого запустите предоставленную команду и перенаправьте содержимое файла «Файл1.txt» а также «Файл2.txt” к “НовыйФайл1.txt» с помощью «>оператор:

>gc Файл1.txt, Файл2.txt >НовыйФайл1.txt

>gc Новый файл.txt

Мы описали различные команды Windows, которые считаются заменой команды cat в Windows.

Вывод

Различные команды Windows заменяют команду cat, например «тип» а также «копировать», которые можно использовать в командной строке. PowerShell также поддерживает некоторые команды, такие как «Получить-контент“, “тип«, а также «gc», который можно использовать для той же цели. Мы подробно рассмотрели, как использовать различные команды Windows для объединения, чтения и просмотра файлов в качестве замены команды cat.

December 18 2021, 09:24

Categories:

  • IT
  • Компьютеры
  • Cancel

Цитата:

If you display the package.json file (cat package.json), you will see the defaults that you accepted, ending with the license.

На «Лурке» есть статья про понятие «Дефолт-сити» (по-русски дословно «город по умолчанию»), в которой написано следующее:

Когда в интернетах пишут что-то вроде «На Маяковской была пиздилка», «Ехал сегодня по Ленинскому…», «Давайте забухаем в кабаке на Дмитровке» или «срочно куплю/продам самовывозом…» без указания города, то всегда подразумевается Москва, так как любой москвич справедливо считает, что в других городах схожих названий быть не может, да и вообще там жизни нет.

В мире веб-разработки сейчас сложилась похожая ситуация для операционных систем. Если в руководствах пишут: «Введите в командной строке следующее», а название операционной системы не уточняют, всем понятно, что речь идет про Unix-подобную операционную систему (а скорее всего, про какой-нибудь «Linux»). Операционные системы «Windows» находятся тут в роли провинциалов (может, и поделом).

Про команду «cat» в википедии:
https://ru.wikipedia.org/wiki/Cat

Вообще команда «cat» используется для разных целей, но в данном случае (cat package.json) она используется для вывода текста из указанного файла в консоль на экран компьютера для просмотра.

В командной строке «cmd.exe» операционной системы «Windows 10 Pro» эта команда не сработает, так как такой команды там нет. Но вместо нее в данном случае можно использовать следующее:

type package.json

Зато в программе «Windows PowerShell» сработают оба варианта:

cat package.json

и

type package.json

На самом деле, в программе «Windows PowerShell» в данном случае срабатывает один и тот же командлет (по-английски «cmdlet») «Get-Content». У него есть три псевдонима: «cat», «type» и «gc» (последний — сокращение от «Get-Content»).

Подробнее:
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-content

Программа «Windows PowerShell» испытывает влияние Unix-подобных операционных систем. Ее разработчики стараются сделать работу в «Windows» удобной и для пользователей, привыкших к другим операционным системам.

Понравилась статья? Поделить с друзьями:
  • Команда для закрытия программы в windows 10
  • Команда bootrec scanos не находит windows 7
  • Команда для закрытия окна в windows
  • Команда bcdboot создание или восстановление данных конфигурации загрузки windows
  • Команда для закрытия всех приложений в windows 10