Aliases
Making up new commands as abbreviations for longer, more complex commands:
aliaslists all aliasesalias namedisplays the value of this aliasalias name [word_list]setsword_listas the value fornameunalias [name1, name2...]remove the given aliases.*is supported.
Special aliases supported:
precmdruns just before each prompt is printedcwdcmdruns after every change of working directory
History
Invoking previous commands using command history:
!!executes the previous command!nexecutes the nth command that was previously executed!-nexecutes the command that was executedncommands ago!stringexecutes the most recently executed command that starts withstring!?stringexecutes the most recently executed command that containsstringhistory [nb]displays the previous commands (up tonbif specified) with their index and time of execution (hh:mm)
.42sh_history file is also stored in the user's home folder to have a persistent history between sessions.
Job control
fg idbrings the specified job into the foreground, whereidis the job IDjobslists all jobs
Line editing
↑and↓to select a command from the history to edit/execute←and→to move in the input and edit itCTRL+Lto clear the screen
Local environment
Variables specific to the current shell:
set var = valcreates/updatesvarwithvalset var1 var2 ...creates/updates several variables with empty values-ris an option that can be used withsetfor a read-only variable, which means that you won't be able to usesetorunseton it again.unset var1 var2 ...removes the given variables
Preloaded variables:
cwdfor the current working directory (will be updated when you change directory)euidfor the effective user ideuserfor the effective usernamegidfor the user's group idgroupfor the user's group namehistoryexplained below, set to100by defaulthomefor the user's home directoryowdfor the old working directory (will be updated when you change directory)uidfor the user iduserfor the username
Special variables supported:
ignoreeofto disable EOF shell exit if set to0or empty. If set to a numbern, the shell will exit on the nth consecutive EOF.historyto set a limit of commands display by the builtin of the same name.
Florian Lauch |
Léa Guillemard |
Dorian Moy |
Reza Rahemtola |
|---|