The previous article is a simple script that can be executed and written to the log, but if it is too coarse to put into production, further optimizations are needed:#! /bin/bashif [-D "/OPT/BMC"]; Then if [-F "/opt/bmc/usysfault.log"], then
One.Common Commands1.View FilesTail-f file name to see what's at the back Cat file name View all the contents of a file2.Edit File ContentsVim file name enters edit modeI for editingESC Exit Edit: Wq Save Exit: q! do not save exitShift+g (g)
The OS module that is first considered when we need to invoke the command of the system. Use Os.system () and Os.popen () to operate. However, these two commands are too simple to complete a complex operation, such as providing input to the executed
(1) Os.systemThe method is to call the system () function of standard C directly, and run the command only at a sub-terminal and not get the return information after the command executes.Import OSOs.system (' Cat/proc/cupinfo ')(2) Os.popenThis
1> to display disk usage for a directory tree and every subtreeDu/home/linuxThis shows the number of disk blocks in the/home/linux directory and each of its subdirectories. 2> to display the disk usage of a tree and each of its subtrees in 1024-byte
Currently there is a scenario where client A to Server B goes to get an HTTP request, in between a firewall, the firewall to monitor the GET request, if the discovery will be truncated.Here are 2 requirements:1, client A If the packet caught, found
Yi, Os.system (commandstring)import osstatusCode=os.system("powershell sleep 3 ;echo 天下大势为我所控")print("over",statusCode)
PowerShell is used here to execute the sleep command, and there is no sleep command in CMD.
It is found that
When you are maintaining Oracle, you can use some Unix operating system commands to view system-related information under various operating systems.
Memory
-------
Aix:bootinfo-r
LSATTR-E-LMEM0
/USR/SBIN/LSATTR-E-L sys0-a Realmem
Or use a tool
[Badblocks]Badblocks disk Bad Check tool, can actually use mke2fs-c to replace this command-S shows progress on the screen-V can see the text message progress on the screen-W is tested in write mode. (This parameter is not recommended when you see
01.LINUX directory Structure "/" and "/dev" main role?What are the common file systems in 02.Linux?What is the cue for the graphical pseudo-character terminal in 03.Linux?04. What is the command to view the host name?05. What is the command to view
The OS module that is first considered when we need to invoke the command of the system. Use Os.system () and Os.popen () to operate. But these two commands are too simple. Unable to complete some complex operations, such as providing input to the
The OS module contains common operating system features.Note: The function parameter path is a file or directory, filename is the path to the file, DirName is the path to the directory, the path can be a relative path, or an absolute pathCommon or
Java uses Apache commons codec for MD5 encryption, BASE64 encryption and decryption, and executes system commands, commonsbase64
Before writing the code, let's first introduce the two packages we will use;
Commons-codec-1.10.jarTool packages used to
How to Let PHP execute system commands with root permissions is an example of my successful test in the testing environment SLES11SP1.
// Change the system time
Function rootCmd ($ cmd_body)
{
$ Pai_head = "su -- login root --
Brief description:
Foxmail7 exists in a local cross-site environment. Attackers can steal arbitrary files and execute arbitrary system commands.
Detailed description:
Send the original email with cross-site statements. You can execute javascript
Viewing computer information WMIC CSPRODUCT list fullviewing System Information 1 SYSTEMINFO32viewing System Information 2 Msinfo32View System version WinverComputer Management Compmgmt.mscDevice Manager devmgmt.mscDisk Management Diskmgmt.mscNative
This is an example of my successful experiment, the test environment SLES11SP1.
php
Change the system time
function Rootcmd ($cmd _body)
{
$cmd _head = "su--login root--command";
$cmd _body = "Date-s 07/13/2005";
This is often the case in Oracle 8i, that is, Oracle runs operating system commands during storage, generally, Oracle Enterprise Manager can be used to set jobs. however, due to the lack of flexibility in the setup of OEM jobs, the set job
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.