Skip to main content
14 votes
Accepted

What's the opposite of `/` in Command Prompt (nushell)?

According to the Nushell book, you can go to the previous directory using: cd - That’s cd and a dash. This behavior was previously not available for “auto cd” (changing directory just by typing a ...
Daniel B's user avatar
  • 63.9k
9 votes
Accepted

How to get a list of keys from a record?

{a:1, b:2} | columns Not sure why I didn't notice columns initially. I just retested on 0.69.1 which was out when this question was asked and it works the same as my original answer below. In the ...
NotTheDr01ds's user avatar
  • 23.6k
3 votes
Accepted

nushell: open excel files and search them for a text

The main problem here is that Nushell's find mechanics don't "play nice" with the nested table structure of a spreadsheet. What the find command receives from open "huge file.xlsx"...
NotTheDr01ds's user avatar
  • 23.6k
3 votes
Accepted

nushell: list all files recursively

I think we've determined at least two things in working through this in comments and chat: ls -a should be used to make sure that files in hidden directories are included in the result. There ...
NotTheDr01ds's user avatar
  • 23.6k
2 votes
Accepted

Finding the line count of source files as a table in nushell

You can do this using native Nushell commands - no need for wc which might not be available on other platforms (like Windows): ls **/*.py | select name | insert linecount { open $in.name | lines | ...
Charles Roper's user avatar
2 votes

nushell: list all files recursively

The bug mentioned in my original answer has been resolved, so, to recursively list all (non-hidden) files and subdirectories in all (non-hidden) subdirectories (tested on Nushell 0.76): ls **/* To ...
NotTheDr01ds's user avatar
  • 23.6k
2 votes
Accepted

Skipping lines in a large file, then pipe to external command in Nushell

Important: As @Prem correctly mentions in the comments, my current answer below only works for a narrow use-case, and can cause issues in most SQL-based workloads like in the question. That it ...
NotTheDr01ds's user avatar
  • 23.6k
1 vote
Accepted

nushell: pass list of filtered files to external program

The most concise and precise way to do it would be this: ls -af **/* | where name =~ 'GENERATED' | each { ^git checkout -- $in.name } This uses the where command to filter the name column (which in ...
Charles Roper's user avatar
1 vote

How do I change the default location for nushell configration files

Only symbolic link worked for me on macos m1: mv ~/Library/Application\ Support/nushell ~/.config/ ln -s ~/.config/nushell ~/Library/Application\ Support/ https://github.com/nushell/nushell/issues/...
rofrol's user avatar
  • 1,911
1 vote
Accepted

nushell: Add computed column to table

insert really is, I believe, what you are looking for, despite the confusing example in the book. Try: ls -af **/* | insert path { $in.name | path dirname } | update name { $in.name | path basename } ...
NotTheDr01ds's user avatar
  • 23.6k

Only top scored, non community-wiki answers of a minimum length are eligible