This repository presents a guidance and examples of the usage of GNU/Linux operative system.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
5.0 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. # Basics of GNU/Linux
  2. ## Basic File System Commands
  3. | Name | Command | options | example |
  4. |-------------------|---------|--------------------------------------------------------|----------------------------------|
  5. | List files | ls | -a shows all <br> -l *long format* <br> -R *recursive* | ls -la |
  6. | Current directory | pwd | -P prints the physical location | pwd |
  7. |-------------------|---------|--------------------------------------------------------|----------------------------------|
  8. | Change | cd | .. takes you up a level | cd /home/gmarx |
  9. | directory | | ~ takes you to home directory | cd ~ |
  10. |-------------------|---------|--------------------------------------------------------|----------------------------------|
  11. | Make | mkdir | -p make parent directories as needed | mkdir -p test/example |
  12. | directory | | -v print a message for each directory | mkdir -p /test/example |
  13. | | | | *first example creates |
  14. | | | | folders inside the |
  15. | | | | current folder, other one |
  16. | | | | creates folder in root directory |
  17. |-------------------|---------|--------------------------------------------------------|----------------------------------|
  18. | Delete a | rm | -r recursive (use for directories) | rm sample.txt |
  19. | file or directory | | -d remove empty directory | rm -r test |
  20. |-------------------|---------|--------------------------------------------------------|----------------------------------|
  21. | Copy a file | cp | -r recursivec copy | cp a.txt b.txt |
  22. | or directory | | -u copy only if the source is newer | cp test-a test-b |
  23. | | | -v verbose (show output) | |
  24. |-------------------|---------|--------------------------------------------------------|----------------------------------|
  25. | Move a file or | mv | -i prompts before overwrite | mv a.txt c.txt |
  26. | directory | | No -r; Moving into the same directory | mv test example |
  27. | | | performs a renaming | |
  28. |-------------------|---------|--------------------------------------------------------|----------------------------------|
  29. | | touch | | |
  30. |-------------------|---------|--------------------------------------------------------|----------------------------------|
  31. | | more | | |
  32. |-------------------|---------|--------------------------------------------------------|----------------------------------|
  33. | | cal | | |
  34. |-------------------|---------|--------------------------------------------------------|----------------------------------|
  35. | | | | |
  36. *** Terminal
  37. | Command | Description |
  38. |---------|------------------------|
  39. | CTRL-c | Stop current command |
  40. | CTRL-z | Sleep program |
  41. | CTRL-a | Go to start of line |
  42. | CTRL-e | Go to end of line |
  43. | CTRL-u | Cut from start of line |
  44. | CTRL-k | Cut to end of line |
  45. | CTRL-r | Search history |
  46. | !! | Repeat last command |
  47. | Tab key | Autocompletes |
  48. |---------|------------------------|
  49. | | |
  50. *** Package management
  51. | Command | Debian |
  52. |------------------------------------|----------------------|
  53. | Install a package | sudo apt install vim |
  54. | Upgrade the package in your system | sudo apt upgrade |
  55. |------------------------------------|----------------------|
  56. | | |
  57. *** Basic file editing with VIM
  58. *** Expanding the file system