Firstly, it is tremendously useful. The grep is one of the powerful tools in unix. Gnu find as various command line option to list files by a modification and access date/time stamp. All the jpg's from 2004 and other years print to standard out. with CR characters stripped off. The second command above does not actually grep anything from 2010 at all. Secondly, the wealth of options can be overwhelming.Thirdly, it was written overnight to satisfy a particular need. The power of grep lies in using regular expressions mostly. shyam May 29, 2011, 10:45 pm. How would I list all .bash_history* lines that grep finds together with the Unix timestamp as string? Grep by example Introduction. The first two are bang on; the third is slightly off. Link. This switch causes grep to report byte offsets as if the file were Unix-style text file, i.e. One of the reasons to create this blog post is that there are a lot of examples available for the grep command. The general syntax of grep command is grep [options] pattern [files] 1. You should get a grip on the Linux grep command. As the name suggests history command is used to keep track of all commands that were executed on a Linux server. This can be used in grep to match the lines which end with the given string or pattern. Grep stands for "global search for regular expressions and print". 9. Linux - copy file and preserve timestamp, ownership, mode. Matching the lines that end with a string : The $ regular expression pattern specifies the end of a line. This will produce results identical to running grep on a Unix machine. If anyone can help me find all jpg files, list them to give the timestamp (ls -ltr), grep for 2010 from that timestamp and copy those files to a destination, I would really appreciate it. N 2011-07-27 12:50:56.402353 979608 N 2011-07-27 12:50:58.012015 979622 N 2011-07-27 12:50:58.012078 979623 My requirement is to find the entries matching timestamp from now to 30 minutes before. The Story Behind grep. thanks. my log file has entries as below. unix is free os. ... linux grep (6) sed newbie (6) xargs (6) awk printf (5) bc (5) linux redirection (5) linux tr (5) SSH (4) unix is opensource. Thanks, Shawn It allows you to specify an extended regular or hexadecimal expression to match against data payloads (the actual information or message in transmitted data, but not auto-generated metadata) of packets. Please let me know How shall I grep the file to get all the lines on the date “Fri Nov 26 2010 ” . Say hello to -newerXY option for find command. Linux find file by date using the date command. This option has no effect unless -b option is also used; it has no effect on platforms other than MS-DOS and MS-Windows. By default, history command stores last one thousand commands in their output. The grep command is famous in Linux and Unix circles for three reasons. History is one the most useful command line tool for all Linux and Unix geeks. But with all information scattered, most people don’t take the time to really learn the most basic commands. If you want to copy files in Linux and also want to keep or preserve the original mode or timestamp or ownership (or all) , cp command gives an option (--preserve). Ngrep (network grep) is a simple yet powerful network packet analyzer.It is a grep-like tool applied to the network layer – it matches traffic passing over a network interface. $ grep "^unix" geekfile.txt Output: unix is great os. The syntax is as follows: find /dir/ -type f -newerXY 'yyyy-mm-dd' find /dir/ -type f … The file is having 5 years of date with the timestamp as specified above. Hi , I am trying to grep log file to get entries matching a timestamp greater than current time -30 mins.