| date created | 2024-01-31 19:49:34 -0800 |
|---|---|
| date modified | 2025-01-21 03:23:52 -0800 |
ls: List files and directoriesls -a: List all files and directoriesls -l: List files and directories in long formatls -la: List all files and directories in long format
cd <dir>: Change directorycd..: Go up one directorycd ~: Go to home directorycd -: Go to previous directory
mkdir <dir>: Create a new directorytouch <file>: Create a new file and modify last modified timecp <from> <to>: Copy a file or directorymv <from> <to>: Move a file or directoryrm <file|dir>: Remove a file or directoryrm -r <dir>: Remove a directory and its contentsrm -f <file|dir>: Force remove a file or directoryrm -rf <dir>: Force remove a directory and its contents
cat: Print the contents of a fileless: View the contents of a file
vim: Use vim as a file editor- At the bottom left you see in which mode of vim you are currently in.
- If it doest say anything, you are in "normal" mode. Here you may enter commands like:
:wto save a file:qto exit the editor:wqto save and exit the file:q!to exit and discard changes- Or press specific keys, like:
ito start editing at your cursors positionato start editing at the end of the word your cursor is on
- If you are not in normal mode, but in editing mode for example, you can hit
Escto get back to normal mode and save/exit the file.
nano: Use nano as a file editor- Nano shows the available commands at the bottom.
- The
^<Letter>usually means a keyboard shortcut ofCTRL+<Letter>, e.g.:^X Exit->CTRL+Xto exit the file. You will be asked to save, discard or cancel, if you made changes without saving them before.- Hit
Yto save and exit - Hit
Nto discard changes and exit - Hit
CTRL+Cto cancel exiting the file
- Hit