Linux set command
Linux Command大全
Linux set command for setting the shell.
The set command can set the execution mode of the shell used and can be set according to different needs.
Syntax
set [+-abCdefhHklmnpPtuvx]
Parameter description:
- -a Mark modified variables for output to environment variables.
- -b Make the background process report its execution status immediately if it is interrupted.
- -C The file to which the output is directed cannot overwrite an existing file.
- -d The shell will use a hash table to remember the commands used to accelerate command execution. Use-d parameter can be canceled.
- -e Exit the shell immediately if the return value of the command is not equal to 0.
- -f Cancel the use of wildcards.
- -h Automatically record the location of functions.
- -H Shell Use "!" plus <command number> to execute commands recorded in history.
- -k All parameters given to the command will be treated as environment variables for this command.
- -l Record the variable names in the for loop.
- -m Use monitoring mode.
- -n Read the command without actually executing it.
- -p Start in priority mode.
- -P Start-P parameters, when executing commands, will replace symbolic links with actual files or directories.
- -t Exit the shell after executing the following command.
- -u Display an error message if an undefined variable is used during execution.
- -v Display the input values read by the shell.
- -x Display the command and its arguments before executing the command.
- +<Parameter> Cancel a parameter that was previously started by set.
Online examples
Display environment variables
# set
BASH=/bin/bash
BASH_ARGC=()
BASH_ARGV=()
BASH_LINENO=()
BASH_SOURCE=()
BASH_VERSINFO=([0]="3" [1]="00" [2]="15" [3]="1" [4]="release" [5]="i386-redhat-linux-gnu")
BASH_VERSION='3.00.15(1)-release'
COLORS=/etc/DIR_COLORS.xterm
COLUMNS=99
DIRSTACK=()
EUID=0
GROUPS=()
G_BROKEN_FILENAMES=1
HISTFILE=/root/.bash_history
HISTFILESIZE=1000
HISTSIZE=1000
HOME=/root
HOSTNAME=hnlinux
HOSTTYPE=i386
IFS=$' '
INPUTRC=/etc/inputrc
KDEDIR=/usr
LANG=zh_CN.GB2312
LESSOPEN='|/usr/bin/lesspipe.sh %s'
LINES=34
L
MAIL=/var/spool/mail/root
MAILCHECK=60
OLDPWD=/home/uptech
OPTERR=1
OPTIND=1
OSTYPE=linux-gnu
PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin:/opt/crosstools/gcc-3.4.6-glibc-2.3.6/bin
PIPESTATUS=([0]="2")
PPID=26005
PROMPT_COMMAND='echo -ne "
Linux Command大全