Skip to main content

Smart file and directory viewer

Project description

L command

l command is a smart file and directory viewer that can replace both less and ls. It intelligently detects the content type and displays it in the most appropriate way.

Usage

  • l /path/to/file: Display file content appropriately
    • Short files: Display using cat
    • Long files: Display using less -RFX
    • JSON files: Format and display using jq
    • Archive files: List contents using appropriate tools (unzip -l, tar -tvf)
    • Binary files: Display using hexdump -C
  • l /path/to/directory: Works as ls -la --color=auto /path/to/directory
  • l /path/to/json: Detects JSON files and formats them using jq
  • l /path/to/archive: Detects archive files (zip, tar, etc.) and lists their contents

Detailed Behavior

  • Automatically detects file size and line count, using cat for short files and less for long files
  • Detects terminal height and uses less if the file has more lines than the terminal height
  • Automatic JSON detection and formatting:
    • Files with .json extension
    • Files without extension but starting with { or [ (UTF-8 encoded)
    • Performs syntax check using jq empty, falling back to default display for invalid JSON
    • Falls back to default display for large JSON files (>10MB)
  • Archive file detection and content listing:
    • ZIP files (including .jar, .war, .ear, .apk, .ipa)
    • TAR archives (including .tar.gz, .tgz, .tar.bz2, .tbz2, .tar.xz, .txz, .tar.zst)
  • Binary file detection and hexdump display:
    • Uses file command to detect binary files when available
    • Falls back to content-based detection (checking for null bytes and non-printable characters)
    • Displays binary files using hexdump -C
  • Directory detection and listing

Options

Currently, the command line arguments are as follows:

  • Positional argument path: Path to the file or directory to display (default: current directory .)

Use Cases

  • View file content quickly: l file.txt
  • Check directory contents at a glance: l ./myfolder
  • Format and read JSON files: l data.json
  • List contents of archive files: l archive.zip
  • View binary files in hexdump format: l binary.bin

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

l_command-0.2.0.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

l_command-0.2.0-py3-none-any.whl (17.2 kB view details)

Uploaded Python 3

File details

Details for the file l_command-0.2.0.tar.gz.

File metadata

  • Download URL: l_command-0.2.0.tar.gz
  • Upload date:
  • Size: 12.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for l_command-0.2.0.tar.gz
Algorithm Hash digest
SHA256 2faf9455e173a3587c211bfec0674d6fd89f044accf6f0f7f4cc644f894581a7
MD5 08ede8e8ec22e115be7d4c63fedc7c37
BLAKE2b-256 de40e34cf78711d282b8872aced8804a8e65d824427b01840aec2a5c6f91afef

See more details on using hashes here.

Provenance

The following attestation bundles were made for l_command-0.2.0.tar.gz:

Publisher: release.yml on gyu-don/l-command

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file l_command-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: l_command-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 17.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for l_command-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fcc2bb1b87d7f56656e435a083dbcf9b3c8f8d4ab62c1dff8a760bd86677d9a1
MD5 f8f2255e999e7e5692a1c3aa9e0611df
BLAKE2b-256 cfcf201b067e4345e62ef1d5ce1cea7b34ac2555cab5b4f0611967e10e97d0a0

See more details on using hashes here.

Provenance

The following attestation bundles were made for l_command-0.2.0-py3-none-any.whl:

Publisher: release.yml on gyu-don/l-command

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page