Advertisement
Guest User

5-minute linux handbook

a guest
Apr 29th, 2023
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.83 KB | Source Code | 0 0
  1. https://boards.4channel.org/g/thread/92936829#p92938504
  2.  
  3. 5-minutes Linux handbook
  4.  
  5. This handbook is intended for people who are considering about switching over to linux or have just switched to linux, and are unfamiliar with common CLI tools and basic stuff.
  6.  
  7. This handbook assumes you have been a seasoned Windows user and possess more IQ than a snail.
  8.  
  9. 1. Understanding what the commands actually do
  10.  
  11. ALWAYS REMEMBER : UNDERSTAND WHAT YOU ARE DOING *BEFORE* YOU DO IT
  12.  
  13. If someone tells you to type any command, you can find out what said command can do by :
  14.  
  15. <command> --help
  16. man <command>
  17.  
  18. *<command> refers to a single command without any arguments
  19.  
  20. this will show you all the options of said command, if you want to know what a specific argument of a command does, type
  21.  
  22. <command> --help | grep <argument>
  23.  
  24. Examples :
  25.  
  26. ls --help
  27. ls --help | grep "-s"
  28.  
  29. 2. Navigating your filesystem and editing files inside CLI (Command Line Interface)
  30.  
  31. Reminder : Everything is case-sensetive, including names and commands
  32.  
  33. "Purple purple PuRpLe"
  34. are three different names/commands/directories/arguments
  35.  
  36. Folders and Directories mean the same thing
  37.  
  38. //navigating and viewing directories
  39. ls : list files and folders in current directory
  40. pwd | tree : same as ls but in tree-view
  41. cd <path> : takes you to a specific directory
  42. cd .. : goes up one directory
  43.  
  44. //creating or editing files
  45. touch : creates new file
  46. nano : basic text editor
  47. (Ctrl+S to save, Ctrl+X to exit)
  48.  
  49. if you need to append a single line to a text file do :
  50. echo <text> >> filename.txt
  51.  
  52. if you need to create/replace a file and append some text to it do :
  53. echo <text> > filename.txt
  54.  
  55. //deleting files and folders
  56. rm : deletes a single file
  57. rm -r : bulk deletes folder(s) and everything inside it
  58.  
  59. //what is ~
  60. ~ is usually an alias to your "home" folder
  61.  
  62. most of your userdata resides in /home/<user>/
  63. instead of typing the ^entire path in a command you can just type ~
  64.  
  65. for example :
  66.  
  67. instead of typing :
  68. rm -r /home/user/Documents/new-files/
  69.  
  70. you can type :
  71. rm-r ~/Documents/new-files/
  72.  
  73. 3. Overview of the Filesystem
  74.  
  75. Reminder : If you're a beginner, you really shouldn't mess with anything that's outside of ~/
  76.  
  77. / : Root directory, under which literally everything of a linux system resides (even hardware devices)
  78.  
  79. /home : where your "Home" is, usually anything you access from your graphical File Manager or other apps are stored here by default under your username
  80.  
  81. ~/ : An alias for your Home directory, basically points to /home/<user>/
  82.  
  83. /etc , /usr/share , ~/.local/share : usually where config files for both system and normal apps are stored
  84.  
  85. ~/.local/ is usually used by Apps for that specific user's configuration
  86. /usr/ is usually used by Apps for configuration which needs to apply for all users
  87. /etc/ is usually for other system-related stuff
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement