1. Use multiple commands
To run multiple commands together, you only need to input them to the same line, separated by semicolons.
Ex: data; WHO 2. Create a script file
(1) #! /Bin/bash is the first line
(2) # Add comments.
(3) Each line
Use shell commands to stop or run services --- Service
# Service xinetd stop // stop running the xinetd service
Stopping xinetd:
# Service xinetd start // start the xinetd service
Tip: sometimes when we use Linux for Internet access, we cannot
we know that variables are inherited by quilt processes, it can be used directly. In some cases, you may need to inherit functions to facilitate transparent use. The method is very simple. Use "Export-F". Pay attention to the parameter "-F", which
Reprinted: http://langzhe.iteye.com/blog/671762
Prerequisites: the Erl file must be compiled using the debug_info option. Otherwise, the invalid beam file or no abstract code will appear:Error
Compilation Method: Make: All ([debug_info]). |C
Beijing, March 16 (Xinhua)-the safety shell of nuclear reactors 1 and 3 at Fukushima 1st nuclear power plant may be damaged, Kyodo News reported, japan may need assistance from the US military.
Yoy Nakano said Japan may seek help from the US
1. write scripts. You can use shell and Perl. Find 100 files starting with ABC in the/tmp directory, and save the first line of these files to file new.2. write scripts and use shell and Perl. Put all the rows in file B but not in file,Save as file
The following are all from network collection. I sorted it out myself and only sorted out some things that I was not familiar with before, but will be used now:I. Definition of variables in makefile:1. recursive expansion: the variables defined by
Some shell combinations
CTRL + L: Clear the screen
CTRL + W: delete the word starting at cursorCTRL + u: Clear the line I. e. Delete the all words from Command LineTab: auto-complete files, directory, command names and much moreCTRL + R: search
Reprinted: http://www.360doc.com/content/10/0303/16/155970_17438894.shtml
Example 4-2. Simple variable assignment
1 #! /Bin/bash 2 # "naked" variable 3 4 Echo 5 6 # When is the variable "naked", such as when the front side is less than $? 7
-B file: if the file exists and is a special block file, it is true.-C file: if the file exists and is a special character file, it is true.-D file: if the file exists and is a directory, it is true.-E file: true if the file exists-F file: if the
#! /Bin/bash
Tc_home =/opt/Oracle/tomcat/
InstanceName = $1 [created instance]
CD...>/dev/null
Template_dir = 'pwd'
Echo $ template_dir
If [! -D $ tc_home]; then
Mkdir-p $ tc_home [Create if the directory does not exist]
Fi
Usemethod
Shell scripts are similar to the C language and also have a fixed language format. in short, shell scripts are like batch processing files (. BAT), the most basic function is to write a lot of commands together, so that users can easily execute a
Author:North SouthSponsorship:From:Linuxsir. orgAbstract:This document describes several tools used in user management, including ID, finger, groups, W, WHO, and users;
Directory Index
1. Principles of user query tools;
2. user and group query
At noon yesterday, after finishing learning ACL and mounting, I tried to write a small script. Suppose a group develops a project and needs to create a project group with three users and a shared folder, to prevent mutual modification or even
Awk origin: awk statements are a set of languages developed by three researchers at Bell Labs in 1970s. awk names are the names and letters of the three researchers. However, awk was initially not intended for users, but for individual users.
Common System Variables$0 name of the current program$ N the nth parameter of the current program, n = 1, 2 ,... 9$ * All parameters of the current program (excluding the program itself)$ # Number of parameters of the current program (excluding the
1. system environment variables after the user logs on to the system:$ Home user's own directory$ Path: the directory to be searched during Command Execution$ TZ Time Zone$ Mailcheck the number of seconds to check whether a new letter exists$ PS1
Http://blog.csdn.net/wike163/article/details/7289586
Android has an interesting command calledDumpsysTo dump some system information. Even described on ADB manual IThink that some points shocould be reinforced. In order to get the complete status
#! /Bin/shlang = zh_cnsendmsgfile =/home/LSC/fetion/install/cmd.txt send_sms_mobile_telephone () {log_time = 'cat ftpstat_time 'local_time = 'date + % s' n =n ($ {local_time}-$ {log_time })) if ["$ N"-GT "1800"]; then # is more than 30 minutes away
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