| Category | Pickups |
|
|||
| Created | 2013-12-18 | ||||
| Owner | qinyinenxmu | ||||
| Title | Belstaff Italia or change the status of the file | ||||
| Description | find command in linux is very common to find a command, it functions very powerful. Can be combined with regular matches to search for specific content in the system, the following I will look at this record to find some common usage find syntax: find path-option [-print] [-exec-ok command] {} \\; ------------------------------------------------- ------- find examples look in / usr / linux all the *. h, and look for the "SYSCALL_VECTOR" in these documents, and finally print out all contain "SYSCALL_VECTOR" file name, there are several methods to achieve 1) find / usr / linux-name "*. h" xargs-n50 grep SYSCALL_VECTOR . 2) grep SYSCALL_VECTOR / usr / linux / * h cut-d ':'-f1 uniq> filename 3) find / usr / linux-name ". * h"-exec grep "SYSCALL_VECTOR" {} \\;-print find /-name filename rm-rf, unsuccessful, ask why unsuccessful? find /-name filename-exec rm-rf {} \\; find.-name filename rm-rf {} means you try to find out the results. \\; then the equivalent of "constitution" Nothing says head is so specified, in-exec behind the need for a symbol indicating the end of the command. The answer can be found in the man find. let rm find the results of the identification, as follows: find /-name filename xargs rm-rf reason find.-name filename rm-rf does not pass, because the rm command does not accept input from standard pass over the command find files containing specific strings example: Find the current contain "the string you want find ..." string file directory: .-type $ find f-exec grep "the string you want find ..." {};-print from the root directory to check tmpfile, once found immediately removed find /-name "tmpfile"-exec rm {} \\; find a perm problem ask the following command mean? The key is that number before - find-name ". *"-perm -007 I know find-name ". *"-perm 755 the permission bits are used to find hidden files 755 Oh, yes, well, I'm on top of the command are omitted find the pathname parameter find the default is the current working directory to find it? -ok if I substitute-exec, you will also need to add {} \\; do? this has been clearly still needed because just-exec-ok prompt mode, it is just one more step to confirm the operation -007 means to find all users (other) can read, write and execute files find-name ". *"-perm -007 and find-name ". *"-perm 777 there a difference? -007 means that users can find all read, write, and execute files -007 is to find with other users (different groups, a non-owner) read, write, and execute the file, not necessarily to the same group can read and write, - is the minimum permissions to 007. find.-perm -100 lists the current directory, which is why? This method does not accurately identify the directory. -100 is the owner of at least a permission to run. under unix system, you can have the right to execute the file to the directory you can enter a directory, which is why the file is listed in the directory. find.-perm -001-print catalog files are often found. I mean certainly not come to the directory using this method, but do not understand the significance of the -100 that analogy, is not -010 is the owner of at least the same group permission to perform it? That fact, here's 010 and - are separate - represents a least mean, but 010 is really used to describe the permission bits? this child will understand thank you oh will find out what put it somewhere else? . find * c-exec cp '{}' / tmp ';' If there is a special file, you can use cpio, you can also use this syntax: find dir-name filename-print cpio-pdv newdir locate files within a size range of disk, for example, to find the disk files greater than 3M: find.-size +3000 k-exec ls-ld {}; How to find a day to find a file changes? A = `find ~-print` ls-l-full-time $ A 2> / dev / null grep "Jun 27" grep 1998 use the find command to find the shell how to write a certain period of time, such as 11:00 to 12:00 1) Create a script judgetime, reads as follows: ls-l $ * awk '{split ($ 8, hour, ":"); if ((hour [1]> 23 hour [1] <1) \x26amp;\x26amp; hour [1] <24) print}' 2) down to the directory you want to find, run . find /-name "*"-exec judgetime {} \\; Note that the time format is 24-hour clock. if I want it accurate to the minute touch-t 04241112 starttemp # accurate to 12 minutes touch-t 04241220 endtemp # As of 12:20 find [dir]-newer starttemp-a endtemp-exec ls-l {} \\-newer!; newer? Yesterday 12:10 that file do? When performed every day, replaced with today's date and time stamp what is not on the list? I do not know if he is not to have to find all the 11:00 - 12:00 out, is not only performed once or perform daily? this case I guess things on their own which is forgotten, just remember that was late in the night. makes sense! indeed the owner! not only know how to solve problems, such problems also know under what circumstances, admire admire! problem has emerged. When this file is created. Should have now is the time to write a column on a 2002 instead of 12:00. until 12:00 over the bar! delete the file specified date find /-name filename-exec rm-f {} \\.; Example: Delete not used within 30 days of the current document, use the following command: find /-atime +30-exec rm-f {} \\; I tried to write a short SHELL, also used ll, grep, rm several commands, using them still unsatisfactory. on the list of filenames filtered out using a FOR statement, and then execute rm. Now I want Belstaff Leather Jacket to look at it this SHELL extended run time every day n days before Chaquetas Belstaff the file deleted, there is no one to give me some tips, thank you! there is a problem, for the front of the friend mentioned "find /-atime +30-exec rm-f {} \\; "method, I have long tried several times, but it seemed not quite right, is to find the parameter-atime n n days before being accessed files, I do not understand what the time reference point here is, and this n days is how computing. Question 2, for "ll cut-f 1" This command I was not wrong, I just want to remove ll listed in the file name, but with cut-f command can not, I had to switch to ll cut - c 59 - in this way to get the file name I want, but it's a pool idear! I also tried to use awk, seems not right, see if you can you give me some little reminder, TKS SO MUCH Question 3, how to change the date format I format my node system now shows: -rw-r - 1 msahz01 users 2253 2002 Äê 2 ÔÂ 2 ÈÕ poheader.i I want it replaced -rw-rw-rw-1 house users 2193 Apr 19 2001 hkdisp.p how to do this? awk should be ll awk '{print $ 9}' how many days before deleting files find / yourpath-mtime +31-exec rm {} \\; find / yourpath-mtime +366-exec rm {} \\; find the,-ctime What's the difference,-mtime and-atime Will-ctime and-mtime What is the relationship? ctime change if the parent directory, then it ctime following documents will automatically have changed? -ctime and-mtime,-atime information is present here? I-mtime -1 to find new or changed files. But how can we find a day to file mv it (their time is the original time earlier than one day)? use-newer option ah. you can touch the one you want first time the file is as follows: $ touch-t 08190800 test $ ls-l test -rw-r-r-1 dba other 0 Aug 19 08:00 test then $ find.-newer test-print . . / .sh_history $ ls-l. sh_history -rw --- 1 dba other 154 Aug 20 17:39. sh_history can write documents using touch any time you want, and then use the-newer,!-newer option to succeed. 1.ctime with inode information modification time. mtime refers only to the contents of the file created or modified. 2 will not. 3. This information should be present in the file system superblock. I checked the book-ctime is the inode of change (or change the status of the file). ask what information inode saved? do some small tests,-mtime changed,-ctime must also be changed. change the file name,-ctime will change. Who can answer i-node saved what things? vi / usr / include / sys / inode.h troupe, I can not access / usr / include / sys / inode.h. Abstract book as follows: Directories contain directory entries. Each entry contains a file or subdirectory name and an index node reference number (i-node number). To increase speed and enhance use of disk space, the data in a file is stored at various locations in the computer's memory. The i-node contains the addresses used to locate all the scattered blocks of data associated with a file. The i-node also records other information about the file including time of modification and access, access modes, number of links, file owner , and file type. can I find-atime changed,-ctime not changed. why? (my first cat an ASCII file, and then-atime -1 has its use-ctime -1 actually did it.) the information would not change with the inode, ctime on a whim contradiction? I do not agree with that part of the article you posted, as I mentioned, atime, ctime, mtime is placed inside the superblock in sco unix structure called a stat. (stat_32), different systems file system may be different. sco under the inode structure is as follows: typedef struct inode {struct inode * i_forw; / * inode hash chain * / struct inode * i_back; / *'' * / struct inode * av_forw; / * freelist chain * / struct inode * av_back; / *'' * / int * i_fsptr; / * "typeless" pointer to fs dependent * / ino32_t i_number; / * i number, 1-to-1 with dev address * / ushort i_ftype; / * file type = IFDIR, IFREG, etc * / short. i_fstyp; / * File system type * / off_t i_size; / * size of file * / ushort i_uid; / * owner * / ushort i_gid; / * group of owner * / ushort i_flag; ushort i_want; / * i_flag extension to avoid MP races * / ushort i_count; / * reference count * / short i_nlink; / * directory entries * / dev_t i_rdev; / * Raw device number * / # define i_namtype i_rdev / * i_ftype == IFNAM subtype * / dev_t i_dev; / * device where inode resides * / struct mount * i_mton ;/ * ptr to mount table entry that * / / * this directory is mounted on * / struct region * i_rp; / * ptr to shared region if any * / struct stdata * i_sp; / * ptr to associated stream * / struct iisem * isem; / * ptr to XENIX semaphores * / struct iisd * isd; / * ptr to XENIX shared data * /} i_un; # define i_mnton i_un.i_mton / * i_ftype == IFDIR IMOUNT * / # define i_rptr i_un.i_rp / * i_ftype == IFREG i_ftype == IFBLK * / # define i_sptr i_un.i_sp / * i_ftype == IFCHR i_ftype == IFIFO * / # define i_sem i_un.isem / * i_ftype == IFNAM \x26amp;\x26amp; i_namtype == IFSEM * / # define i_sd i_un.isd / * i_ftype == IFNAM \x26amp;\x26amp; i_namtype == IFSHD * / struct fstypsw * i_fstypp; / * ptr to file system switch FSPTR * / long * i_filocks; / Belstaff Trialmaster * pointer to filock (structure) list * / unsigned long i_mappages; / * number of pages currently cached * / unsigned long i_vcode; / * read-ahead block save (NFS) * / short i_wcnt; / * write open count or ITEXT count * / struct lockb i_cilock; / * tas to synchronize i_flag changes * / ushort i_rdlocks; / * count of non-exclusive lockers * /} inode_t; So, to access a file can not be changed inode information. use chown, chgrp, chmod command can be a good comparison mtime and ctime chown to change the owner of a file can be found by ctime, mtime will not find with. try. Thank Bamboo! I was on Solaris interview. I was right-ctime not understand. test results are as follows: modify the file,-mtime changed,-ctime will change. access files,-atime changed,-ctime unchanged. chown, chgrp, chmod, mv,-ctime will make changes, but does not affect the-atime and-mtime. touch can change-mtime and / or-atime, but the touch-a change only when the access time,-ctime also changed. touch-m time to change the modification time,-ctime certainly changed. as if there are other things that can make a lot of change-ctime, confused. there any way to display-mtime, atime, ctime it? -ctime can be used to achieve the incremental backup file directory or transfer it? Thank you! no tools show (probably I do not know) the following procedures in the st_mtime replaced st_ctime, or st_atime can get what you want it. # includeintmain (int argc, char ** argv) {struct stat buf; char date [80]; char fname [80]; printf ("Enter filename (with full path) to check mtime:"); scanf ("% s ", fname); stat (fname, \x26amp; buf); printf (" mtime (in sec) of% s =% ld \\ n ", fname, buf.st_mtime); strcpy (date, ctime ((time_t *) \x26amp; ( buf.st_mtime))); printf ("mtime (in date) of% s =% s \\ n", fname, date);} As for file backup, what can not it? mtime ls-l last modified time of the file contents Time atime ls-lu recently accessed files ctime ls-li recent change in state documents, such as file modifications, attributes \\ is the main change, node, link changes, it should be no feelings just before and after the change of time Ankan help ls, and that just sort by ctime or atime, time display or mtime. carefully compare a moment, ayhan said is right. thank ayhan. Thank ahyan prompted me on Solaris tried the following!: mtime see with the ls-l atime see with ls-lu ctime see with the ls-lc. (ls-li only inode number) Abstract book as follows: -c Uses time of last modification of the i-node (file created, mode changed, and so forth) for sorting (-t) or printing (-l or-n). -u Uses time of last access instead of last modification for sorting (with the-t option) or printing (with the -l option). -i For each file, prints the i-node number in the first column of the report. reference recommend: (recommended) | ||||
| Consumption | |||||
| Broken | Yes | ||||
| Price | $ 50,000.00 | ||||
| Promotion level | None | ||||
|
|
|||||
Please register or log in.
