The command conc contatenates text files.
It accepts the same wildcards and file selection options as the d directory command.
> conc chapter*.txt -output=all.txt
> conc '***/*.lis' -min_size=1 -since=today -headerDisplays all non-empty .lis files that have been created today to standard output.
conc will read either kind of text file under both Windows and Linux, and convert it to the native encoding. The output file will always be on the native format for the platform.
> conc intro.txt 'chapter*.txt' appendix.txt -output=all.txt
The parameter is one or more input file specifications.
conc accepts the same wildcards and file selection options as the cop copy command. You can specify more than one filename, and the filenames may contain wildcards.
If you give a list of filenames, the files will be concatenated in the order they are given.
> conc -header foo.txt bar ######################################################################## ######## /home/chris/foo.txt This is a file called "foo.txt" ######## /home/chris/bar.txt This is "bar.txt"
> conc a.xyz -output=b.xyz
| Specifies an output file. If the option is not present,
output will be sent to standard output (con:). This makes it
convenient to pipe the output from conc to another program.
If the -output option is given without a filename, the default filename is a.tmp in the current working directory. |
The output file will always be a text file with line endings encoded on the format that is native for the platform. This means that the lines of text are separated by a carriage-return/newline character pair ('\r\n') under Windows, and by a newline character only ('\n') under Linux.
See File Version Numbers: Output Files for a
description of how the version numbers work for output files.
These options control how the output should be formatted.
> conc '***/*.txt' -header
| -number | Prints the line number in front of each record in each file. |
| -header | Prints a header with the filename for each new input file. |
Prints the line number in front of each record in each file.
Default is -nonumber
| -header | Print a header with the filename for each new file where the pattern is found. |
| -noheader | Do not print any headers.
This is the default unless the -number option has been specified. |
| -header=auto | Print headers if there is more than one input file, but
do not print any header if there is only one input file.
This setting is the default when the -number option has been specified. |
alias t='conc -header=auto -noverbose'The alias t (for "type") copies one or more files to standard output, and writes a header for each file if there is more than one.
> t *.txt ######################################################################## ######## /home/chris/bar.txt This is "bar.txt" ######## /home/chris/foo.txt This is a file called "foo.txt"
> conc -header '***/*.lis' -since=today -min_size=1
| -since [= datetime] | Select files that were created on or after a certain date/time. |
| -before [= datetime] | Select file that were created before a certain date/time. |
| -min_size [= size] | Specify a minimum file size in bytes, Mb, or some other unit |
| -max_size [= size] | Specify a maximum file size . |
|
-directories
[= only/also/not]
|
List directory files (only/also/not) . Default is also. |
| -hidden [= only/also/not] | List hidden files (only/also/not). Default is not. |
| -nodefault | Do not add any default wildcards or other filename parts to the filename. |
| -exclude [= filespec] | Exclude files that match the file specification given as option value. If the option value is enclosed in parenthesis, it can contain a full file specification, including recursive file selection options. |
These options control which files are selected. See File Selection Options for more information.
> conc '*.dat' -output=out.tmp -noverbose
| Print out a brief help text with a summary of each of the different options, and exit from the program. | |
| -version | Show the name and version number of the program, and exit.
This option must be written out in full, and cannot be abbreviated. |
| -verbose
-v -statistics -noverbose |
Specify the amount of informational messages. |
| -warning -nowarning -noerror |
Specify the level of error reporting. |