Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the common command set in Linux

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article is to share with you about how to use the common command set in Linux. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

The Linux common command set command is used to set the shell,set instruction to set the execution mode of the shell used, which can be set according to different requirements.

Syntax set [+-abCdefhHklmnpPtuvx] parameter description:

-a marks the modified variable for output to the environment variable.

-b causes the aborted daemon to report the execution status immediately.

The file generated by the C turn cannot overwrite an existing file.

‎-d Shell presupposes to use hash tables to remember used instructions to speed up the execution of instructions. Use the-d parameter to cancel. ‎

-e if the instruction returns a value that is not equal to 0, exit shell immediately.

-f cancels the use of wildcards.

-h automatically records the location of the function.

‎-H Shell can take advantage of "!" Add the way to execute the instructions recorded in history. ‎

The parameters given by the-k instruction are treated as environment variables for this instruction.

-l records the variable name of the for loop.

-m uses monitoring mode.

-n only reads instructions and does not actually execute them.

-p starts priority mode.

After-P starts the-P parameter, the symbolic link is replaced by the actual file or directory when the instruction is executed.

-t exits the shell after executing the following instructions.

-u when undefined variables are used during execution, an error message is displayed.

-v displays the input values read by shell.

-x after the instruction is executed, the instruction and the parameters are displayed first.

+ cancel the parameters that a set has started.

Example displays 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 "Thank you for reading! This is the end of the article on "how to use set in Linux". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report