LinuxCommandLibrary

jrnl

Create and manage personal journal entries

TLDR

Insert a new entry with your editor

$ jrnl
copy

Quickly insert a new entry
$ jrnl [today at 3am]: [title]. [content]
copy

View the last ten entries
$ jrnl -n [10]
copy

View everything that happened from the start of last year to the start of last march
$ jrnl -from "[last year]" -until [march]
copy

Edit all entries tagged with "texas" and "history"
$ jrnl [@texas] -and [@history] --edit
copy

SYNOPSIS

jrnl [OPTIONS] [DATE/TIME | ENTRY TEXT | SEARCH QUERY]
jrnl [OPTIONS] --edit [JOURNAL]
jrnl [OPTIONS] --export [FORMAT]
jrnl [OPTIONS] --encrypt | --decrypt
jrnl [OPTIONS] [SUBCOMMAND]

PARAMETERS

-f , --file
    Specify an alternative journal file to use.

-n , --limit
    Show only the last entries.

-g , --grep
    Filter entries by a regex pattern.

-d , --date
    Filter entries by a specific date or date range (e.g., "yesterday", "last week", "2 days ago to today").

-s, --star
    Show only starred entries.

-t , --tags
    Filter entries by tags (e.g., "@work", "#idea").

-p, --private
    Add an entry as private (only visible if explicitly configured or through encryption).

-e, --edit
    Edit existing entries using the default editor.

-x , --export
    Export journal entries to a specified format (e.g., "json", "txt", "md").

-c, --encrypt, --decrypt
    Encrypt or decrypt the journal file. Requires a password.

--purge
    Permanently delete marked entries.

--check
    Check journal for corruption.

--stats
    Display journal statistics.

--config [ ]
    Display or set configuration options.

-v, --version
    Show jrnl's version number.

-h, --help
    Show the help message and exit.

DESCRIPTION

jrnl is a Python-based command-line utility designed for maintaining a personal journal. It allows users to quickly add entries with timestamps, search through past entries using keywords, dates, or tags, and even encrypt their journals for privacy. Entries are stored in a simple plaintext file (or encrypted binary if enabled), making them easily portable and readable. It supports multiple journals, tagging, starring entries, and integrates with the default system editor for more extensive entry management. Its primary focus is on simplicity and efficiency, making it ideal for daily note-taking and reflection directly from the terminal. jrnl aims to be unobtrusive and highly customizable, adapting to various workflows for personal record-keeping.

CAVEATS

jrnl is written in Python, so its functionality depends on a compatible Python environment. Encryption requires the pycrypto or cryptography library to be installed; if these are missing, encryption features will be unavailable. By default, journals are stored as plaintext files, meaning sensitive information is unencrypted unless the user explicitly enables encryption. While robust, file corruption can occur, though jrnl provides a --check command to verify integrity. Users should be mindful of the default journal location (~/.jrnl) when managing or backing up their data.

JOURNAL LOCATION AND MULTIPLE JOURNALS

By default, jrnl uses a file named jrnl.json (or jrnl.txt for older versions) in the user's home directory (~/.jrnl). Users can create and manage multiple journals by specifying a journal name in the configuration file, e.g., work.jrnl, personal.jrnl. You can interact with a specific journal using jrnl -f <journal_name>.

TAGGING AND STARRING ENTRIES

Entries can be tagged by prefixing words with @ or # (e.g., Today was good. #mood @home). Entries can also be "starred" using an asterisk (*) at the beginning of the entry text, making them easily retrievable with the --star option.

CONFIGURATION

jrnl is highly configurable via ~/.jrnl_config (or ~/.config/jrnl/jrnl_config). This file allows setting the default editor, journal paths, date formats, and custom colors, among other options, enabling users to tailor jrnl to their specific preferences and workflows.

HISTORY

jrnl was created by Igor Guerrero and first released around 2012, quickly gaining popularity as a minimalist yet powerful command-line journaling solution. Developed in Python, it leverages the language's cross-platform capabilities and extensive libraries. Its development has been community-driven, with contributions and improvements from various developers on platforms like GitHub. The project maintains a focus on simplicity, ease of use, and privacy through optional encryption, evolving steadily to include features like multiple journal support, enhanced search capabilities, and various export formats, while staying true to its core philosophy of being a lightweight journaling tool.

SEE ALSO

grep(1), vim(1), nano(1), less(1), cat(1)

Copied to clipboard