The most recent project needs to execute shell commands in Java, in the most common way, with the following code:
public class Shellutil {public
static string Runshell (String shstr) throws Exception {
process process;
Process =
Attached below by
ShellThe way the command line does not interactively manipulate the database:
mysql-hhostname-pport-uusername-ppassword-eMySQL-related SQL statements, do not run MySQL in the MySQL prompt, that is, you can operate MySQL in
The meaning of the-Z to-D in the conditional judgment in the shell
[-A file] if FILE existence is true.
[-B-file] True if file exists and is a block-specific file.
[-C file] is true if file exists and is a word special file.
[-D file] is true if
1.shell-sortHill sort (Shell sort) is a sort of insertion. is for the improvement of the direct insertion sort algorithm. The method is also called narrowing the incremental order, due to DL. The shell was named after it was introduced in 1959.
We
Optimized content includes kernel (commented out at the end of the article, see Personal needs) SSH time sync yum source#!/bin/bash#update Time 20180824#version 1.1.0Echo-e "\033[31m------------------------------Author name is Hefangyaonie-----------
1. Linux Scripting Basics1.1 Basic Introduction to grammar1.1.1 OpeningThe program must start with the following line (must be in the first line of the file):#!/bin/shThe symbol #! is used to tell the system that the parameter behind it is the
Shell and Export commandsAfter the user logs on to the Linux system, a user shell is launched. In this shell, you can use the shell commandor declare a variable, you can also create and run a shell script program. When you run a shell script, the
What is a shell?ShellIs the user interface of the system, which provides an interface between the user and the kernel for interactive operation. At the same time, the shell is a command interpreter that interprets the commands entered by the user
测试操作符
Common Test Operators
English name
Description
-F file
file
files exist and are normal files True, that is, test expressions are set
-d file
Direct Ory
Sort command, The parameter-u removes the duplicate rows in the result,-T, changes the delimiter,-N sorts by number size, and-K specifies the sorting field. eg: Sort-T:-k3n gargo. DB # sort by number in the Third Region
Sort-T:-k3nr gargo. DB #
This is a personal incremental version. Its functions are as follows:1. You can set password protection for the first access.2. You can perform n incremental backups and incremental restores.3. You can delete incremental time points.
If you want to
Reprinted: http://blog.csdn.net/zuolongsnail/article/details/8167501
Run ADB shell AM broadcast on the command line to send broadcast notifications.
Parameters following ADB shell AM broadcast include:
[-A ][-D ][-T ][-C [-C ]...][-E | -- es ...
2. In some software installation processes, you need to create an independent user and then run some installation operations such as gitolite installation, create a git user and execute the installation.
Method 1:sudo -u user ...
Sudo-u Git-H
The memory of the android program is divided into two parts: Native and Dalvik. Dalvik is the Java heap we usually call. The objects we create are allocated here, bitmap is directly allocated on native. The memory limit is that native + Dalvik
From: http://www.jb51.net/article/34323.htm
Note: The subscript of the array in Shell starts from 0 by default.
1. Place the string in an array to obtain its length.
Copy the Code as follows:#! /Bin/bashSTR = "a B -- n d"Array = ($ Str)Length =$ {#
Chapter 2 shell Basics
1. Which two files are used during shell initialization?
/Etc/profile, which contains the shell initialization information required by all users in the system
. Profile, whether it is in the user's starting directory. The
From: http://hi.baidu.com/rytech/blog/item/0ddd1428cce175f899250abb.html
How can a complicated Linux Command be made up? The following describes several tips. Redirect using input/outputIn Linux Command Line mode, if the output required by the
Unix shell programming (5)
The filter TR is used to convert characters from standard input. Format:Tr from-chars to-charsFrom-chars and to-chars are one or more characters. For example:[Root @ localhost programs] # Cat introThe UNIX operating
Cause: There is no sqlite3 file in the/system/xbin folder on the mobile phone.
Solution: Generally there are some in the simulator, so the task is to drag sqlite3 from the simulator to the mobile phone device.
1. Mount the mobile phone first to make/
1 shell script must have the read and executable (RX) permissions.
2. Differences in script execution methods:
1) Sh script_name or./script_name: execute in the sub-process (a new bash environment)
2) Source script_name: executed in the parent
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