shows rows that match both PATTERN1 and pattern2Find-name april* Find files starting with April in the current directoryFind-name april* Fprint file finds files starting with April in the current directory and outputs the resultsFind-name ap*-o-name may* Find files that start with an AP or MayFind/mnt-name tom.txt-ftype vfat to find files with the name Tom.txt and file system type VFAT under/MNTFind/mnt-name T.txt! -ftype VFAT under/mnt to find files
prefixed with file or subdirectory # Find-name file\*2) Find the file and output the results to the Filelist.txt file #find- Name file\*-fprint filelist.txt3) lists files in the directory that have changed within the last two days # Find/home-mtime 24) Looking for files or directories in the Dir directory that are prefixed with file. Search for up to 1 levels of subdirectories # Find dir/-name file\*-maxdepth 24, File command to identify the type of
的字符串用b连接起来list, meta-ancestor operationsdefinition List names = [' Sun Lizhao ', ' slz ', ' Sunlizaho ']Subscript starting from 0 names[0],names[1],names[2] Rewind from-1 start names[-1],names[-2],names[-3] Slice: Take multiple elementsStep Sizeis 2 names[:: 2] If you want totake the last element, cannot write-1names[0:]Append: Fromlast addedNames.Append(' I'm new here ') insert: ThroughIndex InsertNames.Insert(0, ' I am the first ') Modified: byIndex ModificationNames[0] = ' I am the first '
(stdout, "content-type:text/plain\n\n");//output a CGI title, the meaning of this line of code will explain char * Pszmethod; Pszmethod =getenv ("Request_method"); if (strcmp (Pszmethod, "get") = = 0) {//get method//Read environment variable to fetch data printf ("This is getmethod!\n"); printf ("server_name:%s\n", Getenv ("SERVER_NAME")); printf ("remote_addr:%s\n", getenv ("REMOTE_ADDR")); fprintf (stdout, "input data is:%s\n", getenv ("query_string")); else {//POST method//stdin to fetch the
schematic diagram of a function, west meter corresponding to the B function, each word is doing operation, space brother not "doing" before, the West Rice need to wait. Finally, you come to me, until the end of the release, the dialogue is over. Because the code is too long, I give a compact version of the dialog that simulates the above:
#coding: Utf-8#----Condition#----Game of Hide-and-seekImport threading, TimeClass Hider (threading. Thread):def __init__ (self, cond, name):Super (Hider, sel
array Compare, Buffer
More about FMT
The FMT package contains some familiar names:
Copy Code code as follows:
printf– Print to standard output
sprintf– returns a string
fprintf– writes to the OS. STDERR, etc.
And also
Copy Code code as follows:
Print, Sprint, fprint– unformatted no format
Println, Sprintln, fprintln– unformatted, but add in the middle of the space, the end of the join \ n
Fmt.
details and properties of the found file, if we take the present find file, in using the LS command to view the file information is quite cumbersome, now we can also combine these two commands to use.Find/-name "httpd.conf"-lsThe httpd.conf file information is displayed on the screen immediately after the system finds the httpd.conf file.12063 34-rw-r--r--1 root root 33545 Dec 15:36/etc/httpd/conf/httpd.confThe following table is a list of commonly used find files and displays the parameters an
After finding the httpd. conf file, the system displays the httpd. conf file on the screen.
12063 34-rw-r -- 1 root 33545 Dec 30/etc/httpd/conf/httpd. conf
The following table lists common parameters and usage methods for searching and displaying file information.
Option usage description
-Exec command: Find and execute the command
-Fprint file: print the complete file name.
-Fprint0 file: print the complete file name, including an empty file.
-Fp
# search for the files modified in the last 5 minutes in the systemFind/-mtime-1 # search for files modified in the last 24 hours in the systemFind/-nouser # search for files belonging to the void user in the systemFind/-user Fred # search for files belonging to the user Fred IN THE SYSTEM
Find.-maxdepth 2-name Fred-The purpose of the maxdepth option is to restrict the "find" command to search for files in a directory in descending mode, or to search for directories that exceed a certain level.
. You may be able to use them at any time. Let's take a look at the following.
/********************************* Description: measure the length of a linked list * parameter: Head: linked list head pointer * return value: chain table length *******************************/INT flength (node * Head) {int COUNT = 1; node * P; P = head; while (p-> next! = NULL) {++ count; P = p-> next;} return count ;} /********************************* description: print the linked list * parameter: Head: linked
Step 1 to read the utmp file.
Exercise 2:
1. fread and fwrite: Use fopen, fread, and fclose to implement the who command.
2. fseek: Use fseek to locate the last and fourth user information of the utmp file and start reading.
5. fsetpos and fgetpos. Use fsetpos to implement the functions in step 2.
3. sprintf atoi: Use sprint atoi to convert data types (integer to string, character to integer), display or use GDB debugging to observe data.
4. fprintf and fscanf: Use
three common functions: separating the path to find the file name. Find the drive letter (Windows system) and find out the file extension.
The code is as follows:
Import Os.pathSpath= "D:/download/flight/flighthtml.txt"# case 1:P,f=os.path.split (spath);Print "DIR is:" +pPrint "File is:" +f# case 2:Drv,left=os.path.splitdrive (spath);Print "Driver is:" +drvPrint "Left is:" +left# Case 3:F,ext=os.path.splitext (spath);Print "F is:" +fPrint "ext is:"
.! -Type D-print: Print non-directory filesFind/usr/include-name '*. H'-exec grep af_inef6 {}/;Because grep cannot Recursively search for subdirectories, it can be used with find. Find the af_inef6 string in the. h file in all/usr/include subdirectories.
$ Find.-type L-print$ Find.-size + 000000c-print # Query files with a length greater than 1 MB$ Find.-size 100c-print # Query files with a length of C$ Find.-size + 10-print # Query 10 files whose length exceeds the expiration date (1 file = 51
maximum detail.Show more information. Use-ee to display the most information.-O, -- timersInclude information related to networking timers.Display network timer-related information-P, -- programShow the PID and name of the program to which each socket belongs.Display the PID and program name of the Connection-L, -- listeningShow only listening sockets. (These are omitted by default .)Only display the listening socket (port). This option is ignored by default.-A, -- allShow both listening and no
-print.-Another variant of "-printf" is "-printf", which is similar to the printf function in C language. It is not studied for the time being. There are too many formats.
-Ls: similar to the-dils Option combination of the ls command, as follows:
M @ meng :~ /Patches/tmp $ find-daystart-atime 0-ls 7478778 4 drwxrwxr-x 3 m 4096 July 12 00:10. 7478967 0-rw-r -- 1 m 0 July 12 00:10. /new m @ meng :~ /Patches/tmp $ ls-dils new 7478967 0-rw-r -- 1 m 0 July 12 00:10 new
For a more detailed output.
The
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.