![Forrest logo](/images/logo.png)
fc
The "fc" command line tool, also known as file compare, is a built-in command in various operating systems such as Windows, macOS, and Linux. It is primarily used to compare two text files or sets of text files and display the differences between them.
Here are some key features and usage details of the "fc" command:
-
Syntax: On Windows, the syntax is "fc file1 file2", and on Unix-like systems, it is "fc file1 file2 [output]".
-
Text comparison: "fc" compares files line by line and displays the differences between corresponding lines. It identifies added, deleted, and modified lines in the files.
-
Output options: In Windows, the command displays the differences in the console by default. However, you can redirect the output to a file using the "> filename" syntax. On Unix-like systems, you can use the optional "output" argument to save the differences to a file instead of displaying them in the console.
-
File format support: "fc" works with plain text files. It may not be suitable for comparing binary files or files with complex formatting, such as word processor documents.
-
Case sensitivity: By default, "fc" treats text as case-insensitive. However, you can use the "/c" option on Windows to enable case-sensitive comparison.
-
Line numbers: The command displays line numbers alongside the differences, making it easier to identify the location of each change.
-
Automation: "fc" can be used in scripts or batch files to automate file comparison tasks.
Overall, the "fc" command line tool is a convenient way to compare text files and identify differences between them. It is useful for various scenarios, including code versioning, document comparison, and troubleshooting.
List of commands for fc:
-
fc:tldr:1c4ec fc: List recent commands from history.$ fc -ltry on your machineexplain this command
-
fc:tldr:29bd6 fc: List recent commands in reverse order.$ fc -l -rtry on your machineexplain this command
-
fc:tldr:39104 fc: Compare files as ASCII text.$ fc /l ${path\to\file1} ${path\to\file2}try on your machineexplain this command
-
fc:tldr:3ab1e fc: List commands in a given interval.$ fc '${416}' '${420}'try on your machineexplain this command
-
fc:tldr:4c909 fc: Compare files as Unicode text.$ fc /u ${path\to\file1} ${path\to\file2}try on your machineexplain this command
-
fc:tldr:579b6 fc: Disable tab-to-space expansion.$ fc /t ${path\to\file1} ${path\to\file2}try on your machineexplain this command
-
fc:tldr:82729 fc: Compress whitespace (tabs and spaces) for comparisons.$ fc /w ${path\to\file1} ${path\to\file2}try on your machineexplain this command
-
fc:tldr:ca524 fc: Perform a case-insensitive comparison.$ fc /c ${path\to\file1} ${path\to\file2}try on your machineexplain this command
-
fc:tldr:d527a fc: Compare files as binary.$ fc /b ${path\to\file1} ${path\to\file2}try on your machineexplain this command
-
fc:tldr:d76e0 fc: Specify an editor to open with.$ fc -e ${'emacs'}try on your machineexplain this command