# Command Prompt Tips

<p class="callout info">There are thousands of extracted files available and sometimes it can be difficult to locate what you need.</p>

<p class="callout info">On the Windows Operating System, you will be using the Console Command Prompt (CMD).  
To access it, simply type "command prompt" or "cmd" in the search bar.  
Windows PowerShell also works.</p>

## Change Directory

It will be much easier issuing commands when changing the current directory.  
You should be changing the directory to the folder where you extracted all your files.

#### **Windows and Linux | cd**

<p class="callout info">The Change Directory command for Linux and Windows is the same.</p>

<span style="text-decoration: underline;">**Syntax:**</span>  
`cd [directory]`

<span style="text-decoration: underline;">**Example:** </span>`cd C:\Users\Username\Desktop\Extracted Files`

<p class="callout info">On Windows:  
An easy way to change directories in is to navigate to the directory in File Explorer, select the upper list that names all the folders in your directory (usually starting with "This PC"), copy what is listed, then paste it into CMD.</p>

## Create Directory

Rather than making directories one at a time graphically, you may find it easier to create an entire path in one command.

#### **Windows and Linux | mkdir** 

<p class="callout info">The base command, mkdir, is the same on both Windows and Linux, however the flags are different.  
</p>

<span style="text-decoration: underline;">**Syntax:**</span>  
`mkdir [directory/path]`

<span style="text-decoration: underline;">**Example:** </span>`mkdir warehouse_patch1/generated/decls/material2/art/weapons/supershotgun/skins/techhell/`

<p class="callout info">On Linux:  
You need the -p flag to create directories recursively if their parents don't exist. If your Linux distribution does not do so automatically, add an alias to the config file for your favorite shell so that you can just type mkdir without the -p.  
</p>

## Find String  


To find specific text strings within a file or group of files.  
Useful for finding .decl files.

#### **Windows | [findstr](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/findstr)**

<span style="text-decoration: underline;">**Syntax:**</span>  
`findstr /arguments "text" [filename]`

<span style="text-decoration: underline;">**Example:** </span>`findstr /si "ai/fodder/imp_stone" e5m1_spear\generated\decls\*`  
&gt; This example command will list out the .decl files that define the Stone Imp as an entity to be spawned in The World Spear.  
&gt; The `/si` argument makes the command also search sub-directories of the file and ignore case-sensitivity.  
&gt; The `*` at the end is a wildcard, meaning that it will search for everything within the decls folder.

<p class="callout warning">Although the Windows file structure divide their directories with the back slash ("\\"), the extracted files will reference directories using the forward slash ("/"). You can see this in the example for findstr above.</p>

#### **Linux | [grep](https://man7.org/linux/man-pages/man1/fgrep.1.html)**

<span style="text-decoration: underline;">**Syntax:**</span>  
`grep -arguments "text" [filepath]`

<span style="text-decoration: underline;">**Example:** </span>`grep -ir "ai/fodder/imp_stone" e5m1_spear/generated/decls/*`

The -ir arguments make the command search sub-directories recursively and ignore case-sensitivity. If you intentionally want a case-sensitive search, you can leave out the -i flag and use just -r.

<p class="callout info">For Linux, the directories use the forward slash ("/") just like how the extracted files do.</p>

<p class="callout danger">Sometimes a surplus of results will print out depending on how vague the key term is.</p>

## File Compare

Compares the difference between two files line-by-line.  
Useful for comparing a modded file with its original version.

#### **Diffchecker** | [https://www.diffchecker.com](https://www.diffchecker.com)

The Diffchecker website compares differences and similarities between 2 code syntax.  
Select all syntax of the original .decl file and copy it over to one of the fields. Then do the same for the modified .decl file.

#### **Windows | [fc](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/fc)**

<span style="text-decoration: underline;">**Syntax:**</span>  
`fc /arguments [file1] [file2]`

<span style="text-decoration: underline;">**Example:** </span>`fc /n "e5m3_hell\generated\decls\aiupgrades\buffpod.decl" "test_buffpod.decl"`

#### **Linux | [diff](https://man7.org/linux/man-pages/man1/diff.1.html)**

<span style="text-decoration: underline;">**Syntax:**</span>  
`diff -arguments [file1] [file2]`

<span style="text-decoration: underline;">**Example:** </span>`diff "e5m3_hell/generated/decls/aiupgrades/buffpod.decl" "test_buffpod.decl"`