shopt

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

3 ways to delete specific files in a directory using the bash shell

I am a new Linux user. Now I need to clean up a download directory of files, in fact, I just want to delete from the ~/download/folder except for files in the following format, other files: 1.*.iso-all ISO format files.2.*.zip-Files in all zip formats. How do I remove a specific file from a bash shell on a linux,os X or unix-like system? The Bash shell supports rich file pattern matching characters such as: 1.*-matches all the files.2.? -Matches a single letter in the file name.3.[...]-matches

Unbuntu 14.4Tab key cannot be auto-complete

1. Open the/ETC/BASH.BASHRC file with the VI editor (requires root permission)sudo vi/etc/bash.bashrcNext, you'll be prompted for a passwordAt this point vi may appear up and down problems, the solution:(1) Execute command sudo apt-get remove Vim-common(2) Execute command sudo apt-get install vim2. Locate the following code in the file#enable Bash completion in interactive shells#if! Shopt-oq POSIX; Then# if [-f/usr/share/bash-completion/bash_completi

Linux Bash Shell Learning (8): shell programming basics-string operations

-learning] $ echo $ {aa #*.} Xyz. hello. world [Wei @ wei-desktop bash-learning] $ echo $ {aa ##*.} World [Wei @ wei-desktop bash-learning] $ echo $ {aa % .*} Abc. xyz. hello [Wei @ wei-desktop bash-learning] $ echo $ {aa % .*} Abc [Wei @ wei-desktop bash-learning] $ echo $ {aa /./-} Abc-xyz.hello.world [Wei @ Wei-desktop bash-learning] $ echo $ {AA //./-} ABC-XYZ-Hello-world Pattern matching is often used for processing file names, such as removing the path name and obtaining the

Fully interpreting Linux environment variables

:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"' fi ;; screen) if [ -e /etc/sysconfig/bash-prompt-screen ]; then PROMPT_COMMAND=/etc/sysconfig/bash-prompt-screen else PROMPT_COMMAND='printf "\033]0;%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"' fi ;; *) [ -e /etc/sysconfig/bash-prompt-default ] PROMPT_COMMAND=/etc/sysconfig/bash-prompt-default ;; esac fi # Turn on chec

Linux SSH exit, the background process started will not stop

In general, if you want to run a task over a long period of time, you need to use nohup or screen, what happens if you don't use it? To test the description: The scene 1:ssh login machine, by adding (), start the task to the background, exit by exiting the command, the task still exists scene 2:SSH login machine, by adding (), start the task to the background, directly close the SSH terminal (GUI directly fork out the window),The task terminates the test method and executes the following command

3 ways to delete specific files in a directory using bash shell _linux Shell

I am a new Linux user. Now I need to clean up a download directory of files, in fact, I just want to delete from the ~/download/folder in addition to the following format files so other files: 1.*.iso-All documents in ISO format.2.*.zip-All files in zip format. How do I delete a particular file in a bash shell based on a linux,os X or unix-like system? The Bash shell supports rich file pattern matching characters such as: 1.*-matches all the files.2.? -Matches a single letter in the filename

A command to delete all files except a file in the Linux shell __linux

Linux anti-select Delete file The easiest way is to # shopt-s Extglob (open Extglob mode)# RM-FR! (File1)If you want to exclude multiple, you can do this:# RM-RF! (File1|file2) LINUXRM Delete Other file method totals outside the specified fileFirst, Linux delete files and folders Common commands are as follows: Delete files: RM fileDelete folder: Rm-rf dirIt should be noted that rmdir can only delete empty folders. Delete all documents except the dev

Ubuntu tab cannot auto-complete command parameters

There are these lines in the/ETC/BASH.BASHRC.#enable Bash completion in interactive shells# if! Shopt-oq POSIX; Then# if [-f/usr/share/bash-completion/bash_completion]; Then# . /usr/share/bash-completion/bash_completion# elif [-f/etc/bash_completion]; Then# . /etc/bash_completion# fi# fiRemove comments#enable Bash completion in interactive shellsif! Shopt-oq POSIX; Thenif [-f/usr/share/bash-completion/bash_

Linux Tips (1)

1. Avoid directory spelling errorsshopt command:Demo:I want to go into the/home directory but accidentally spelled the wrong:[[email protected] ~]$ cd/hoem-BASH:CD:/hoem:no such file or directoryIf you use the shopt command, the situation is different:[Email protected] ~]$ shopt-s Cdspell[Email protected] ~]$ Cd/hoem/home[Email protected] home]$ pwd/homeThat's right!2. Delete all files or directories outsi

Basic analysis of Linux operating system (vii)--bash (Shell) Basics (5)

stopped. Jobs that have been stopped send sigcont signals to ensure they receive the sighup signal. To prevent the shell from sending a signal to a separate job, you should use the built-in command disown to remove it from the job table or use Disown-h to mark it as not receiving sighup.If the Huponexit option is set with the shopt command, Bash sends a sighup signal to all jobs when the interactive logon shell exits.If bash is waiting for the comman

Linux Modify History

1. Cat ~/.bash_history2. History | MoreEnter the keyboard----------lineSpace Keyboard---------------one page3,! 103 Execution of 103th orderProblemIn the process of using bash, we may want to .bash_history document more useful historical commands, so that we can query later, and here's a workaround. Change the default history> vi ~/.bashrc# 添加# 忽略[连续]重复命令HISTCONTROL=ignoredups# 清除重复命令# HISTCONTROL=erasedups# 忽略特定命令HISTIGNORE="[ ]*:ls:ll:cd:vi:pwd:sync:exit:history*"# 命令历史文件大小10MHISTFILESIZE=100

Basic analysis of Linux operating system (vii)--bash (Shell) Basics (1)

.:If you have the-i option, the shell executes interactively (interactive).-L:option allows bash to launch in a way similar to the login shell.-R:If you have the-r option, the shell becomes restricted (restricted).-S:If there is the-s option, or if there are no parameters remaining after the option is processed, the command is read from the standard input. This option allows you to set the positional parameters when starting an interactive shell.-D:Prints a list of strings in double quotation ma

Linux Commands Application Large dictionary-10th chapter shell-related commands

10.1 Commond: Suppress normal shell function lookups 10.2 exec: Replacing the current shell process with the Execute command 10.3 Bash:gnu's Bourne-again shell interpreter 10.4 Builtin: Execute shell built-in command 10.5 Enable: Enables or disables built-in shell commands 10.6 Source: Reads and executes commands from the specified file in the current shell environment 10.7 Mksh: Command interpreter for interactive and shell scripts 10.8 Suspend: Pause shell execution

Why can't I find the command bash: Is: cannot find the command

name [arg] Hash [-lr] [-p pathname] [-dt] [na help [-s] [pattern...] History [-c] [-d offset] [n] or hi if COMMANDS; then COMMANDS; [elif Jobs [-lnprs] [jobspec...] or job kill [-s sigspec |-n signum |-si Let arg [arg...] local name [= value]... Logout popd [+ N |-N] [-n] Printf [-v var] format [arguments] pushd [dir | + N |-N] [-n] Pwd [-LP] read [-ers] [-u fd] [-t timeout] [ Readonly [-af] [name [= value]...] return [n] Select NAME [in WORDS...;] do CO set [-- abefhkmnptuvxBCHP] [-o opti Shif

MySQL administrator Guide

them, you need to copy them to the appropriate directory mysql/bin.#./Mysql. server start How does Sun Solariys automatically enable mysql upon startup?Write a start and close batch processing file Web (under the path/etc/init. d). The content is as follows: #! /Bin/shOPT _ = $1 Case "$ OPT _" inStart)/Bin/echo "$0: (start )"## Your service startup command goes here.#/Usr/local/apache/bin/apachectl start/Home3/mysql/bin/safe_mysqld-O join_buffer = 12

Bash Internal commands

builtinsBash_builtins (1) bash_builtins (1) NameBash,:,., [, 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, let, local, logout, popd, printf, pushd, PWD, read,Readonly, return, set, shift, shopt, source, suspend, test, times, trap, type, typeset, ulimit, umask, unalias, unset, wait-BashBuilt-in commands, see Bash

Install math-MATLAB in Linux and use Perl scripts to call the MATLAB test program.

-0.08] # Perl makefile. pl mp_apxs =/usr/sbin/apxsEnter command to execute matlab [/usr/local/bin/Matlab-nodisplay-nojvm]:You cannot press enter here. I use the find command and find that the MATLAB command is in/usr/local/Matlab/bin/MATLAB. Therefore, I manually enter: /usr/local/Matlab/bin/Matlab-nodisplay-nojvmAfter you press enter, the following message is displayed:Attempting to run MATLAB... which: No shopt in (/usr/lib/qt-3.3/bin:/usr/Kerberos/

Shell script learning notes (2)-Variables

Variables and strings Bash shell does not have the so-called "Data Form" unless the built-in declare is used to specify the variable type. In Bash shell, there is only one data type: A string consisting of Characters Use it without having to go through the stated procedure After the variable value is set, the variable value is valid only in the current shell environment. Variable name length is unlimited, case sensitive. Variable setting method: variable name = value, but the good habit is to en

10 examples of command line completion in Linux

the Programme command complementing function to work on your terminal, you only need to execute the following/etc/bash_completionYou can: #./etc/bash_completion You can also cancel/etc/bash.bashrc(From Ubuntu Linux 13.04). In this way, you do not need to execute the above command: ### enable bash completion in interactive shells if! shopt -oq posix;then if[-f /usr/share/bash-completion/bash_completion ];then ./usr/share/bash-completion/bash_c

Bash command method for correcting spelling errors in Linux, linuxbash

: $ vi ~/.bashrc Add the following lines. [...]shopt -s cdspell Enter: wq to save and exit the file. Finally, run the following command to update the changes. $ source ~/.bashrc Now, if there are any spelling errors in the path when using the cd command, it will automatically correct and enter the correct directory. As you can see in the preceding command, I intentionally entered an error (Donloads instead of Downloads), but Bash automatically detecte

Related Keywords:
Total Pages: 8 1 .... 3 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.