Note writing
Use | command | Example |
---|---|---|
Get current directory | pwd | |
Get file list | ls | |
Get current date and time | date | |
Move | cd | cd Desktop |
File creation | touch | touch test.txt |
Directory creation | mkdir | mkdir test |
File deletion | rm | rm test.txt |
Directory deletion | rm -rf | rm -rf test |
Check the contents of the file | cat | cat test.txt |
Check the contents of the file | tail | tail test.txt |
Go inside the file | vi | vi test.txt |
Move file | mv | mv test.txt directory/test.txt |
File copy | cp | cp test.txt test.txt.copy |
Operations to use after entering a file with the vi command
Use | command | Example |
---|---|---|
Input mode | i | |
Input mode exit | Press esc | |
Issue line number | :set number | |
Move to a specific line number | :78 | Move to line 11 |
Move to the last line | :$ | |
Move to the very first line | :1 | |
Character search | /test | Search for the string test |
Save the file and exit | :wq! | |
Exit without saving the file | :q! |
Recommended Posts