You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
4.8 KiB
Markdown

# Basics of GNU/Linux
## Basic File System Commands
| Name | Command | options | example |
3 years ago
|-------------------|---------|---------------------------------------|----------------------------------|
| List files | ls | -a shows all | ls -la |
| | | -l long format | |
| | | -R recursive | |
3 years ago
|-------------------|---------|---------------------------------------|----------------------------------|
| Current directory | pwd | -P prints the physical location | pwd |
3 years ago
|-------------------|---------|---------------------------------------|----------------------------------|
| Change | cd | .. takes you up a level | cd /home/gmarx |
| directory | | ~ takes you to home directory | cd ~ |
3 years ago
|-------------------|---------|---------------------------------------|----------------------------------|
| Make | mkdir | -p make parent directories as needed | mkdir -p test/example |
| directory | | -v print a message for each directory | mkdir -p /test/example |
| | | | *first example creates |
| | | | folders inside the |
| | | | current folder, other one |
| | | | creates folder in root directory |
3 years ago
|-------------------|---------|---------------------------------------|----------------------------------|
| Delete a | rm | -r recursive (use for directories) | rm sample.txt |
| file or directory | | -d remove empty directory | rm -r test |
3 years ago
|-------------------|---------|---------------------------------------|----------------------------------|
| Copy a file | cp | -r recursivec copy | cp a.txt b.txt |
| or directory | | -u copy only if the source is newer | cp test-a test-b |
| | | -v verbose (show output) | |
3 years ago
|-------------------|---------|---------------------------------------|----------------------------------|
| Move a file or | mv | -i prompts before overwrite | mv a.txt c.txt |
| directory | | No -r; Moving into the same directory | mv test example |
| | | performs a renaming | |
3 years ago
|-------------------|---------|---------------------------------------|----------------------------------|
| | touch | | |
3 years ago
|-------------------|---------|---------------------------------------|----------------------------------|
| | more | | |
3 years ago
|-------------------|---------|---------------------------------------|----------------------------------|
| | cal | | |
3 years ago
|-------------------|---------|---------------------------------------|----------------------------------|
| | | | |
*** Terminal
| Command | Description |
3 years ago
|---------|------------------------|
| CTRL-c | Stop current command |
| CTRL-z | Sleep program |
| CTRL-a | Go to start of line |
| CTRL-e | Go to end of line |
| CTRL-u | Cut from start of line |
| CTRL-k | Cut to end of line |
| CTRL-r | Search history |
| !! | Repeat last command |
| Tab key | Autocompletes |
3 years ago
|---------|------------------------|
| | |
3 years ago
*** Package management
| Command | Debian |
3 years ago
|------------------------------------|----------------------|
| Install a package | sudo apt install vim |
| Upgrade the package in your system | sudo apt upgrade |
3 years ago
|------------------------------------|----------------------|
| | |
*** Basic file editing with VIM
3 years ago
*** Expanding the file system