3 ms·
Hi, the `find` command is probably easiest: https://www.nushell.sh/book/commands/find.html https://www.nushell.sh/book/commands/find.html ps | find k9 That wi
by ripley12 5y ago
Hi, the `find` command is probably easiest: https://www.nushell.sh/book/commands/find.html https://www.nushell.sh/book/commands/find.html
ps | find k9
That will search through every column in the `ps` results. If you want to look through just the name column:
ps | where name =~ k9
- nerdponx 5y agoIs there a command to string-ify the input so that you can use standard Unix coreutils, etc. on it? This was always my big annoyance with Powershell too, the shell builtins and functions were powerful, but interacting with "dumb" old-style programs that expect and emit streams of text was cumbersome. Also, is `ps` here a wrapper or shell builtin? Or is Nushell actually parsing the output from the `ps` program?
- ripley12 5y agops is a shell builtin in Nu (and you can check that with `which ps`). Going from Nu to raw text is currently a little awkward. `str collect (char nl)` will take a Nu list of strings and convert it to raw text with line breaks. I suspect we'll get a more ergnomic way to do this soon. Going to Nu from raw text is nicer, the built-in `lines` command splits line-break-delimited text into a list of strings. From there you can use lots of Nu tools to operate on each line.