1.1. After opening the terminal, a prompt will appear, usually in the following form:
[email protected]$
Or is:
[email protected] #
It is either simply expressed in $ or #.
($ represents a normal user, #表示超级用户 (root
A ShiftParameter shift LeftUntil [$#-eq 0]Doecho "The first parameter is: The number of arguments is: $#"ShiftDoneTwo WcThis command is used to count the number of bytes, words, and lines in the specified file. The command options have the following
#!/bin/bash# Linux Shell multifile content replace withsed# Disclaimer: # The source code is mainly the use of two (Chinese and English) with the same key-value pairs of JSON data, the HTML in the Chinese language # Automatic text substitution code.
Shuffle question: Wash a pair of poker, what good way? Can be washed evenly, and can wash fast? How efficient is the order of chaos relative to a file? On the shuffle problem, there has been a good shell solution, here another three based on the
How scripts are executedFor example, we wrote a script under/root/, named Hello.sh. So how does the call execute it? There are two ways to do this:(1) Directly through bash, as follows:Bash hello.shNote: Execute scripts with bash and do not need to
Experiment (I.)Experimental purpose: Detect system once per minute "The root partition has less than 10G of free space to send warning messages to all terminals. "Experimental requirements: Write a script and automate the script.Experimental
First, what is the bean ShellBeanShell is a scripting language that conforms fully to the Java syntax specification and has its own syntax and methods. BeanShell is a loosely typed scripting language (this is similar to JS); BeanShell is written in
The relationship between the computer and the kernel, the shell: first, the management of the entire computer hardware is actually the operating system kernel (kernel), the kernel is required to protect, so our average user can only through the
ls: View file name and directory, usage: $ ls [option]1. $ lsEnter the LS command directly, listing all files and directories in the current directory, without displaying details such as type, size, date permissions, and so on.2. $ ls-lThe-l option
WC: View File Statistics usage: $ WC filename1. $ WC fileName$ WC FileNameX Y Z/desktop/helloX: Indicates the number of rowsY: Indicates the number of wordsZ: Indicates the number of bytes/desktop/hello: Indicates file name2. $ wc-l FileName-l
Cat: View the contents of a file, connect a file, create one or more files, and redirect output to a terminal or file usage: cat [options] [file]1. $ Cat Hello.txtdisplaying content in a hello.txt text file2. $ cat-n File-N option to display the
Existing file1, file2, file3 three files, the contents are as follows$cat File1f1_1f1_2f1_3$cat File2f2_1f2_2f2_3$cat File3f3_1f3_2f3_3Write a shell script to read these three files line by row#!/bin/bashcat file1 file2 file3 |while read P do echo
Transfer from http://www.cnblogs.com/chengmo/archive/2010/10/20/1855805.htmlBefore we get to the redirect, let's take a look at the Linux file descriptor.Linux File Descriptor : Can be understood as a Linux trace open file, and the allocation of a
1) How do I pass parameters to a script?./script argumentExample : Show file name script./show.sh File1.txtcat Show.sh#!/bin/bashcat $2) How do I use parameters in a script?First parameter: $ $, second argument: $ AExample: The script will copy the
Hardware Chapter
CPU-related
Lscpu #查看的是cpu的统计信息. Cat/proc/cpuinfo #查看CPU信息详细信息, such as the model of each CPU, frequency, etc.
Memory-related
Free-m #概要查看内存情况 The unit here is
First, IntroductionShell two command execution mode:1. Interactive: single Command execution2. Batch processing: scriptShell scripts are interpreted and do not need to be compiledtips: try to use a regular user accountSecond, the InterpreterRole:
1. How Shell scripts work The Linux shell script is similar to Windows batch, but it has a lot more powerful features than Windows batch processing. The shell script is actually a stack of shell commands, with syntax such as shell operations,
Bash Script Programming:Variable: variable nameArray: Contiguous number of independent memory spaces, each memory space equivalent to a variable;Element: array name [index]Bash 4.0+Traditional arrays: Indexed as numbers, numbering starting from
The SED editor processes the input line by row, and then sends the results to the screen.-i option: Direct Action source file, source file will be modified. sed commands and options:
A\
Add one or more rows after the current line
/** * java calling DOS command for Windows */public class RunDocInJava{ Public static void main (String[] args) { inputstream ins = null; string[] cmd = new String[] { "cmd.exe", "/C", "ipconfig" }; // Command line
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.