moodLearning Wiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
linux-commandline-tips [2019/10/10 08:35]
serbizadmin [Log Analysis]
linux-commandline-tips [2020/08/29 23:47] (current)
serbizadmin [Find Stuff]
Line 15: Line 15:
 find . -type f -printf '%T@ %P\n' | sort -n | awk '{print $2}' find . -type f -printf '%T@ %P\n' | sort -n | awk '{print $2}'
 </code> </code>
 +  * show files greater than 1G
 +<code>
 +du -h * | grep '^\s*[0-9\.]\+G'
 +</code>
 +Change 'G' to 'M' for MB output.
 ====== Differences====== ====== Differences======
   * between files, showing side by side   * between files, showing side by side
Line 44: Line 49:
 shopt -s extglob</code> shopt -s extglob</code>
 \\ \\
 +====== Compression======
 +  * lossless, multi-thread compression: keeping sourcing file, progress, high efficiency, extrem flag 
 +<code>
 +time xz -6ve -k --threads=0 <filename>
 +</code>
 +  * compress multiple files
 +<code>
 +xz file1.txt file2.txt file3.txt
 +</code>
 +  * decompress
 +<code>
 +xz -d file.txt.xz
 +unxz file.txt.xz
 +</code>
 +  * test integrity 
 +<code>
 +xz -tv <filename>.tar.xz
 +</code>
 +  * concatenate multiple files
 +<code>
 +xzip -c file1.txt > files.xz
 +xzip -c file2.txt >> files.xz
 +</code>
 +  * concatenate, less, more, grep multiple files
 +<code>
 +xzcat test.txt.xz
 + test
 + example
 + text
 +xzgrep exa test.txt.xz
 + example
 +</code>
 +
 ====== PHP====== ====== PHP======
   * View php config   * View php config
Line 54: Line 92:
 </code> </code>
 \\ \\
 +  * reinstall all php packages
 +<code>
 +apt-get install --reinstall `dpkg -l | grep 'ii  php7' | awk '{ printf($2" "); next}'`
 +</code>
 ====== Log Analysis====== ====== Log Analysis======
 * limiting by date range * limiting by date range
  
 sed -n '/8\/Oct\/2019/,/8\/Oct\/2019/ p' access.log sed -n '/8\/Oct\/2019/,/8\/Oct\/2019/ p' access.log