1

How can I list files recursively with the nu shell?

More specifically: All files, folders and everything else in a specified folder and every inner folder, recursively.

  1. I tried ls **, but that does not work.
  2. I googled, found ls **/**.rs on Coming from Bash and tried ls **/*. That seemed to work, but I had to learn the hard way that it lists only some files, not all. I don't know why. But I found an example where ls **/* | where name =~ 'xxx' found less than ls **/*xxx*. (I thought about including my example here, to show what is listed and what not. But the folder structure is too huge.)
  3. I cannot use ls **/*xxx* as I do not want to filter by name every time. Sometimes I need to filter only by other columns.
user194860
  • 640
  • 4
  • 10
  • Keep in mind that questions on Stack Overflow should be about *"specific coding, algorithm, or language problems" (i.e. "unique to software development")*. General shell questions are typically better for either the [Unix & Linux](https://unix.stackexchange.com) Stack or [Super User](https://superuser.com). – NotTheDr01ds May 13 '22 at 17:31
  • 2
    @NotTheDr01ds I had in mind that I have to check where to post this. I searched for "nushell" on various sites, among others Stackoverflow and Super User. There are various other questions about nushell on Stackoverflow but none on Super User. On Stackoverflow none of the questions about nushell are closed (except for this one, of course). As nushell, like most shells, has its own programming language, and this question is about that programming language, i found it appropriate to post it here. The same question in Java, was not closed after all: https://stackoverflow.com/questions/2056221/ – user194860 May 13 '22 at 18:37
  • I do realize that shells are tricky when it comes to where to post. I did try to provide some guidance in the [Nushell tag wiki](https://stackoverflow.com/tags/nushell/info) here, but it can be a gray area. Just for reference (if you are interested in reading), [here's](https://meta.stackoverflow.com/a/410947/11810933) the method I try to use to determine if a shell question is on-topic or not. Also to address your point about Java -- That's a tool that is *unique to software development*, and thus on-topic. Shells don't fall into that category. – NotTheDr01ds May 13 '22 at 18:57
  • I do hope you'll repost on Super User or Unix & Linux -- I created a Nushell tag (and question) last week on Unix & Linux, but if you are on Windows (and you probably should add your OS to your question), then Super User might be better, and you can create the tag there. Ping me here in a reply if you do, so I can add the tag to my watchlist. Thanks! – NotTheDr01ds May 13 '22 at 18:58
  • @NotTheDr01ds I posted [the question on Super User](https://superuser.com/questions/1720919/). I also added a sentence about the OS: It should work on Windows, too. I have to use Linux and Windows and hope to use the same nu scripts on both. – user194860 May 13 '22 at 19:31

0 Answers0