Category Archives: Linux

All about the best OS you can find on this planet.

How to strip a certain number of Bytes from the end of a file in bash

To crop the last n Bytes from a file you can use the truncate command. [u_r_the_man@TESTBOX ~]$ truncate –size=-n <filename>Where n represents the number of Bytes to cut from the end of <filename>. The advantage is that the command will … Continue reading

Posted in Bash, Beginner, Linux | Leave a comment

Execute multible commands on a remote machine using SSH

To execute a number of commands on a remote machine you can create a file that contains the commands that you want to execute. This file can then be ‘cat’ed to your ssh command. I wrote one command file to … Continue reading

Posted in Bash, Beginner | Leave a comment

Send output of a bash script to the console and to a file

Sometimes it is necessary to send the output of a script to different targets. If you want to send the output to a text but want to be able to see it on the console as well you can use … Continue reading

Posted in Bash, Beginner | Leave a comment

LVM: Howto increase the size of a filesystem on-the-fly

Oops, that is not good /dev/mapper/database_vg-db_vol 690G 655G 12K 100% <the SHADOW database filesystem> This happened at 4am. What can you do in case that this happens to you? Praying is always a solution. The better solution is checking your … Continue reading

Posted in Apps, Beginner, Linux | Leave a comment