Say that you have multiple log files for Nginx, Apache or any other software that you would like to tail. You can do this easily with
tail like so:
tail -f /var/log/nginx/*.log
tail -f /var/log/apache2/*.log
You need to have a fairly recent version of
tail to use this. It works on Ubuntu 16.04 with
tail version 8.25.
sudo find /var/log/ -type f -regex '.*\.[0-9]+\.gz$' -delete
This will delete old, archived log files with the
You might also consider configuring logrotate to do this for you.
Simple way to clean up your repository if you have a lot of checked our branches.
git branch | grep -v "master" | xargs git branch -D
ls on a folder with many files or folders in it (>20 000) can take minutes or even hours. To speed up the process you can combine the unsorted output of
ls (which is fast) with the
sort command, like this:
ls -U | sort
du ./ -h --max-depth=1 | sort -h
Run this in the folder where you want the files dumped:
for I in $(mysql -uroot -p -e 'show databases' -s --skip-column-names); do mysqldump $I > "$I.sql"; done
VBoxHeadless --startvm "CentOS Dev"
VBoxManage controlvm "CentOS Dev" acpipowerbutton
For stopping machines properly, you need to isntall apcid on the guest machines.
To show the output from all log files in a directory, run:
tail -f *.log
==> log1 <==
126.96.36.199 - - [16/Nov/2014:03:31:06 +0000] "GET /robots.txt HTTP/1.1" 200 107
188.8.131.52 - - [16/Nov/2014:03:31:07 +0000] "GET / HTTP/1.1" 200 7777
184.108.40.206 - - [16/Nov/2014:03:36:05 +0000] "GET /robots.txt HTTP/1.1" 200 107
==> log2 <==
220.127.116.11 - - [16/Nov/2014:05:39:36 +0000] "GET / HTTP/1.1" 200 34569
18.104.22.168 - - [16/Nov/2014:05:40:44 +0000] "POST /wp-admin/ HTTP/1.0" 200 961
22.214.171.124 - - [16/Nov/2014:05:40:57 +0000] "POST /wp-admin/ HTTP/1.0" 200 50505