Skip to content

Commit cd6c78b

Browse files
authored
Update redirection examples in "coming from bash" (#1315)
* Update redirection examples * Update listed nushell version * Update command xargs example to use spread
1 parent d96a53e commit cd6c78b

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

book/coming_from_bash.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ To make these commands available in `nu` as well, add the following line to your
77
$env.Path = ($env.Path | prepend 'C:\Program Files\Git\usr\bin')
88
```
99

10-
Note: this table assumes Nu 0.60.0 or later.
10+
Note: this table assumes Nu 0.91.0 or later.
1111

1212
| Bash | Nu | Task |
1313
| ------------------------------------ | ------------------------------------------------------------- | ----------------------------------------------------------------- |
@@ -17,18 +17,20 @@ Note: this table assumes Nu 0.60.0 or later.
1717
| `ls -la` | `ls --long --all` or `ls -la` | List files with all available information, including hidden files |
1818
| `ls -d */` | `ls \| where type == dir` | List directories |
1919
| `find . -name *.rs` | `ls **/*.rs` | Find recursively all files that match a given pattern |
20-
| `find . -name Makefile \| xargs vim` | `ls **/Makefile \| get name \| vim $in` | Pass values as command parameters |
20+
| `find . -name Makefile \| xargs vim` | `ls **/Makefile \| get name \| vim ...$in` | Pass values as command parameters |
2121
| `cd <directory>` | `cd <directory>` | Change to the given directory |
2222
| `cd` | `cd` | Change to the home directory |
2323
| `cd -` | `cd -` | Change to the previous directory |
2424
| `mkdir <path>` | `mkdir <path>` | Creates the given path |
2525
| `mkdir -p <path>` | `mkdir <path>` | Creates the given path, creating parents as necessary |
2626
| `touch test.txt` | `touch test.txt` | Create a file |
27-
| `> <path>` | `\| save --raw <path>` | Save string into a file |
28-
| `>> <path>` | `\| save --raw --append <path>` | Append string to a file |
27+
| `> <path>` | `out> <path>` or `o> <path>` | Save command output to a file |
28+
| | `\| save <path>` | Save command output to a file as structured data |
29+
| `>> <path>` | `out>> <path>` or `o>> <path>` | Append command output to a file |
30+
| | `\| save --append <path>` | Append command output to a file as structured data |
2931
| `> /dev/null` | `\| ignore` | Discard command output |
30-
| `> /dev/null 2>&1` | `out+err> /dev/null` | Discard command output, including stderr |
31-
| `command arg1 arg2 2>&1 \| less` | `run-external --redirect-combine command [arg1 arg2] \| less` | Pipe stdout+stderr of a command into less, output updated live |
32+
| `> /dev/null 2>&1` | `out+err>\| ignore` or `o+e>\| ignore` | Discard command output, including stderr |
33+
| `command 2>&1 \| less` | `command out+err>\| less` or `command o+e>\| less` | Pipe stdout and stderr of a command into less |
3234
| `cmd1 \| tee log.txt \| cmd2` | `cmd1 \| tee { save log.txt } \| cmd2` | Tee command output to a log file |
3335
| `cat <path>` | `open --raw <path>` | Display the contents of the given file |
3436
| | `open <path>` | Read a file as structured data |

0 commit comments

Comments
 (0)