shopt

Alibabacloud.com offers a wide variety of articles about shopt, easily find your shopt information here online.

How to start the Linux daemon

"foreground tasks" is only one: whether to inherit standard input. Therefore, the user can also enter additional commands while performing background tasks.Three, Sighup signalbecomes a "background task", does a process become a daemon? Or, after the user exits the session, will "background tasks" continue to execute?The Linux system is designed like this. User ready to exit session The system sends a signal to the session SIGHUP Session sends the SIGHUP signal to all c

Linux History Security Issue "save records Prevent deletion" + Perfect Linux/unix audit log each shell command

property. A good practice is to make all historical environment variables read-only, such as:Export histcontrol= export histfile= $HOME/.bash_history export histfilesize=2000 export histignore= Export histsize=1000 export histtimeformat= "%a%b%Y%T%z" typeset-r histcontrol typeset-r histfileHisttimeformat is an extension of the bash shell that will provide timestamps in the history file.For bash shell, you need to change some of the standard options for history:Shopt-s cmdhist #设置cmdhist

Linux program Debugging Common commands

1 Call TrackingTrace system call Strace ls–l Trace Library Call Ltrace2 lsof (list open file)See what files The program commands open lsof–p PID; Lsof–c CMD View files opened by a user lsof–u root See which program a file is accessed by lsof filename3 proc File systemVirtual file system, you can use cat,more,less to view For example: Cat/proc/cpuinfo; Cat/proc/meminfo4 Network debuggingPing tcpdump tcpdump–i ETH0–S0–SVX host 192.168.1.12 and Port 1234–w test.pcap Ethtool Traceroute NETSTAT–ANP |

Linux system Knowledge-processes & Threads

session, the system sends a SIGHUP signal to the sessionSession sends the SIGHUP signal to all child processesAutomatically exits after the child process receives the SIGHUP signalFront desk work will definitely receive sighup signal.Whether the background work will receive the sighup signal, determined by the Huponexit parameter ($shopt | grep hupon), this parameter determines whether the SIGHUP signal will be sent to background work when the sessio

3 Methods for removing all files outside some files in the shell _linux shell

One of my colleagues once asked me this question: how do I delete all files in the directory except some files under Linux? At the time, I told him that he could solve it by pattern matching. But in fact, besides, there are other methods, which are called "All roads lead to Rome". Let's take a look at them. If you want to delete all files except *.iso and *.zip in the ~/downloads directory, you can do this in bash: Method 1: Pattern matching method Copy Code code as follows:

Call details for Shell commands in Perl

In PERL development, system commands can usually be executed using the systems function or the ' operator ', but pay attention to alias, BG, bind, break, Builtin, CD, command, Compgen, complete, continue, Declare, dirs, Disown, Echo, enable, Eval, exec, exit, export, FC, FG, Getopts, hash, help, history, jobs, kill, le T, local, logout, popd, printf, pushd, pwd, read, ReadOnly, return, set, shift, shopt, source, suspend, test, times, tra P, type, type

The Unix shell uses the Globstart option in Bash to use the tutorial

* *TodoEcho $iDone}cd/root/jay/echo "------------------------"echo "Disable Globstar option:"# Globstar is disabled by defaultShopt-u GlobstarShowecho "------------------------"echo "Enable Globstar option:"Shopt-s GlobstarShow Executing the shell script of the test Globstar above, looking at its output, it is easy to understand Globstar, as follows: [Root@smilejay jay]#./test_globstar.sh------------------------Disable Globstar option:Dir1Dir2File1Fi

10 useful command line completion examples in Linux _linux shell

for the telnet command: $ telnet [tab][tab] localhost dev-db fileserver To allow programmable command completion to function at your terminal, you only need to perform the following/etc/bash_completion: #./etc/bash_completion You can also cancel/ETC/BASH.BASHRC (from the Ubuntu Linux 13.04 system) as follows, so that you do not need to execute the above command: ### Enable bash completion in interactive shells if! shopt-oq P

Ubuntu under RM instructions redirection

1. Install TRASH-CLI sudo apt-get install trash-cli2. Set up the script sudo gedit/usr/local/bin/trash-rm Copy #!/bin/bash # command name:trash-rm shopt-s extglob recursive=1 declare-a cmd ((i = 0)) for F In "$@" does case "$f" in (-* ([Fiiv]) r* ([Fiiv]) |-* ([Fiiv]) r* ([Fiiv])) tmp= "${f//[rr]/}" if [-N " $tmp "] then #echo" \ $tmp = = $tmp " cmd[$i]=" $tmp " ((i++)) fi recursive=0;; (--recursive) recursive=0; (*) if [$recursive! = 0- D "$f"

mysql-5.7 (centos-6.9 environment) source installation

Tags: setup ATI string pass LOB schema installation machine x86_642017-12-25 # Configure host name full display vim/etc/BASHRC # Turn on checkwinsize shopt-s Checkwinsize ["$PS 1"="\\s-\\v\\\$"] ps1="[\[email protected]\h \w]\\$"# Configure host name to be permanently active vim/etc/sysconfig/Network NETWORKING=Yes HOSTNAME=mysql-5.7-Master # Configure host name to take effect temporarilyhostnamemysql-5.7-Master # Configure hosts to parse vim/etc/hos

Linux Basic Knowledge points Miscellaneous note

, getopts, hash, help, history, jobs, kill, let,local, logout, mapfile, popd, printf, pushd, pwd, read, readonly, return, set, shift, shopt, source, suspend, test,times, trap, true, type, typeset, ulimit, umask, unalias, unset, waitAll of the above built-in commands must know the meaning, 90% can be easily used to qualify.External command:such as LS,IP,SS, etc. To see whether a command belongs to an external command or to a built-in com

Linux background execution

27535 27467 0 00:00:00 pts/0 grep ping Obviously, it is a sub-process of shell. The command is executed by a sub-shell in the background. The current shell (27467) gets control immediately and waits for user input, so my grep can be used. The background commands are executed in parallel with the current shell. They do not have mutual dependencies or waiting relationships, so they are asynchronous and parallel. Now the problem arises. If ssh exits and bash ends, what will happen to this process

Enhance Bash Functions

The following two tips to enhance Bash functions: one is to improve Bash command history management, and the other is to enable Bash to have a more intelligent automatic completion feature. The implementation process is not complex. You only need to modify the default configuration of Bash. Improve Bash command History Management: The default configuration of Bash has a problem. If you open two (or more) consoles at the same time, the commands executed on these two consoles are not shared to his

HPC cluster public network open security reinforcement and resource display

~] # Cat > Export HISTTIMEFORMAT = '% F % t' > Export HISTSIZE = 10000 > Export HISTFILESIZE = 10000 > Export HISTFILE =/public/sourcecode/Sugon_history_log > Shopt-s histappend > PROMPT_COMMAND = "history-a; \ $ PROMPT_COMMAND" > Export HOSTCONTROL = ignoredups > > EOF [Root @ node24 ~] # Source/etc/profile. d/Sugon_history.sh 6 restrict normal users from wasting login node resources [Root @ node24 ~] # Cat > @ Users-rss 16777216 # limits the maxi

10 command actions Linux administrator saves time

, shell automatically fixes all input errors when identifying the file or path name. Shopt-s cdspell  8. Open the application in the background When inspecting command lines, you may need to perform another task, such as responding to an email. Of course, you can open the GUI application from the terminal by executing other commands. You only need to call their names. In this example, open Gimp: $ Gimp But this effectively ends your terminal session,

Golang Creating a daemon Program

; * * The essential difference between "background task" and "foreground task" is only one: whether to inherit standard input. Background tasks no longer inherit the current session's standard input (stdin), you cannot enter instructions to the background task, but the background task inherits all the output from standard output (STDOUT) and standard error (STDERR) Background tasks will still be displayed synchronously on the command line * * The Hang-up signal (SIGHUP) is sent to the terminal c

Linuxbashscript concise Manual

. Example: j ?? K | [a-c] OK | jak. If the extglob option is enabled, advanced matching is supported. Shopt-s extglob? (Matching string) matches 0 or 1 matching string in parentheses. * (Matching string) matches 0 or more matching strings in brackets. + (Matching string) matches the matching string in one bracket. @ (Matching string) matches one of the matching strings in brackets .! (Matching string) matches a matching string that is not in parenthes

How to modify the language environment variables of a user in Linux

this to get set.# Even for non-interactive, non-login shells.If ["'id-gn '" = "'id-un'"-a 'id-U'-gt 99]; thenUmask 002ElseUmask 022Fi# Are we an interactive shell?If ["$ PS1"]; thenCase $ TERM inXterm *)If [-e/etc/sysconfig/bash-prompt-xterm]; thenPROMPT_COMMAND =/etc/sysconfig/bash-prompt-xtermElsePROMPT_COMMAND = 'echo-ne "\ 033] 0; $ {USER }@$ {HOSTNAME %. * }:$ {PWD/# $ HOME /~} \ 007 "'Fi;;Screen)If [-e/etc/sysconfig/bash-prompt-screen]; thenPROMPT_COMMAND =/etc/sysconfig/bash-prompt-scree

Weblogic startup scripts in Linux and Unix background

mode is generally used on the production machine, and the Server established according to the production mode needs to enter the management user name and password at startup. If you want to start the instance directly without being disturbed by the user name and password, follow these steps.   Create the file boot. properties in the root directory of the domain to be started. The content is the user name and password for controlling the domain. Directly write the file in plain text as follows:

Hacking bash History

mainConfiguration files (. bash_profile,. bash_login,. profile) then the above wowouldHappen. On the other hand, these files must read. bashrc in their body so thatThe options mentioned to. bashrc are actually applied in the first login shellAs well. # Cat>/home/bob/. bashrc > Shopt-s histappend> Readonly PROMPT_COMMAND = "history-"> EOF The option histappend orders bash to append the last $ HISTSIZE lines to$ HISTFILE file (normally ~ /. Bash_histor

Related Keywords:
Total Pages: 8 1 .... 4 5 6 7 8 Go to: Go

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.