-U, as global with -g, or local with -l. Scoping rules are as follows:-x.echo $PATH[3]for i in $PATH; echo $i is in the path; endset smurf blue small makes an array called smurf containing "blue" and "small".set -e smurf[1]function llls -l $argvend$argv, call the function using ll.& suffix. You can suspend a currently running job using Ctrl-Z. You can put the suspended job in the background with bg. Finally, you can list all running jobs with jobs.command; and command2 or command; or command2. and and or check the previous command's exit status and act accordingly.function ls command ls --color=auto $argvendalias NAME DEFINITION which does this for you.|
Redirect stdin
|
N<SOURCE_FILE (N is optional, default is 0) |
|
Redirect stdout
|
N>DESTINATION (N is optional; default is 1) |
|
Redirect stderr
|
N^DESTINATION (N is optional; default is 2) |
|
Redirect with appending
|
>> or ^^ + DESTINATION_FILE |
|
Close FD
|
use
- as SOURCE_FILE or DESTINATION |
|
Pipe stdout
|
command1 | command2 |
|
Pipe a different FD
|
command1 N>| command2 |
|
How do I glob for all but one specific file?
find -mindepth 1 -maxdepth 1 -type f -a -name "*.jpg"
|
? for any single character (except /), for any string of characters (except /) (including empty string), and for any string of characters, including the empty string and /.echo input.{c,h,txt}>> input.c input.h input.txt$ followed by a string of characters is expanded to the value of the environmental variable with that name. Surround the variable with braces to separate it from text.% followed by a string is expanded into a PID according to the following rules:self, insert the shell's PID..:echo (seq 10)[2..5 1..3]>> 2 3 4 5 1 2 3|
argv
|
array of arguments to a shell function; only defined in a function call or when fish is invoked to run a script
|
|
history
|
array containing the last commands that were entered
|
|
HOME
|
the user's home directory
|
|
PWD
|
the current working directory
|
|
status
|
the exist status of the last foreground job to exit
|
|
USER
|
the current username
|
|
Complete current token
Tab
|
|
Accept autosuggestion
at end of line: End/Ctrl-E/Right/Ctrl-F
|
|
Move to beginning of line
Home/Ctrl-A
|
|
Move to end of line
End/Ctrl-E
|
|
Move character-wise
Left/Ctrl-B or Right/Ctrl-F
|
|
Move word-wise
Alt-Left or Alt-Right
|
|
Move through directory history
on empty cmd line: Alt-Left or Alt-Right
|
|
Search history for prefix in cmd line
Up or Down
|
|
Search history for token containing token under cursor
Alt-Up or Alt-Down
|
|
Delete characterwise
Delete/Ctrl-D (forwards) or Backspace (backwards)
|
|
Delete entire line
Ctrl-C
|
|
Move contents from cursor to EOL to killring
Ctrl-K
|
|
Move contents from beginning of line to cursor to killring
Ctrl-U
|
|
Repaint screen
Ctrl-L
|
|
Move preview word to killring
Ctrl-W
|
|
Move next word to killring
Alt-D
|
|
Print description of cmd under cursor
Alt-W
|
|
List contents of current directory or directory under cursor
Alt-L
|
|
Add '|less;' to end of job under cursor
Alt-P
|
|
Capitalize current word
Alt-C
|
|
Make current word uppercase
Alt-U
|
bind built-in command.
No comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.