- 论坛徽章:
- 0
|
怎么做?
Assuming file food.txt exists and you have all sorts of permissions, upon execution of command head -6 < food.txt >> essentials.txt
The first 6 lines of food.txt are appended at the end of file essentials.txt, if it existed.
If file essentials.txt existed, its content is deleted before execution of command head.
If file essentials.txt did not exist, the first 6 lines of food.txt are displayed on the screen.
If file essentials.txt did not exist, it is created and the first 6 lines of food.txt are stored into it. |
|