LICENSECHECK(1)

๐Ÿ“ฆ
version 3.3.9 ยท 2 versions
, in fedora 43

๐Ÿ’– LICENSECHECK ๐Ÿ’–

okay bestie, this is licensecheck from the User Contributed Perl Documentation corner of the universe, and it's literally the girl who reads the first few lines of every file and goes "oh I know exactly what license this is." she's serving Version v3.3.9 and she's been doing this since before some of y'all were born.


โœจ NAME โœจ

licensecheck โ€” simple license checker for source files ๐Ÿ•ต๏ธโ€โ™€๏ธ


๐ŸŒธ VERSION ๐ŸŒธ

Version v3.3.9 โ€” yes queen, we're on the current release.


๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

licensecheck [ --help | --version ]

licensecheck [ --list-licenses | --list-naming-schemes ]

licensecheck [OPTION...] PATH [PATH...]

three moods, three ways to call her. pick your vibe. ๐Ÿ’…


๐ŸŽ€ DESCRIPTION ๐ŸŽ€

so basically, licensecheck tries to figure out which license applies to each file you hand her, by searching the start of the file for text belonging to various licenses. she's not psychic, she's just really good at pattern matching at the top of files. no cap.

if any of the arguments you pass are directories, licensecheck will add the files contained within to the list of files to process. she'll just, like, scoop them up. ๐Ÿฅ„

when multiple PATHs are provided, only files matching --check and not --ignore are checked. that's the rule, fr fr.


๐Ÿ‘‘ OPTIONS ๐Ÿ‘‘

๐Ÿ’ซ Resolving patterns

  • --shortname-scheme โ€” Since v3.2. comma-separated priority list of license naming schemes to use for license identifiers (default value: unset (use verbose description)). so instead of the whole essay of a license name, you get the cute little nickname. iconic.
  • --list-licenses โ€” Since v3.2. list identifiers for all detectable licenses and exit. she shows you the whole roster, then dips. ๐Ÿ’จ
  • --list-naming-schemes โ€” Since v3.2. list all available license naming schemes and exit. every nickname system she knows about, laid out.

๐ŸŒˆ Selecting files

  • -c REGEX, --check=REGEX โ€” Since v2.10.10. regular expression of files to include when more than one PATH is provided (default value: common source files). the "you're invited to the party" list. โœจ
  • -i REGEX, --ignore=REGEX โ€” Since v2.10.10. regular expression of files to skip when more than one PATH is provided (default value: some backup and VCS files). the "not you bestie" list. ๐Ÿ™ˆ
  • -r, --recursive โ€” Since v2.10.7. traverse directories recursively. she goes down every folder. she's thorough like that.

๐Ÿ” Parsing contents

  • -l N, --lines=N โ€” Since v2.10.3. number of lines to parse from top of each file; implies optimistic search including only first cluster of detected copyrights or licenses; set to 0 to parse the whole file (and ignore --tail) (default value: 60). she's like, only reading the first few paragraphs of the essay and being confident about it. and honestly? she's usually right.
  • --tail=N โ€” Since v2.15.10. number of bytes to parse from bottom of each file when parsing only from top of each file and finding nothing there; set to 0 to avoid parsing from end of file (or set --lines to 0 and ignore this setting) (default value: 5000 (roughly 60 lines)). the backup plan โ€” if the top said nothing, she peeks at the bottom. ๐Ÿ”Ž
  • -e CODEC, --encoding=CODEC โ€” Since v2.15.10. try decode source files from the specified codec, with "iso-8859-1" as fallback (default value: unset (no decoding)). for when the file's text is giving "what language is this" and she needs to translate first.

๐Ÿ“ Reporting results

  • --copyright โ€” Since v2.10.7. add copyright statements to license information. receipts included. ๐Ÿงพ
  • -s, --skipped โ€” Since v3.3.0. Log files in PATHs matching neither --check nor --ignore as warnings (default: log as debug). she'll announce the files she skipped instead of quietly moving on.
  • -m, --machine โ€” Since v2.12.2. print license information as "TAB"-separated fields, for processing with line-oriented tools like "awk" and "sort". robot-friendly format. beep boop. ๐Ÿค–
  • --[no-]deb-machine โ€” Since v3.0.0. print license information like a Debian copyright file; implies --copyright and --shortname-scheme=debian,spdx. Debian girlies rise up. ๐Ÿง
  • --list-delimiter=PRINTF โ€” Since v3.0.18. printf-string used between multiple plain list items in Debian copyright file (default value: '\n ' (NEWLINE SPACE)).
  • --rfc822-delimiter=PRINTF โ€” Since v3.0.18. printf-string used between multiple RFC822-style items in Debian copyright file (default value: '\n ' (NEWLINE SPACE SPACE)).
  • --copyright-delimiter=PRINTF โ€” Since v3.0.19. printf-string used between years and owners in Debian copyright file (default value: ', ' (COMMA SPACE)).
  • --[no-]merge-licenses โ€” Since v3.0.0. merge same-licensed files in Debian copyright file. grouping the girlies who match. ๐Ÿซถ

๐Ÿ’œ General

  • -h, --help โ€” print help message and exit. she tells you everything then leaves immediately, no small talk.
  • -v, --version โ€” print version and copyright information and exit. the "who are you and where do you come from" option.
  • --quiet, --verbose, --debug, --trace โ€” Since v3.3.0. Emit only error messages to STDERR (with option --quiet), or (in addition errors and warnings) also notices/debug/traces. The more "noisy" option wins if several are set. (default: emit errors and warnings). the volume knob of this entire program โ€” turn it up and she will NOT stop telling you about her day. ๐Ÿ—ฃ๏ธ

๐ŸŒˆ ENVIRONMENT ๐ŸŒˆ

  • NO_COLOR โ€” If defined, will disable color. Consulted before COLOR. the "no glitter today" switch.
  • COLOR โ€” Can be set to 0 to explicitly disable colors. The default is to use color when connected to a terminal. so if you're in a terminal, she's gonna be pretty about it. ๐Ÿ’…
  • LOG_LEVEL =item QUIET =item VERBOSE =item DEBUG =item TRACE โ€” Used to emit varying details about discoveries to STDERR when verbosity is not set using either of options --quiet, --verbose, --debug or --trace. See Log::Any::Adapter::Screen for more details.
  • LOG_PREFIX โ€” The default formatter groks these variables. See formatter in Log::Any::Adapter::Screen for more details.

๐Ÿ’€ CAVEATS ๐Ÿ’€

The exact output may change between releases, due to the inherently fragile scanning of unstructured data, and the ongoing improvements to detection patterns. For some level of stability, use one of the machine-readable output formats and define a --shortname-scheme.

bestie listen. she is reading unstructured data with regexes. it's giving chaos and she knows it. if you need your output to stay the same forever, use a machine-readable format and lock in a --shortname-scheme. otherwise, next release might shift things and that's just the nature of the game. ๐Ÿ˜ญ

Option --deb-fmt was deprecated since v3.2. Please use option --shortname-scheme=debian,spdx instead.

โš ๏ธ --deb-fmt is deprecated since v3.2 โ€” she's moved on, and so should you. use --shortname-scheme=debian,spdx.

๐Ÿฆ‹ SEE ALSO ๐Ÿฆ‹

Other similar tools exist.

Here is a list of known tools also command-line based and general-purpose:


๐ŸŒŸ AUTHOR ๐ŸŒŸ

Jonas Smedegaard "<dr@jones.dk>"


This program is based on the script "licensecheck" from the KDE SDK, originally introduced by Stefan Westerfeld "<stefan@space.twc.de>".

Copyright ยฉ 2007, 2008 Adam D. Barratt

Copyright ยฉ 2012 Francesco Poli

Copyright ยฉ 2016-2022 Jonas Smedegaard

Copyright ยฉ 2017-2022 Purism SPC

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.


so yeah, she's a perl v5.42.0 girlie, page stamped 2025-07-24, and this whole manual page was brought to you by the letters L-I-C-E-N-S-E-C-H-E-C-K and the number 1. mwah. ๐Ÿ’‹โœจ bye bestie, go check some licenses. ๐Ÿฆ‹
๐Ÿ“ฆ where this page comes from