Skip to content

Instantly share code, notes, and snippets.

@paul-d-ray
paul-d-ray / Nushell_Touch.md
Created June 24, 2025 02:37
Nushell Touch Example

Nushell Touch Example

This uses nuls (a custom wrapper of Nushell's ls) to get the fullname and pass this to touch inside of a closue.

nuls -f  d:/drivers/x670e_Taichi/Chipset/ 
  | sort-by modified | 
  last 1 | 
  get fullname  | 
 each {|file| touch -m -t 2025-06-13T06:18:00-04:00 $file}
@paul-d-ray
paul-d-ray / Nushell_ls_with_vs_without_path.md
Created June 20, 2025 05:22
Nushell LS with a path vs LS without a Path

LS and Glob patterns

  • In Nushell on Windows, the LS command's behavior differs due to how it handles hidden system directories like "System Volume Information".

  • Without a path (ls): Uses a wildcard pattern (*) with glob matching, which filters out "System Volume Information" because it has the FILE_ATTRIBUTE_HIDDEN attribute, per Windows-specific hidden file detection logic.

  • With a path (ls C:): Directly reads directory contents, bypassing glob filtering, so "System Volume Information" is shown if accessible.

DeepWiki for Nushell

@paul-d-ray
paul-d-ray / Nushell_Programs_Versions.md
Last active June 24, 2025 02:38
Nushell Get programs and versions

Nushell Program to get a list of programs

This code use the parse, group-by, and sort-by Nushell commands to get a list of programs, and version.

The folder I keep programs has the program name with the version.

  • example filenames
    dopusinstall64_13.16_00_00.exe
    Joplin-Setup-3.3.12.exe
    NtWind_Alttabter_6.5-setup.exe
    
@paul-d-ray
paul-d-ray / Nushell_JSON_filter.md
Last active June 18, 2025 03:04
Nushell filter JSON files

Filter JSON files

This will filter the UniGetUI package list (which is just a JSON file), to find any record.

Nushell Code

 open 'd:/work/UniGet/prhome7 installed packages 2025-05-29 20-28-38.ubundle' | 
 from json | 
 get packages incompatible_packages | 
 flatten | 
 where name =~ '(?i)ultr' |
@paul-d-ray
paul-d-ray / du64.md
Last active June 18, 2025 03:05
Nushell use Sysinternals DU command

Disk Usage Commands

Sysinternals DU Command

Instead of using Nushell's DU command, use the Sysinternals DU command

Custom function

This function will use the Sysinternals DU comand and transpose the data and format the numbers with a separator and right align.

@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.

@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 / 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 / rosettacode_nushell.md
Created May 16, 2025 01:50
Rosetta Code for Nushell
@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