Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions ja/book/coming_from_bash.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,24 @@
| | `rm -t <path>` | Move the given file to the system trash |
| `rm -rf <path>` | `rm -r <path>` | Recursively removes the given path |
| `chmod` | `<not yet possible>` | Changes the file attributes |
| `date -d <date>` | `echo <date> \| str to-datetime -f <format>` | Parse a date ([format documentation](https://docs.rs/chrono/0.4.15/chrono/format/strftime/index.html)) |
| `sed` | `str find-replace` | Find and replace a pattern in a string |
| `date -d <date>` | `"<date>" \| into datetime -f <format>` | Parse a date ([format documentation](https://docs.rs/chrono/0.4.15/chrono/format/strftime/index.html)) |
| `sed` | `str replace` | Find and replace a pattern in a string |
| `grep <pattern>` | `where $it =~ <substring>` | Filter strings that contain the substring |
| `man <command>` | `help <command>` | Get the help for a given command |
| | `help commands` | List all available commands |
| | `help --find <string>` | Search for match in all available commands |
| `command1 && command2` | `command1; command2` | Run a command, and if it's successful run a second |
| `stat $(which git)` | `stat (which git).path` | Use command output as argument for other command |
| `echo $PATH` | `echo $nu.path` | See the current path |
| `<update ~/.bashrc>` | `config set path [<dir1> <dir2> ...]` | Update PATH permanently |
| `export PATH = $PATH:/usr/other/bin` | `pathvar add <path>` | Update PATH temporarily |
| `export` | `echo $nu.env` | List the current environment variables |
| `<update ~/.bashrc>` | `echo $nu.env \| insert var value \| config set_into env` | Update environment variables permanently |
| `echo $PATH` | `$env.PATH` (Non-Windows) or `$env.Path` (Windows) | See the current path |
| `<update ~/.bashrc>` | `vim $nu.config-path` | Update PATH permanently |
| `export PATH = $PATH:/usr/other/bin` | `$env.PATH = ($env.PATH \| append /usr/other/bin)` | Update PATH temporarily |
| `export` | `$env` | List the current environment variables |
| `<update ~/.bashrc>` | `vim $nu.config-path` | Update environment variables permanently |
| `FOO=BAR ./bin` | `FOO=BAR ./bin` | Update environment temporarily |
| `export FOO=BAR` | `$env.FOO = BAR` | Set environment variable for current session |
| `unset FOO` | `$env.FOO = $nothing` | Unset environment variable for current session |
| `export FOO=BAR` | `$env.FOO = "BAR"` | Set environment variable for current session |
| `unset FOO` | `hide-env FOO` | Unset environment variable for current session |
| `alias s="git status -sb"` | `alias s = git status -sb` | Define an alias temporarily |
| `<update ~/.bashrc>` | `alias --save myecho [msg] { echo Hello $msg }` | Define an alias for all sessions (persist it in startup config) |
| `<update ~/.bashrc>` | `<update nu/config.toml>` | Add and edit alias permanently (for new shells), find path for the file with `config path` |
| `<update ~/.bashrc>` | `vim $nu.config-path` | Add and edit alias permanently (for new shells) |
| `bash -c <commands>` | `nu -c <commands>` | Run a pipeline of commands (requires 0.9.1 or later) |
| `bash <script file>` | `nu <script file>` | Run a script file (requires 0.9.1 or later) |
| `\` | `<not yet possible>` | Line continuation is not yet supported. |
Loading