20 stable releases
| new 1.18.0 | Nov 11, 2025 |
|---|---|
| 1.16.0 | Jul 20, 2025 |
| 1.14.0 | Mar 29, 2025 |
| 1.11.0 |
|
| 1.3.0 | Nov 24, 2023 |
#162 in Filesystem
550KB
11K
SLoC
Ex Directory Listing Tool
Versions
| Version | Released | Change |
|---|---|---|
| 1.0.0 | 09-Oct-2023 | Initial version. |
| 1.1.0 | 24-Oct-2023 | Case insensitive match on Windows. |
| Show links as absolute paths. | ||
| Show links with file or directory colour. | ||
Use LS_COLORS variable in Bash. |
||
Accept multiple -t options. |
||
| 1.2.0 | 05-Nov-2023 | Find relative links from subdirectories. |
| Show bad links with zero size and time. | ||
Include executable files with -tf option. |
||
| 1.3.0 | 24-Nov-2023 | Order by directory with -od option. |
Show file depth with --debug option. |
||
Miscellaneous bug fixes with -i option. |
||
| 1.4.0 | 03-Jan-2024 | Make command completion work. |
| 1.5.0 | 25-Apr-2024 | Pretty print file sizes and times. |
Optionally recurse into hidden directories with -aa option. |
||
| 1.6.0 | 25-May-2024 | Correct parent directory indentation with -i option. |
| 1.7.0 | 17-Jun-2024 | Find recent files by local time not UTC. |
Use box drawing characters for indentation with -i option. |
||
| Add trailing slash or backslash to links to directories. | ||
No longer show file depth with --debug option. |
||
| 1.8.0 | 29-Jun-2024 | Force case sensitive match on Windows with --case option. |
Force case insensitive match on Linux with --no-case option. |
||
| Use hyphenated long option names. | ||
| 1.9.0 | 27-Jul-2024 | Show file times in UTC with --utc option. |
Show file versions on Windows with --win-ver option. |
||
| 1.10.0 | 31-Aug-2024 | Show files in hidden parent directories with -a option. |
| Show files in darker colour on Linux if not executable by current user or group. | ||
Show owner information (user and group) on Linux with --owner option. |
||
| 1.11.0 | 03-Nov-2024 | Optionally filter executables on Linux with -te option. |
| 1.12.0 | 28-Feb-2025 | Expand compressed files with -z option. |
Show owner on parents with -si option. |
||
| Show file extensions as lower case. | ||
Show file depth with --debug option (debug builds only). |
||
| Show offending path on file system errors. | ||
| 1.13.0 | 22-Mar-2025 | Filter more recent files with --recent option. |
| Show metadata for encrypted Zip files. | ||
Show compressed files with z mode. |
||
| 1.14.0 | 29-Mar-2025 | Show file signature bytes with --sig option. |
Align header and footer with z mode. |
||
| 1.14.1 | 16-Apr-2025 | Fix compiler error. |
| 1.15.0 | 10-May-2025 | Show file signature bytes in compressed files. |
| Show file versions in compressed files on Windows. | ||
| Show file links in tar files. | ||
| Interpret file times in Zip files using local time zone. | ||
| Decrypt password protected compressed files. | ||
| 1.15.1 | 28-May-2025 | Use new version of Zip crate (previous one was yanked). |
| 1.16.0 | 20-Jul-2025 | Filter files by Git status with --git. |
| Show files if current directory is hidden. | ||
| 1.17.0 | 05-Aug-2025 | Skip recursing ignored Git directories. |
Show all files with Git status with -gx. |
||
| 1.18.0 | 10-Nov-2025 | Expand Java jar files as Zip files. |
| Swap Git untracked and ignored flags. | ||
| Show day of week with "-xx". | ||
| Expand list of shells for completion. |
Contents
- Versions
- Contents
- Introduction
- Features
- Colour Output by File Type
- Find Files in Subdirectories
- Indent Files in Subdirectories
- Show Hidden Files and Directories
- Show Contents of Compressed Files
- Match Case Sensitive Filenames
- Sort Files by Natural Ordering
- Sort Files by Attribute
- Sort Files by Name
- Filter Files by Time
- Filter Files by Type
- Filter Files by Git Status
- Show Total Size
- Show File Owner
- Show File Signature
- Show Only Paths
- Show Absolute Paths
- Show Windows Paths
- Show Windows Versions
- Support Shell Command Pipelines
- Support Command Line Completion
Introduction
Ex is a command line tool for listing directory contents. As such, it is intended as a replacement for:
- The
lscommand in Bash (but easier to use). - The
findcommand in Bash (but easier to use). - The
dircommand on Windows (but with more features and nicer output).
It is designed to work with POSIX shell command pipelines. For example:
- If writing to a console, all attributes are shown.
- If writing to a pipe or file, attributes are hidden, and filenames are escaped.
By default, it finds files in the current directory, and lists them with file type (d for directories, l for links, - for regular files) and permissions (r for readable, w for writable, x for executable, for owner, group and other) followed by size, age and extension. Directories are also indicated by a trailing path separator:
~/example $ ex
drwxr-xr-x 0 B 1 day files/
-rwxr--r-- 10 B 2 month .sh find.sh
Feature requests are welcome, but it's a hobby project in a language I don't get to use in my day job, so I prefer to do all the development myself.
Features
Colour Output by File Type
Unless piped to a command or file, Ex uses coloured output according to environment variable LS_COLORS, defined in Bash:
- If
LS_COLORSis present, uses the defined colours for image and video files (magenta by default), music files (cyan) and compressed files (red) by file extension. - If
LS_COLORSis present, uses the defined colours for directories (blue by default), executable files (green), resolved links (cyan) and unresolved links (red on black). - If
LS_COLORSis missing, hard codes the colours listed above for directories, executable files and symbolic links. - Additionally on Linux, uses the dark version of the executable colour for files which are executable for a different user or group.
Find Files in Subdirectories
If Ex is run with option -s or --recurse, it finds files in subdirectories. If run with option -d or --depth, it finds files between minimum and maximum depth, where depth 0 corresponds to the current directory:
- Use
-sto find files in subdirectories. - Use
-d4or-d-4to find files up to depth 4. - Use
-d2-4to find files at depth 2, 3 or 4. - Use
-d2-to find files at depth 2 and beyond.
It uses path separator / in Bash, including Git Bash on Windows:
~/example $ ex -s
-rwxr--r-- 10 B 2 month .sh find.sh
drwxr-xr-x 0 B 1 day files/
drwxr-xr-x 0 B 1 day files/colours/
-rwxr--r-- 20 B 3 month .sh files/colours/alpha.sh
-rw-r--r-- 30 B 4 month .txt files/colours/blue.txt
-rw-r--r-- 40 B 5 month .txt files/colours/green.txt
-rw-r--r-- 50 B 6 month .txt files/colours/red.txt
drwxr-xr-x 0 B 1 day files/numbers/
lrwxr--r-- 60 B 7 month .sh files/numbers/count.sh -> /home/username/numbers/count.sh
lrw-r--r-- 999 KB 8 month .gz files/numbers/googolplex.gz -> /home/username/numbers/googolplex.gz
lrw-r--r-- 0 B 9 month files/numbers/ordinals -> /home/username/numbers/ordinals/
drwxr-xr-x 0 B 1 day files/numbers/one two/
-rw-r--r-- 70 B 10 month .txt files/numbers/one two/"three" 'four'.txt
It uses path separator \\ on Windows:
C:\Users\username\example> ex.exe -s
-rwxrwxrwx 10 B 2 month .sh find.sh
drwxrwxrwx 0 B 1 day files\
drwxrwxrwx 0 B 1 day files\colours\
-rwxrwxrwx 20 B 3 month .sh files\colours\alpha.sh
-rw-rw-rw- 30 B 4 month .txt files\colours\blue.txt
-rw-rw-rw- 40 B 5 month .txt files\colours\green.txt
-rw-rw-rw- 50 B 6 month .txt files\colours\red.txt
drwxrwxrwx 0 B 1 day files\numbers\
lrwxrwxrwx 60 B 7 month .sh files\numbers\count.sh -> C:\Users\username\numbers\count.sh
lrw-rw-rw- 999 KB 8 month .gz files\numbers\googolplex.gz -> C:\Users\username\numbers\googolplex.gz
lrw-rw-rw- 0 B 9 month files\numbers\ordinals -> C:\Users\username\numbers\ordinals\
drwxrwxrwx 0 B 1 day files\numbers\one two\
-rw-rw-rw- 70 B 10 month .txt files\numbers\one two\"three" 'four'.txt
It accepts wildcards like *.txt, with shortcuts like .txt for ease of typing:
~/example $ ex -s .txt
-rw-r--r-- 30 B 4 month .txt files/colours/blue.txt
-rw-r--r-- 40 B 5 month .txt files/colours/green.txt
-rw-r--r-- 50 B 6 month .txt files/colours/red.txt
-rw-r--r-- 70 B 10 month .txt files/numbers/one two/"three" 'four'.txt
If given directories with a trailing separator, it lists the contents of the directories; otherwise, it lists the directories themselves:
~/example $ ex files/colours
drwxr-xr-x 0 B 1 day files/colours/
~/example $ ex files/colours/
-rwxr--r-- 20 B 3 month .sh files/colours/alpha.sh
-rw-r--r-- 30 B 4 month .txt files/colours/blue.txt
-rw-r--r-- 40 B 5 month .txt files/colours/green.txt
-rw-r--r-- 50 B 6 month .txt files/colours/red.txt
Indent Files in Subdirectories
If Ex is run with option -i or --indent, it indents files in subdirectories:
~/example $ ex -si
-rwxr--r-- 10 B 2 month .sh find.sh
drwxr-xr-x 0 B 1 day files
drwxr-xr-x 0 B 1 day ├─ colours
-rwxr--r-- 20 B 3 month .sh │ ├─ alpha.sh
-rw-r--r-- 30 B 4 month .txt │ ├─ blue.txt
-rw-r--r-- 40 B 5 month .txt │ ├─ green.txt
-rw-r--r-- 50 B 6 month .txt │ └─ red.txt
drwxr-xr-x 0 B 1 day └─ numbers
lrwxr--r-- 60 B 7 month .sh ├─ count.sh -> /home/username/numbers/count.sh
lrw-r--r-- 999 KB 8 month .gz ├─ googolplex.gz -> /home/username/numbers/googolplex.gz
lrw-r--r-- 0 B 9 month ├─ ordinals -> /home/username/numbers/ordinals/
drwxr-xr-x 0 B 1 day └─ one two
-rw-r--r-- 70 B 10 month .txt └─ "three" 'four'.txt
Show Hidden Files and Directories
By default, Ex hides:
- Hidden files like
.bashrc. - Hidden directories like
.git. - Python cache directories
__pycache__.
If run with option -a or --all-files, it shows hidden files and directories:
~/example $ ex -d1 -a
-rwxr--r-- 10 B 2 month .sh find.sh
drwxr-xr-x 0 B 1 day .hidden/
drwxr-xr-x 0 B 1 day files/
drwxr-xr-x 0 B 1 day files/colours/
drwxr-xr-x 0 B 1 day files/numbers/
If run with repeated option -aa, it also recurses into hidden directories:
~/example $ ex -d1 -aa
-rwxr--r-- 10 B 2 month .sh find.sh
drwxr-xr-x 0 B 1 day .hidden/
-rwxr--r-- 15 B 1 day .dat .hidden/password.dat
-rwxr--r-- 15 B 1 day .dat .hidden/secret.dat
drwxr-xr-x 0 B 1 day files/
drwxr-xr-x 0 B 1 day files/colours/
drwxr-xr-x 0 B 1 day files/numbers/
Show Contents of Compressed Files
If run with option -z or --zip, Ex expands *.zip, *.jar, *.7z, *.tar and *.tar.gz compressed files. All other filtering and sorting options work as if the compressed files were directories:
~/zipped $ ex -s
-rw-r--r-- 165 B 1 year .7z backup.7z
-rw-r--r-- 10 KB 1 year .tar backup.tar
-rw-r--r-- 241 B 1 year .gz backup.tar.gz
-rw-r--r-- 123 B 1 year .zip backup.zip
drwxr-xr-x 0 B 1 day backup/
-rw-rw-r-- 100 B 1 year .txt backup/file.txt
~/zipped $ ex -sz
-drwxr-xr-x 0 B 1 day backup/
--rw-rw-r-- 100 B 1 year .txt backup/file.txt
zdrw-r--r-- 0 B 1 year backup.7z/
z---------- 100 B 1 year .txt backup.7z/file.txt
zdrw-r--r-- 0 B 1 year backup.tar/
z-rw-rw-r-- 100 B 1 year .txt backup.tar/file.txt
zdrw-r--r-- 0 B 1 year backup.tar.gz/
z-rw-rw-r-- 100 B 1 year .txt backup.tar.gz/file.txt
zdrw-r--r-- 0 B 1 year backup.zip/
z-rw-rw-r-- 100 B 1 year .txt backup.zip/file.txt
~/zipped $ ex -sz backup.zip
z-rw-rw-r-- 100 B 1 year .txt backup.zip/file.txt
Encypted Compressed Files
If the Zip or 7-Zip file is encrypted, and Ex needs to access the file contents (e.g. to show file signatures or Windows versions; see below) it asks the user to enter a password (which is not echoed to the screen). This shows one failed and one successful attempt:
~/zipped $ ex -sz --sig backup.zip
Password for /home/username/zipped/backup.zip/file.txt?
Password for /home/username/zipped/backup.zip/file.txt?
z-rw-rw-r-- 100 B 1 year 41424344 ABCD .txt backup.zip/file.txt
It is also possible to specify a password on the command line with option --password. This is definitely NOT recommended (except in situations where you do not care about security) as this information will be retained in the command line history:
~/zipped $ ex -sz --sig --password secret backup.zip
z-rw-rw-r-- 100 B 1 year 41424344 ABCD .txt backup.zip/file.txt
Caveats on Compression Formats
The Zip format stores file times without time zone information, so Ex interprets file times using the local time zone. This may result in misleading information for files compressed in a different time zone or daylight savings period.
The 7-Zip format appears to be relatively slow to decompress. While Ex only decompresses files if showing Windows versions (for *.exe and *.dll entries only) or file signatures (for all entries, but only requires the first four bytes) this can take a while.
Match Case Sensitive Filenames
By default, Ex uses case sensitive filename matching on Linux, and case insensitive matching on Windows (including Git Bash) to match the file system. If run with option --case or --no-case, it overrides this behaviour.
Sort Files by Natural Ordering
By default, Ex uses natural ordering on filenames:
~/ordered $ ex
-rw-rw-r-- 0 B 1 year .txt file8.txt
-rw-rw-r-- 0 B 1 year .txt file9.txt
-rw-rw-r-- 0 B 1 year .txt file10.txt
-rw-rw-r-- 0 B 1 year .txt file11.txt
-rw-rw-r-- 0 B 1 year .txt file98.txt
-rw-rw-r-- 0 B 1 year .txt file99.txt
-rw-rw-r-- 0 B 1 year .txt file100.txt
-rw-rw-r-- 0 B 1 year .txt file101.txt
Sort Files by Attribute
By default, Ex shows directories before files in the current directory, groups directories and their children if recursing, and sorts by filename within those groups. If run with option -o or --order, it sorts files and directories according to the option:
- Use
-onto sort files by filename. - Use
-oeto sort files by extension. - Use
-osto sort files by size (increasing). - Use
-os-to sort files by size (decreasing). - Use
-otto sort files by time (increasing). - Use
-ot-to sort files by time (decreasing). - Use
-oestto sort files by extension then size then time.
For example:
~/example $ ex -d2 -oes
drwxr-xr-x 0 B 1 day files/
drwxr-xr-x 0 B 1 day files/colours/
drwxr-xr-x 0 B 1 day files/numbers/
lrw-r--r-- 0 B 9 month files/numbers/ordinals -> /home/username/numbers/ordinals/
drwxr-xr-x 0 B 1 day files/numbers/one two/
lrw-r--r-- 999 KB 8 month .gz files/numbers/googolplex.gz -> /home/username/numbers/googolplex.gz
-rwxr--r-- 10 B 2 month .sh find.sh
-rwxr--r-- 20 B 3 month .sh files/colours/alpha.sh
lrwxr--r-- 60 B 7 month .sh files/numbers/count.sh -> /home/username/numbers/count.sh
-rw-r--r-- 30 B 4 month .txt files/colours/blue.txt
-rw-r--r-- 40 B 5 month .txt files/colours/green.txt
-rw-r--r-- 50 B 6 month .txt files/colours/red.txt
Sort Files by Name
If Ex is run with option -on, it additionally shows directories in parentheses:
~/example $ ex -s -on .sh
-rwxr--r-- 20 B 3 month .sh alpha.sh (files/colours/)
lrwxr--r-- 60 B 7 month .sh count.sh (files/numbers/) -> /home/username/numbers/count.sh
-rwxr--r-- 10 B 2 month .sh find.sh
Filter Files by Time
By default, Ex shows files and directories regardless of age. If run with option -r or --recent, it filters by modified time:
- Use
-ry10to include files up to ten years old. - Use
-rm6to include files up to six months old. - Use
-rw2to include files up to two weeks old. - Use
-rdto include files up to one day old. - Use
-rHto include files up to one hour old. - Use
-rM5to include files up to five minutes old. - Use
-rS30to include files up to thirty seconds old.
For example:
~/example $ ex -s -rm5
Start 5 month
----------------------------
-rwxr--r-- 10 B 2 month .sh find.sh
drwxr-xr-x 0 B 1 day files/
drwxr-xr-x 0 B 1 day files/colours/
-rwxr--r-- 20 B 3 month .sh files/colours/alpha.sh
-rw-r--r-- 30 B 4 month .txt files/colours/blue.txt
-rw-r--r-- 40 B 5 month .txt files/colours/green.txt
drwxr-xr-x 0 B 1 day files/numbers/
drwxr-xr-x 0 B 1 day files/numbers/one two/
Filter Files by Type
By default, Ex shows files and directories regardless of type. If run with option -t or --type, it filters by type:
- Use
-tfto include files. - Use
-teto include executable files. - Use
-tdto include directories. - Use
-tlto include links.
For example:
~/example $ ex -s -td
drwxr-xr-x 0 B 1 day files/
drwxr-xr-x 0 B 1 day files/colours/
drwxr-xr-x 0 B 1 day files/numbers/
drwxr-xr-x 0 B 1 day files/numbers/one two/
~/example $ ex -s -tfl
-rwxr--r-- 10 B 2 month .sh find.sh
-rwxr--r-- 20 B 3 month .sh files/colours/alpha.sh
-rw-r--r-- 30 B 4 month .txt files/colours/blue.txt
-rw-r--r-- 40 B 5 month .txt files/colours/green.txt
-rw-r--r-- 50 B 6 month .txt files/colours/red.txt
lrwxr--r-- 60 B 7 month .sh files/numbers/count.sh -> /home/username/numbers/count.sh
lrw-r--r-- 999 KB 8 month .gz files/numbers/googolplex.gz -> /home/username/numbers/googolplex.gz
lrw-r--r-- 0 B 9 month files/numbers/ordinals -> /home/username/numbers/ordinals/
-rw-r--r-- 70 B 10 month .txt files/numbers/one two/"three" 'four'.txt
Filter Files by Git Status
If Ex is run with option -g or --git, it filters files by Git status, and includes the status in the output. It does not recurse into hidden directories (according to the .gitignore file, such as the target directory) to find files, and does not show directories or links.
Use -gc to include cached (with added, modified and renamed, but not untracked or ignored) files, and -gx to include all files:
~/code $ ex -s -gc
-rw-rw-r-- ----- 455 B 1 day .rs build.rs
-rw-rw-r-- ----- 1 KB 1 day .toml Cargo.toml
-rw-rw-r-- ----- 27 KB 1 day .md README.md
-rw-rw-r-- ----- 69 KB 1 day .rs src/config.rs
-rw-rw-r-- ----- 2 KB 1 day .rs src/error.rs
-rw-rw-r-- ----- 48 KB 1 day .rs src/finder.rs
-rw-rw-r-- ----- 132 B 1 day .rs src/lib.rs
-rw-rw-r-- ----- 5 KB 1 day .rs src/main.rs
-rw-rw-r-- A---- 48 KB 1 day .rs src/option.rs
-rw-rw-r-- -M--- 203 KB 1 day .rs src/printer.rs
-rw-rw-r-- -MR-- 38 KB 1 day .rs src/sorter.rs
Use -ga, -gm, -gr, -gu, -gi or any combination of those flags, to include added, modified, renamed, untracked or ignored files:
~/code $ ex -s -gamrui
-rw-rw-r-- ----I 49 KB 1 day .lock Cargo.lock
-rw-rw-r-- ---U- 177 B 1 day .txt notes.txt
-rw-rw-r-- A---- 48 KB 1 day .rs src/option.rs
-rw-rw-r-- -M--- 203 KB 1 day .rs src/printer.rs
-rw-rw-r-- -MR-- 38 KB 1 day .rs src/sorter.rs
Show Total Size
If Ex is run with option --total, it also shows the total file size, and number of files and directories:
~/example $ ex --total files/numbers/
drwxr-xr-x 0 B 1 day files/numbers/one two/
lrwxr--r-- 60 B 7 month .sh files/numbers/count.sh -> /home/username/numbers/count.sh
lrw-r--r-- 999 KB 8 month .gz files/numbers/googolplex.gz -> /home/username/numbers/googolplex.gz
lrw-r--r-- 0 B 9 month files/numbers/ordinals -> /home/username/numbers/ordinals/
----------------------------
Total 1 MB 3 files 1 directory
Show File Owner
If run with option --owner on Linux, Ex shows the owning user and group, like ls -l:
~/example $ ex -s --owner .sh
-rwxr--r-- root root 10 B 2 month .sh find.sh
-rwxr--r-- username username 20 B 3 month .sh files/colours/alpha.sh
lrwxr--r-- username username 60 B 7 month .sh files/numbers/count.sh -> /home/username/numbers/count.sh
Show File Signature
If run with option --sig, Ex shows the first four bytes (signature) of files. Some files use these bytes to indicate the file format, e.g. ELF executable files, Zip and 7-Zip files contain .ELF, PK.. and 7z.., where UTF-16 files on Windows contain a BOM (byte order mark):
~/example $ ex -s --sig
-rwxr--r-- 10 B 2 month 23212f75 #!/u .sh find.sh
drwxr-xr-x 0 B 1 day 00000000 .... files/
drwxr-xr-x 0 B 1 day 00000000 .... files/colours/
-rwxr--r-- 20 B 3 month 23212f75 #!/u .sh files/colours/alpha.sh
-rw-r--r-- 30 B 4 month 424c5545 BLUE .txt files/colours/blue.txt
-rw-r--r-- 40 B 5 month 47524545 GREE .txt files/colours/green.txt
-rw-r--r-- 50 B 6 month 52454400 RED. .txt files/colours/red.txt
drwxr-xr-x 0 B 1 day 00000000 .... files/numbers/
lrwxr--r-- 60 B 7 month 23212f75 #!/u .sh files/numbers/count.sh -> /home/username/numbers/count.sh
lrw-r--r-- 999 KB 8 month 00000000 .... .gz files/numbers/googolplex.gz -> /home/username/numbers/googolplex.gz
lrw-r--r-- 0 B 9 month 00000000 .... files/numbers/ordinals -> /home/username/numbers/ordinals/
drwxr-xr-x 0 B 1 day 00000000 .... files/numbers/one two/
-rw-r--r-- 70 B 10 month 33340000 34.. .txt files/numbers/one two/"three" 'four'.txt
Show Only Paths
By default, Ex shows all file attributes (unless writing to a pipe or file) with pretty printed size and time. If run with option -x or --only-path, it shows directories and filenames only:
~/example $ ex -sx
find.sh
files/
files/colours/
files/colours/alpha.sh
files/colours/blue.txt
files/colours/green.txt
files/colours/red.txt
files/numbers/
files/numbers/count.sh -> /home/username/numbers/count.sh
files/numbers/googolplex.gz -> /home/username/numbers/googolplex.gz
files/numbers/ordinals -> /home/username/numbers/ordinals/
files/numbers/one two/
files/numbers/one two/"three" 'four'.txt
If run with repeated option -xx, it shows all file attributes (even if writing to a pipe or file) and disables pretty printing, showing time in the local time zone with day of week:
~/example $ ex -sxx
-rwxr--r-- 10 Fri 01-Nov-2024 00:00:00 .sh find.sh
drwxr-xr-x 0 Tue 31-Dec-2024 00:00:00 files/
drwxr-xr-x 0 Tue 31-Dec-2024 00:00:00 files/colours/
-rwxr--r-- 20 Tue 01-Oct-2024 00:00:00 .sh files/colours/alpha.sh
-rw-r--r-- 30 Sun 01-Sep-2024 00:00:00 .txt files/colours/blue.txt
-rw-r--r-- 40 Thu 01-Aug-2024 00:00:00 .txt files/colours/green.txt
-rw-r--r-- 50 Mon 01-Jul-2024 00:00:00 .txt files/colours/red.txt
drwxr-xr-x 0 Tue 31-Dec-2024 00:00:00 files/numbers/
lrwxr--r-- 60 Sat 01-Jun-2024 00:00:00 .sh files/numbers/count.sh -> /home/username/numbers/count.sh
lrw-r--r-- 999,999 Wed 01-May-2024 00:00:00 .gz files/numbers/googolplex.gz -> /home/username/numbers/googolplex.gz
lrw-r--r-- 0 Mon 01-Apr-2024 00:00:00 files/numbers/ordinals -> /home/username/numbers/ordinals/
drwxr-xr-x 0 Tue 31-Dec-2024 00:00:00 files/numbers/one two/
-rw-r--r-- 70 Fri 01-Mar-2024 00:00:00 .txt files/numbers/one two/"three" 'four'.txt
If run with repeated option -xx and option -u or --utc, it additionally shows file times in UTC:
~/example $ ex -sxxu
-rwxr--r-- 10 Fri 01-Nov-2024 00:00:00Z .sh find.sh
drwxr-xr-x 0 Tue 31-Dec-2024 00:00:00Z files/
drwxr-xr-x 0 Tue 31-Dec-2024 00:00:00Z files/colours/
-rwxr--r-- 20 Mon 30-Sep-2024 23:00:00Z .sh files/colours/alpha.sh
-rw-r--r-- 30 Sat 31-Aug-2024 23:00:00Z .txt files/colours/blue.txt
-rw-r--r-- 40 Wed 31-Jul-2024 23:00:00Z .txt files/colours/green.txt
-rw-r--r-- 50 Sun 30-Jun-2024 23:00:00Z .txt files/colours/red.txt
drwxr-xr-x 0 Tue 31-Dec-2024 00:00:00Z files/numbers/
lrwxr--r-- 60 Fri 31-May-2024 23:00:00Z .sh files/numbers/count.sh -> /home/username/numbers/count.sh
lrw-r--r-- 999,999 Tue 30-Apr-2024 23:00:00Z .gz files/numbers/googolplex.gz -> /home/username/numbers/googolplex.gz
lrw-r--r-- 0 Sun 31-Mar-2024 23:00:00Z files/numbers/ordinals -> /home/username/numbers/ordinals/
drwxr-xr-x 0 Tue 31-Dec-2024 00:00:00Z files/numbers/one two/
-rw-r--r-- 70 Fri 01-Mar-2024 00:00:00Z .txt files/numbers/one two/"three" 'four'.txt
Show Absolute Paths
By default, Ex shows relative paths (unless supplied absolute paths on the command line). If run with option -q or --abs-path, it shows absolute paths:
~/example $ ex -sq .txt
-rw-r--r-- 30 B 4 month .txt /home/username/example/files/colours/blue.txt
-rw-r--r-- 40 B 5 month .txt /home/username/example/files/colours/green.txt
-rw-r--r-- 50 B 6 month .txt /home/username/example/files/colours/red.txt
-rw-r--r-- 70 B 10 month .txt /home/username/example/files/numbers/one two/"three" 'four'.txt
Show Windows Paths
By default, Ex shows directories with path separator / in Git Bash on Windows, converting D:\Path to /d/Path; but sometimes it is necessary to generate Windows paths for copying and pasting into other programs. If run with option -w or --win-path, it does this:
~/example $ ex -sqw .txt
-rw-rw-rw- 30 B 4 month .txt C:\Users\username\example\files\colours\blue.txt
-rw-rw-rw- 40 B 5 month .txt C:\Users\username\example\files\colours\green.txt
-rw-rw-rw- 50 B 6 month .txt C:\Users\username\example\files\colours\red.txt
-rw-rw-rw- 70 B 10 month .txt C:\Users\username\example\files\numbers\one two\"three" 'four'.txt
Show Windows Versions
If run with option -v or --win-ver on Windows, Ex shows file versions for executable and DLL files:
C:\Users\username\bin> ex.exe -v
-rwxrwxrwx 123 KB 1 month 2.1.0.999 .exe binary.exe
-rw-rw-rw- 45 KB 1 month 2.1.0.1001 .dll library.dll
-rw-rw-rw- 678 B 1 month .txt README.txt
Support Shell Command Pipelines
If piped to a command or file, Ex hides attributes and escapes filenames:
~/example $ ex -s .txt | cat
files/colours/blue.txt
files/colours/green.txt
files/colours/red.txt
files/numbers/one\ two/\"three\"\ \'four\'.txt
If run with option --null-path, it uses a null character as a separator:
~/example $ ex -sz .txt | xargs -0 touch
Support Command Line Completion
If Ex is run with option --completion=bash, it generates a Bash completion script, and can be called from a .bashrc file:
source <(/home/username/bin/ex --completion=bash)
If Ex is run with option --completion=ps, it generates a PowerShell completion script, and can be called from a PowerShell $PROFILE file:
C:\Users\username\bin\ex.exe --completion=ps | Out-String | Invoke-Expression
Dependencies
~31–46MB
~684K SLoC