Aliases
Making up new commands as abbreviations for longer, more complex commands:
alias
lists all aliasesalias name
displays the value of this aliasalias name [word_list]
setsword_list
as the value forname
unalias [name1, name2...]
remove the given aliases.*
is supported.
Special aliases supported:
precmd
runs just before each prompt is printedcwdcmd
runs after every change of working directory
History
Invoking previous commands using command history:
!!
executes the previous command!n
executes the nth command that was previously executed!-n
executes the command that was executedn
commands ago!string
executes the most recently executed command that starts withstring
!?string
executes the most recently executed command that containsstring
history [nb]
displays the previous commands (up tonb
if 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 id
brings the specified job into the foreground, whereid
is the job IDjobs
lists all jobs
Line editing
↑
and↓
to select a command from the history to edit/execute←
and→
to move in the input and edit itCTRL
+L
to clear the screen
Local environment
Variables specific to the current shell:
set var = val
creates/updatesvar
withval
set var1 var2 ...
creates/updates several variables with empty values-r
is an option that can be used withset
for a read-only variable, which means that you won't be able to useset
orunset
on it again.unset var1 var2 ...
removes the given variables
Preloaded variables:
cwd
for the current working directory (will be updated when you change directory)euid
for the effective user ideuser
for the effective usernamegid
for the user's group idgroup
for the user's group namehistory
explained below, set to100
by defaulthome
for the user's home directoryowd
for the old working directory (will be updated when you change directory)uid
for the user iduser
for the username
Special variables supported:
ignoreeof
to disable EOF shell exit if set to0
or empty. If set to a numbern
, the shell will exit on the nth consecutive EOF.history
to set a limit of commands display by the builtin of the same name.
Florian Lauch |
Léa Guillemard |
Dorian Moy |
Reza Rahemtola |
---|