Check These Out
The output format is given by the -printf parameter:
%T@ = modify time in seconds since Jan. 1, 1970, 00:00 GMT, with fractional part. Mandatory, hidden in the end.
%TY-%Tm-%Td %TH:%TM:%.2TS = modify time as YYYY-MM-DD HH:MM:SS. Optional.
%p = file path
Refer to http://linux.die.net/man/1/find for more about -printf formatting.
------------------------
sort -nr = sort numerically and reverse (higher values - most recent timestamp - first)
head -n 5 = get only 5 first lines (change 5 to whatever you want)
cut -f2- -d" " = trim first field (timestamp, used only for sorting)
------------------------
Very useful for building scripts for detecting malicious files upload and malware injections.
This is assuming that you're editing some file that has not been wrapped at 80 columns, and you want it to be wrapped. While in Vim, enter ex mode, and set the textwidth to 80 columns:
$ :set textwidth=80
Then, press:
$ gg
to get to the top of the file, and:
$ gqG
to wrap every line from the top to the bottom of the file at 80 characters.
Of course, this will lose any indentation blocks you've setup if typing up some source code, or doing type setting. You can make modifications to this command as needed, as 'gq' is the formatting command you want, then you could send the formatting to a specific line in the file, rather than to the end of the file.
$ gq49G
Will apply the format from your current cursor location to the 49th row. And so on.
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"
The option -print0 for find and -0 for grep help prevent issue with weird characters or spaces in filenames. Furthermore with xargs there is no limited number of arguments that find can throw.
put "-linux" option into $HOME/.indent.pro to make it default
This regular expression removes all HTML-Tags from the file.
This uses awk to grab the IP address from each request and then sorts and summarises the top 10.
Friday is the 5th day of the week, monday is the 1st.
Output may be affected by locale.