Coming from Bash

If you're coming from Git Bash on Windows, then the external commands you're used to (bash, grep, etc) will not be available in nu by default (unless you had explicitly made them available in the Windows Path environment variable). To make these commands available in nu as well, add the following line to your config.nu with either append or prepend.

$env.Path = ($env.Path | prepend 'C:\Program Files\Git\usr\bin')

Note: this table assumes Nu 0.91.0 or later.

BashNuTask
lslsLists the files in the current directory
ls <dir>ls <dir>Lists the files in the given directory
ls pattern*ls pattern*Lists files that match a given pattern
ls -lals --long --all or ls -laList files with all available information, including hidden files
ls -d */ls | where type == dirList directories
find . -name *.rsls **/*.rsFind recursively all files that match a given pattern
find . -name Makefile | xargs vimls **/Makefile | get name | vim ...$inPass values as command parameters
cd <directory>cd <directory>Change to the given directory
cdcdChange to the home directory
cd -cd -Change to the previous directory
mkdir <path>mkdir <path>Creates the given path
mkdir -p <path>mkdir <path>Creates the given path, creating parents as necessary
touch test.txttouch test.txtCreate a file
> <path>out> <path> or o> <path>Save command output to a file
| save <path>Save command output to a file as structured data
>> <path>out>> <path> or o>> <path>Append command output to a file
| save --append <path>Append command output to a file as structured data
> /dev/null| ignoreDiscard command output
> /dev/null 2>&1out+err>| ignore or o+e>| ignoreDiscard command output, including stderr
command 2>&1 | lesscommand out+err>| less or command o+e>| lessPipe stdout and stderr of a command into less
cmd1 | tee log.txt | cmd2cmd1 | tee { save log.txt } | cmd2Tee command output to a log file
cat <path>open --raw <path>Display the contents of the given file
open <path>Read a file as structured data
mv <source> <dest>mv <source> <dest>Move file to new location
cp <source> <dest>cp <source> <dest>Copy file to new location
cp -r <source> <dest>cp -r <source> <dest>Copy directory to a new location, recursively
rm <path>rm <path>Remove the given file
rm -t <path>Move the given file to the system trash
rm -rf <path>rm -r <path>Recursively removes the given path
date -d <date>"<date>" | into datetime -f <format>Parse a date (format documentationopen in new window)
sedstr replaceFind and replace a pattern in a string
grep <pattern>where $it =~ <substring> or find <substring>Filter strings that contain the substring
man <command>help <command>Get the help for a given command
help commandsList all available commands
help --find <string>Search for match in all available commands
command1 && command2command1; command2Run a command, and if it's successful run a second
stat $(which git)stat (which git).pathUse command output as argument for other command
echo /tmp/$RANDOM$"/tmp/(random integer)"Use command output in a string
cargo b --jobs=$(nproc)cargo b $"--jobs=(sys | get cpu | length)"Use command output in an option
echo $PATH$env.PATH (Non-Windows) or $env.Path (Windows)See the current path
<update ~/.bashrc>vim $nu.config-pathUpdate PATH permanently
export PATH = $PATH:/usr/other/bin$env.PATH = ($env.PATH | append /usr/other/bin)Update PATH temporarily
export$envList the current environment variables
<update ~/.bashrc>vim $nu.config-pathUpdate environment variables permanently
FOO=BAR ./binFOO=BAR ./binUpdate environment temporarily
export FOO=BAR$env.FOO = BARSet environment variable for current session
echo $FOO$env.FOOUse environment variables
echo ${FOO:-fallback}$env.FOO? | default "ABC"Use a fallback in place of an unset variable
unset FOOhide-env FOOUnset environment variable for current session
alias s="git status -sb"alias s = git status -sbDefine an alias temporarily
type FOOwhich FOODisplay information about a command (builtin, alias, or executable)
<update ~/.bashrc>vim $nu.config-pathAdd and edit alias permanently (for new shells)
bash -c <commands>nu -c <commands>Run a pipeline of commands
bash <script file>nu <script file>Run a script file
\( <command> )A command can span multiple lines when wrapped with ( and )
pwd$env.PWDDisplay the current directory
read varlet var = inputGet input from the user
Contributors: Justin Ma, Hristo Filaretov, Arnout Engelen, Darren Schroeder, Ian Manske, Tw, 1submarine, Aidan Gauland, Alex Saveau, Antoine Stevan, Calliope, Carson Riker, Christopher Durham, Herlon Aguiar, Homa Wong, Ibraheem Ahmed, JT, Jonathan Turner, Kayla Washburn, Kyle J Strand, Leon, Lucas Kent, Motalleb Fallahnezhad, Tomas Zemanovic, Vladimir Budylnikov, Zhora Trush, ammkrn, chtenb, rafael de bem