1.test statement
The test instruction is used when I want to detect that some of the file rings on the system are related attributes.
(1) The file type judgment about a filename, such as TEST-E filename indicates existence
-e Does the file name
Shell principleIn the operating system, the bottom is the hardware, and the hardware is the kernel (kemel), the kernel is the library, the library is the application, in many applications, there is a shell application, commonly known as the shell,
1. Questions: in the afternoon, a classmate asked such a question: Tail-n +$ (tail-n1/root/tmp/n)-f/root/tmp/ip.txt 2>&1| awk ' argind==1{i=$0;next}{i++;if ($0~/file truncated/) {i=0};p rint "---" I;print i >> "/root/tmp/n"} '/root/tmp/n- Seq
①ls default display of files in the current directory
Displays the current directory in which to use the command PWD (printing working directory)
So LS and ls/root show the same effect.
②ls–l displaying full
Turn http://blog.csdn.net/imzoer/article/details/8678029The purpose of subprocess is to start a new process and communicate with it.Only one class is defined in the Subprocess module: Popen. You can use Popen to create processes and make complex
1 several common methods of executing system commands in Python2 one, using the OS module3 ImportOS41, Os.system5 6 ImportOS7Os.system ('Cat/proc/cupinfo')## Similar to the system command in Perl, cannot get command return result, only
inter-process communicationeach process has a different amount of user address space, the global variables of any process can not be seen in another process, so the process to exchange data must pass through the kernel, in the kernel to open a
IO has specific classifications: there are specific classifications:1: Different depending on the type of processing: byte stream and character stream.2: Varies by flow: input stream and output stream.============= (supplementary byte is
Haven't come to the garden to write an article, today I share an article about the process and threading theory related content, many people are using multi-threaded, multi-process or thread pool, process pool, but you do not know why to use, from
use Python to execute system command methods? Old boy IT trainingPython is a simple programming language, built-in rich libraries, can easily implement powerful features, in the use of Python framework, often need to use Python to execute system
SU's usage: Switch user
The usage # SU [l] User name [] can be abbreviated or not written.
Change Password
# passwd hit the return ligatures two times new password on the line, pay attention to the complexity of the degree of
Command command
This article mainly introduces some Linux shell in the relevant knowledge summary, so that the basics of Linux introductory learning, need friends can refer to the
Once a file is created, it has three ways to access it:
1) Read, you can display
Once a file is created, it has three ways to access it:1) Read, you can display the contents of the file.2) write, you can edit or delete it.3 Execute if the file is an S H e l l script or program.The permissions of a file can be grouped into three
Copy Code code as follows:
#!/bin/bash
Send_thread_num=13
Tmp_fifofile= "/tmp/$$.fifo" # script runs the current process ID number as filename
Mkfifo "$tmp _fifofile" # Create a new random FIFO pipeline file
exec 6<> "$tmp _fifofile" #
For the creation of nameless pipes:
#include
int Mkfifo (const char* pathname,mode_ mode);
If you are in a Linux environment, you can also use the MKFIFO directive to create the pipe file directly in the shell terminal.
FIFO Common uses:
(1) FIFO
The first OS module to consider when we need to call the system's commands. Operate with Os.system () and Os.popen (). However, these two commands are too simple to perform complex operations, such as providing input to a running command or reading
It programmer development must-all kinds of resources download list, the most complete IT resources in history, personal collection summary.
FindFind is a very effective tool that traverses the current directory and even the entire file system to
We know that the Linux find command can search for the specified file in the directory and do the appropriate action. The Find command provides a phase
When the powerful search conditions, the function is very powerful. So today we're going to
1. Use Os.system ("cmd")
The feature is the execution of the program will play CMD on Linux implementation of the information.
Import OS
Os.system ("LS")
2. Use Popen module to generate new process
Now most people like to use Popen. The Popen
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.