Skip to content

Instantly share code, notes, and snippets.

@paul-d-ray
paul-d-ray / Nushell_File_Count_by_Year.md
Last active June 18, 2025 03:07
Nushell File Count by Year

Diffent ways in Nushell to get File Count by Year

I had a need to get a count of files in one of my folders by Year the file was saved.

Using a few lines in Nushell I came up with a way to do this, and with help from the Nushell Discord channel, we came up with a few more.

Uniq and Count flag

@paul-d-ray
paul-d-ray / xan-completions.md
Last active May 26, 2025 21:59
Nushell XAN Completions

xan-completions.nu screenshot

Nushell extrenal completions for xan using xan-completions.nu

xan-completions Screenshot

Xan subcommands flags

Most of the subcommands have flags that show from the exterenal completions.

xan view flags screenshot

@paul-d-ray
paul-d-ray / fd-completions.md
Last active May 26, 2025 21:59
Nushell FD Completions

fd-completions.nu screenshot

Nushell extrenal completions for fd using fd-completions.nu

fd-completions.nu Screenshot

@paul-d-ray
paul-d-ray / Nushell_Completions.nu
Created May 15, 2025 22:28
Nushell How to use External Completions
# Completions
source ($nu.data-dir | path join 'completions' | path join 'fd-completions.nu')
source ($nu.data-dir | path join 'completions' | path join 'rg-completions.nu')
source ($nu.data-dir | path join 'completions' | path join 'scoop-completions.nu')
source ($nu.data-dir | path join 'completions' | path join 'winget-completions.nu')
@paul-d-ray
paul-d-ray / custom.nu
Created May 15, 2025 22:31
Nushell Custom Config
# PR 20240926
# This was done for Nushell 98.0
source .oh-my-posh.nu
oh-my-posh init nu --config C:\Users\Paul_Ray\AppData\Local\Programs\oh-my-posh\themes\gmay.omp_PR.json
# ---------------------------------------------------------------------
# Load modules
use g:\work\nu\mathfunctions.nu
@paul-d-ray
paul-d-ray / scoop-completions.md
Last active May 26, 2025 21:58
Nushell Scoop Completions

scoop-completions.nu screenshot Nushell extrenal completions for scoop using scoop-completions.nu

scoop-completions.nu Screenshot

@paul-d-ray
paul-d-ray / rosettacode_nushell.md
Created May 16, 2025 01:50
Rosetta Code for Nushell
@paul-d-ray
paul-d-ray / ping_hosts.md
Created May 21, 2025 03:57
Ping a list of hosts

Ping a list of hosts

Tested under Windows (I used Windows). Should work under Unix like systems (not tested).

# PR 2025-05-20 23:33:44
# Manual with some help from Grok 3 for Unix style ping
# from discord about ping
# https://discord.com/channels/601130461678272522/615253963645911060/threads/1374058672120135813
@paul-d-ray
paul-d-ray / file_size_distribution.md
Last active June 18, 2025 03:05
Nushell File Size Distribution

Nushell code to get a file size distribution

# 20250412_2141
# https://rosettacode.org/wiki/File_size_distribution
# File Size Distribution


 [d:/work d:/drivers d:/images ] | each { ls ($"($in)/**/*" | into glob) |
  each { |it|
@paul-d-ray
paul-d-ray / rg_search_pdf.md
Created May 26, 2025 21:57
Using RG and PDF files

RG and PDF files

To seach inside pdf files, use rga

RGA

If you want to search inside PDFs (and many other file types like Office documents, archives, e-books, etc.), you can use ripgrep-all (rga), which is a wrapper around ripgrep that adds support for these formats.

rga is available for Windows and can be installed using package managers like Chocolatey or Scoop.