1. No longer save historical records or reduce the number of historical records savedModify/etc/profile to change histsize=1000 to 0 or quantity to keepClears the. Bash_history under the user's home path.
Copy Code code as follows:
Echo ' >/home/user/.bash_history
2. Immediately empty the history record of the current history command
Copy Code code as follows:
In Windows 3.02 64-bit system, when cygwin is used to run the liunux program, the following error occurs: Bash-$:
The reason is:
In the 64-bit operating system, the 32 program and the 64-bit program read the location registry key, in the 64-bit Registry Editor, HKEY_LOCAL_MACHINE \ SOFTWARE corresponds to the registry key of the 64-bit program, and the 32-bit registry key is mapped to HKEY_LOCAL_MACHINE \ SOFTWARE \ wow6432node. If both versions are r
Bash array, bashBash only supports one-dimensional arrays. And the array subscript starts from 0.Assign values to Arrays:Array = (1 4 7 2 5 8) # use space as the delimiter and () as the arrayStr = "this is test string"Str_arr = ($ str); # separated by spaces by defaultArray traversal:For val in str_arr [*]; do echo $ val; doneFor file in 'LS'; do echo $ file; doneNumber of array elements: $ {# array}For example, each character in a string is split int
$filename/etc/sysconfig/network-scripts[[email protected] Network-scripts] #将第一次出现的小写s替换成大写的S [[email protected] network-scripts]# echo ${filename/s/s}/etc/sysconfig/ Network-scripts[[email protected] network-scripts] #将所有的小写s替换成大写的S [[email protected] network-scripts]# echo ${ Filename//s/s}/etc/sysconfig/network-scripts[[email protected] network-scripts]# Summary:/match/ Value: Replace the first occurrence of match with Value//match/value: Replaces all match with value
Operators for
History cmd are for list Bash ' s log of the historical cmd you typed1. List last n commandsHistory n2. Execute cmd NO.N!n3. Execute last cmd!!Or-14. Execute command n times before? -05. Execute the last cmd, which starts with "string"! string6. Execture the last cmd, that contains "string"!? string?7. Execute the "CommandName" with any of the args used on your last cmdCommandName!*Search Command HistoryWit
Telnet is unavailable !!! Tip:-bash: telnet: command not found, telnet-bashI. Check1. [root @ localhost ~] # TelnetBash: telnet: command not found2. Check whether the Telnet package is installed. The result is as follows:[Root @ localhost ~] # Rpm-qa telnet *Telnet-server-0.17-47.el6.i6863. query the xinetd status again:[Root @ localhost ~] # Service xinetd statusXinetd (pid 2967) is running...4. Run the ntsysv command to enable the Telnet service. Yo
as an octal form (' \012 ') or hexadecimal (' \x0a ').
c-k
Vertical tab (Vertical tab.). When you enter text in the console or Xterm window, C-k removes all characters from the cursor to the end of the line. In the script, ctrl-k may have different behavior, the following example gives its different behavior:
code
123456789101112
#!/bin/bash ## A c-k vertical ta
(please try it ). The second thing to note is: Although quotation marks can be omitted when defining a word, when the defined environment variable value is more than one word (including space or tabulation key ), quotation marks are required.
Reference details
For more information about how to use quotation marks in bash, see the reference section on the bash help page. The special character sequence is ex
,ignorespaceNBSP; erasedups: Remove Duplicate command Let the above environment variables take effect:1, directly in the current shell input related variables, such as we do not want to retain the command history, we set the histsize to 0[Email protected] ~]# histsize=0 [Email protected] ~]# historyTested and successful. However, the limitation of this setting is that its scope is only for the current shell and its child shell, if the switc
10 shortcuts to master bash-general Linux technology-Linux technology and application information. The following is a detailed description. If you have input commands in a Linux shell Command Prompt, you may have used bash. Because it is the default shell of most modern releases of GNU/Linux.
Bash shell is the main interface of the Linux operating system. It can
, because SH is just a symbolic link to bash.POSIX ShellThe POSIX shell is a variant of the Korn shell. The largest vendor currently providing POSIX shells is Hewlett-Packard. The HP-UX 11.0,posix Shell is/bin/sh.--Quote from "Baidu Encyclopedia"=============================================================Bash is the default shell for most Linux systems and Mac OS X, which can run on most UNIX class operating systems and even be ported to the Cygwin s
If you use the Linux command line frequently, then using the history command can effectively improve your efficiency. This article will introduce you to the 15 usages of the history command in the form of an instance.
displaying timestamps using HisttimeformatWhen you execute the history command from the command line, it usually shows only the ordina
pre-Class review : To find the sum of divisible by 3 divisible by 200# !/bin/bash -Isum= 0 for with {1..200};d o if [$[$i%3]-eq 0]; then let Su M+="Thesum is: $sum"Bash's knowledge points :Conditional testing: Making a logical operation on a condition with : Condition 1 Condition 2 or : Condition 1 | | condition 2 non- :! Conditions example :#userName =root#id $userName echo "userName exist"If the former fails,
Description : This is a relatively simple bash script editor, but has been tested. The reason for writing this blog is to practice the loop control language, functions, positional parameters, local variables, and function parameter calls, as well as calls between functions, as well as parameters for obtaining user options and options.Note: The script options and the script options parameter get method use getopt and make further judgments, consult the
If you use the Linux command line frequently, then using the history command can effectively improve your efficiency. This article will introduce you to the 15 usages of the history command in the form of an instance.
displaying timestamps using HisttimeformatWhen you execute the history command from the command line, it usually shows only the ordinal of the
the most common reference functions.
Third, although double quotation marks can usually be used to replace single quotation marks, in the above example, this will cause errors. Why? Because the bash feature called extension is disabled with single quotes, special characters and character series are replaced by values. For example ,"! "Is a history extension character.
symbolic link to bash.POSIX ShellThe POSIX shell is a variant of the Korn shell. The largest vendor currently providing POSIX shells is Hewlett-Packard. The HP-UX 11.0,posix Shell is/bin/sh.=============================================================Note: The contents of the "=" tag are reproduced in the network. Bash is the default shell for most Linux systems and Mac OS X, which can run on most UNIX class operating systems and even be ported to th
Understanding browser history and browser history
This is a basic article about history stack Management in browsers. The reason for writing this is that I recently want to study pushState to see what problems will occur when using it to implement SPA. pushState ultimately affects the content in the browser history rec
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.