Archive for the 'Shell scripting' Category

15 Practical Linux Find Command Examples

Apart from the basic operation of looking for files under a directory structure, you can also perform several practical operations using find command that will make your command line journey easy.In this article, let us review 15 practical examples of Linux find command that will be very useful to both newbies and experts.

How to keep files safe from accidental overwriting?

This happens many times. You accidentally use redirecting output using > operator.or example you type a command:
ls -l *.c > output.txt
If file output.txt exists and is a regular file it will be overwritten. Just imagine as root user, typing somecommand > /etc/passwd instead of somecommand < /etc/passwd. Or you used > when they meant [...]

“screen” simple yet powerful!

Screen is a full-screen window manager that multiplexes a physical terminal between several processes (typically interactive shells). Check out some of the example to use simple but powerful tools screen in your linux.

grep tips..!

grep is powerful tools in Linux. It searches the named input FILEs (or standard input if no files are named, or if a single hyphen-minus (-) is given as file name) for lines containing a match to the given PATTERN. By default, grep prints the matching lines. Here are some of [...]

Sending files as mail attachments

This article shows how to send e-mails from a shell script, including file attachments. It lists different ways (uuencode, MIME), and explains the advantages and disadvantages of each. The appendix contains a shell script “sendfile” that simplifies sending MIME file attachments using scripts.