Category Archives: Bash

Scripts, sources and howto’s

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

Copy large files between servers

If you have to copy large files between systems and security is not an issue you could use netcat. Netcat is a tool that has been developed in 1996 but it is still one of the best tools for this … Continue reading

Posted in Bash, Beginner | Leave a comment