Posts

Showing posts with the label linux

Disable WSL shell beeps in Windows

Set bell-style none in ~/.inputrc to silence all shell beeps. This stops the annoying tones if you attempt to tab-complete under WSL(2) in Windows 10

Docker information

docker inspect - f \ '{{range $index, $value := .Config.Env}}{{$value}} {{end}}' container_name

Get network transfer information from linux

Whilst attempting to find some information for a project necessary on calculating (guesstimating) a budget for bandwidth used by a machine in the cloud I had to know where we were with current usage. Unfortunately the cloud services this VM sits in don't have any method exposed to show my usage and as such I turned to AskJeeves to find out some linux tools to help me out. First off the rank is  vnStat  which seems to be part of most of my Ubuntu boxes after looking at a few of them. Actually, that's the only necessary tool I used to get my data. By invoking vnstat with no parameters I got a nice printout of: ~$ vnstat Database updated: Mon Sep  4 00:17:31 2017    ens3 since 05/22/2017           rx:  1.25 TiB      tx:  21.85 TiB      total:  23.10 TiB    monthly                      rx      |  ...

Check for duplicates in text file

cat normalFile.txt | uniq -c

Restart Apache 2

Command to restart apache2 on my development server. /etc/init.d/apache2 restart

Show large files - Linux

Specify the directory to list large files in du -h | grep '[0-9]G' and it will output size in GB and the path. Like so: 77G /var/lib/mysql 77G /var/lib 68G /var/log/mysql 69G /var/log 146G /var