| The
single right angle bracket will overwrite a file if it is used to
redirect output. To avoid this you can use the double right-angle
bracket (>>)
to append the output of a command to an existing file.
Examples
$
cal 9 1999 > sept.oct
$
cat sept.oct
Sept
1999
| S |
M |
Tu |
W |
Th |
F |
S |
|
|
|
1 |
2 |
3 |
4 |
| 5 |
6 |
7 |
8 |
9 |
10 |
11 |
| 12 |
13 |
14 |
15 |
16 |
17 |
18 |
| 19 |
20 |
21 |
22 |
23 |
24 |
25 |
| 26 |
27 |
28 |
29 |
30 |
31 |
|
$
cal 10 1999>> sept.oct
$
cat sept.oct
Sept
1999
| S |
M |
Tu |
W |
Th |
F |
S |
|
|
|
1 |
2 |
3 |
4 |
| 5 |
6 |
7 |
8 |
9 |
10 |
11 |
| 12 |
13 |
14 |
15 |
16 |
17 |
18 |
| 19 |
20 |
21 |
22 |
23 |
24 |
25 |
| 26 |
27 |
28 |
29 |
30 |
31 |
|
Oct
1999
| S |
M |
Tu |
W |
Th |
F |
S |
|
|
|
|
|
|
1 |
| 2 |
3 |
4 |
5 |
6 |
7 |
8 |
| 9 |
10 |
11 |
12 |
13 |
14 |
15 |
| 16 |
17 |
18 |
19 |
20 |
21 |
22 |
| 23 |
24 |
25 |
26 |
27 |
28 |
29 |
| 30 |
|
|
|
|
|
|
$
|
|