Linux Administration
2.52K subscribers
4 files
125 links
Download Telegram
Hi everybody,
You may put your questions/doubt here and those who knows ans, they can explain.
Print an access_log with indicator chart bars under each request line to show the size of the data transfer using log() to keep things "in control".



# awk -v cols=$(tput cols) '{e=int(log($10)*5); print("\x1b[42m" substr($0, 1, e) "\x1b[0m" substr($0, e+1) )}' access_log | less -SR
# tesseract book-text1.jpg



- # You can use the tesseract OCR software to attempt to read text from an image and print it on stdout.
# watch grep [M]Hz /proc/cpuinfo; free; ifconfig <any other command you wanna monitor>
# stat -c "%F"$'\t'"%15s"$'\t'"%n" -- * | awk -F"[\t\.]+" '/^regular file.*\..{1,5}$/{t[$NF]+=$2;x[$NF]++} END {for (s in t){printf("%-5s %4i %12i\n",s,x[s],t[s])}}' | sort -k3n



Command to See what type of files are taking up so much space. output columns = type count
If you want to clean empty directories, find command can make the job easy:

$ find / -type d -empty -exec rmdir {} +

The -type d option searches for directories, -empty select empty ones and -exec rmdir {} executes the rmdir command to delete them. The rmdir command ensures that the directory is empty before deleting it.



Alternatively, you can also use below command to complete the same task:

$ find / -type d -empty -delete
Two files in different formats (eg. TSV vs. CSV) and need to find out if file1 had lines that were not in file2.


join -v1 --header -t, -1 2 -2 1 <( sort -t, -k2 files1.csv | cut -d, -f1-5 ) <( sed 's/\t/,/g' files2.tsv | sort -t, -k1 )
Regex Tip


[a-z] matches all lower case letters. [-az] matches '-', 'a', or 'z'.