1. File directory related commands
1. View file details command ls -l
2. Create an empty file touch
3. Edit the empty file
1. Open the file and directly edit vi (centos7 does not support vim by default)
1. Enter edit state (insert mode)
i--------------------insert
2. Write the content of the file
3. Save and close the file
esc (exit edit mode) ---------: wq (save and exit)
: q! (force exit)
2. Edit without opening the file
Redirect the information displayed on the screen to a file
1. Information displayed on the screen
echo "information"
2. Redirect the information to a file
echo "I am information"> oldboy1 / oldboy1.txt
echo "I am appending" >> oldboy1 / oldboy1.txt
4. View the file content cat
5. Copy and save data