lschmod is a shell script for macOS and Linux that displays files and directories in a tree structure with their numeric chmod permissions (e.g,: 755, 600, etc.). This makes it easy to check permissions across multiple directories. See "Usage" to learn how to customize the script's behaviour.
- Displays directories and files in a tree structure with numeric
chmodvalues - Respects
.gitignore(if exists) by default (excludes matching files/directories) - Excludes hidden files/directories by default
- Supports depth limiting with
-l/--levelsoption - Option to show hidden files with
-a/--alloption - Option to ignore .gitignore with
-n/--no-gitignoreoption - Handles both single files and directories
You can install lschmod via Homebrew:
# Tap into the formula
brew tap thaikolja/lschmod
# Install system-wide
brew install lschmod-
Download the
lschmod.shscript -
Make it executable:
chmod +x lschmod.sh -
Rename it to be detected as a binary:
mv lschmod.sh lschmod -
Optionally, place it in your PATH for system-wide access in your
.zshrc(macOS) or.bashrc:export PATH="/path/to/binary/dir:$PATH"
./lschmod [OPTIONS] PATH-a, --all: Include hidden files and directories (starting with.)-l, --levels N: Limit the depth of the search toNlevels-n, --no-gitignore: Do not respect.gitignorefile
# Show files in a directory (excluding hidden files and respecting .gitignore)
./lschmod /path/to/directory
# Show all files, including hidden ones
./lschmod -a /path/to/directory
# Show files up to 2 levels deep
./lschmod -l 2 /path/to/directory
# Show files but ignoring `.gitignore`
./lschmod -n /path/to/directory
# Show all files up to 3 levels deep, ignoring `.gitignore`
./lschmod -a -l 3 -n /path/to/directory❯ lschmod . # Use `.` for current directory
755 .
├── 644 index.php
├── 644 license.txt
├── 644 readme.html
├── 644 wp-activate.php
├── 755 wp-admin/
├── 644 about.php
├── 644 admin-ajax.php
├── 644 admin-footer.php
├── 644 admin-functions.php
├── 644 admin-header.php
├── 644 admin-post.php
├── 644 admin.php
├── 644 async-upload.php
├── 644 authorize-application.php
├── 644 comment.php
├── 644 contribute.php
├── 644 credits.php
├── 755 css/
├── 644 about-rtl.css
├── 644 about-rtl.min.css- Kolja Nolte (kolja.nolte@gmail.com)
This project is licensed under the MIT License. See the LICENSE file for details.