AuthorMessage
BlackSonar
n00b
Posts: 42

Simple backup script:
Code:
#!/bin/bash
tar -cZf /var/my-backup.tgz /home/me/

In this script, the user files in the library of a home we bind it together into an only bald file.
From the redirection:
There are three file descriptors: stdin, stdout and stderr (std=standard).
Fundamentally the successors can be covered:
1. stdout into a file his management
2. stderr into a file his management
3. stdout into stderr his management
4. stderr into stdout his management
5. stderr and stdout into a file his management
6. stderr and stdout into stdout management
7. stderr and stdout into stderr management
Example: it stdout into a file his management:
Code:
ls -l > ls-l.txt

Example: it stderr into a file his management:
Code:
grep da * 2> grep-errors.txt

Example: it stdout into stderr his management:
Code:
grep da * 1>&2

Example: it stderr into stdout his management:
Code:
grep * 2>&1

Example: it stderr and stdout into a file his management:
Code:
rm -f $(find / -name core) &> /dev/null

EDIT: by Meka: Use code brackets for code.
BlackSonar
n00b
Posts: 42

I say thank you for it Meka, I admit it I was lazy, I am listening better another time.