LinuxCommandLibrary

licensecheck

TLDR

Check files for licenses

$ licensecheck [file]
copy
Check directory recursively
$ licensecheck -r [directory]
copy
Output in machine-readable format
$ licensecheck --copyright -m [file]
copy
Check specific file types
$ licensecheck -r --check '*.py' [directory]
copy
Show only files with licenses
$ licensecheck -r -l [directory]
copy

SYNOPSIS

licensecheck [options] files...

DESCRIPTION

licensecheck scans files for license information and copyright statements. It examines source code headers to identify the license under which files are distributed.
The tool recognizes many common open-source licenses including GPL, MIT, BSD, Apache, and others.

PARAMETERS

-r, --recursive

Check directories recursively.
-l, --lines n
Check first n lines (default 60).
-c, --check regex
Check only matching filenames.
-i, --ignore regex
Ignore matching filenames.
-m, --machine
Machine-readable output.
--copyright
Show copyright statements.
-v, --verbose
Verbose output.

RECOGNIZED LICENSES

$ GPL, LGPL, AGPL (various versions)
MIT, BSD (2/3-clause)
Apache, MPL
Artistic, Perl
Public Domain
copy

CAVEATS

Heuristic-based detection may miss or misidentify licenses. Custom licenses need manual review. Only checks file headers.

HISTORY

licensecheck originated in Debian as a tool for checking license compliance in package source code, helping maintainers verify licensing.

SEE ALSO

license(1), reuse(1), scancode(1)

Copied to clipboard