Monthly Archives: September 2014

less command in linux with examples

How to

less is part of the GNU project and is free software. It is a program similar to more, but which allows backward movement in the file as well as forward movement. Also, less does not have to read the entire input file before starting, so with large input files it starts up faster than text editors like vi. Less uses termcap (or terminfo on some systems), so it can run on a variety of terminals.

Continue reading

Sync directories between two servers using rsync

How to

Rsync is free file copying tool. It can copy locally, to/from another host over any remote shell, or to/from a remote rsync daemon. Rsync finds files that need to be transferred using a quick check that have changed in size or in last-modified time. Any changes in the other preserved attributes (as requested by options) are made on the destination file directly when the quick check indicates that the file’s data does not need to be updated.

Continue reading

Shell script with options

scripting

For more professional like scripting is nice to use options, where we can do different work with one script just using it. In this article I will show you, how to write script, where we can switch what to do using options -h for help, or -e for echoing “hello world”. Of course, this is just example and we can use it for more complex work than just hello world :).

Continue reading