This repository presents a guidance and examples of the basics of 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.

66 lines
4.8 KiB

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