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 ...
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 ...
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"...
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 ...
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 | ...
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 ...
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 ...
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 ...
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/...
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 }
...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
nushell × 11microsoft-excel × 1
macos × 1
command-line × 1
terminal × 1
shell × 1
symbolic-link × 1
navigation × 1
progress-bar × 1