diff --git a/man/pages/index.html b/man/pages/index.html index f3a78d4..664abf6 100644 --- a/man/pages/index.html +++ b/man/pages/index.html @@ -110,7 +110,7 @@
Install the Raspberry Pi Imager on a computer. This is used to install a .iso file to an SD card or MicroSD card (depending on your Raspberry Pi model). Launch the application and you’ll see the following buttons:
+
Select your Raspberry Pi device and the storage device connected to your computer.
@@ -118,17 +118,17 @@Once you hit next, you should see the popup below:
+
Click EDIT SETTINGS and Set username and password. This is the only setting you should set, but others are available, such as enabling SSH (Secure Shell protocol). For the time being, let’s skip those since they’re not strictly necessary.
+
Now, wait until the installation is complete!
+
sudo allows a command to be run as the root user (see II - How to use Linux). This is most commonly used in conjunction with your package manager (see Installing Applications), but there are many use cases where you’ll want to use it. From editing system configuration files to executing system commands, in Windows terms sudo elevates your command to be run as the Administrator.
Related: su
Association: switch user and do || super user and do
+ +| Command | +Description | +
|---|---|
sudo nvim /usr/local/bin/a-custom-script |
+ Since a regular user doesn’t have permission to edit a file in /usr/local/bin, switch to the root user to edit the file. |
+
sudo apt install firefox |
+ Installing, updating, upgrading, and removing packages requires sudo (see Apps). |
+
sudo cp new-script /usr/local/bin |
+ Copy a new script to a globally accessible script location (see IV - Making your own CLI tools). | +
A package manager is an app store (in coding, the ‘==’ operation is a boolean expression meaning the left and right are the same value). There are a few important differences though.
+For the Raspberry Pi, the package manager is Advanced Package Tool, commonly called apt. Packages are applications, with all dependencies and instructions already set up.
The install and upgrade sub-commands will typically require some input from you. This comes in the form of simple Y or N prompts typically.
| Command | +Description | +
|---|---|
sudo apt update |
+ Check if any packages have a new version available. | +
sudo apt install firefox |
+ Install the Firefox web browser. | +
sudo apt remove firefox |
+ Uninstall the Firefox web browser. | +
sudo apt upgrade |
+ Upgrade every package installed with apt to the latest version. |
+
apt search firefox |
+ Find a package based upon search criteria. | +
Linux is a programmer’s playground. Writing code that will modify your system, create applications, and CLI tools, are all easily accessible through Linux. This section will cover how you can write code in the terminal, and how you can run that code.
+ +High-level, Neovim is a customizable and extensible text editor. You can either install a pre-configured Neovim distro (like LunarVim, AstroNvim, or LazyVim) or start from scratch. While you’re learning, a pre-configured distro is going to smooth the learning curve and is the general recommendation for starting out with Neovim. It’ll include modern conveniences like auto-complete, GitHub Copilot, warnings and errors, and more.
+Eventually, creating a custom configuration is ideal but ultimately not necessary. The keybindings below are the same across distributions. Additionally, most servers will have at least Vi (an ancestor of Neovim) installed. Part of the power of Neovim (and its ancestors Vi and Vim) is the modal interface. Fancy words aside, this just means that you only operate within different modes. In different modes, the keybindings change. This will only cover the most common and necessary keybinds and commands.
+ +| Command | +Description | +Category | +
|---|---|---|
nvim |
+ Open a new file. The file is created with its contents once you save. | +Basic file creation | +
nvim file.txt |
+ Open a file called file.txt. |
+ Open a file | +
nvim . |
+ Open the current directory in Neovim, using netrw. | +Enter netrw |
+
nvim a-directory |
+ Open a directory from a path, using netrw. | +Enter netrw |
+
Part of the power of Neovim is repeatable commands. The commands below can have a number prefix to indicate how many times to perform that command. Eg. 50j in command mode translates to moving 50 lines down.
| Keybind | +Description | +Category | +
|---|---|---|
h |
+ Move the cursor left a column, but in the same row. | +Navigation | +
j |
+ Move the cursor down a row, and attempt to preserve the column. | +Navigation | +
k |
+ Move the cursor right a column, but in the same row. | +Navigation | +
l |
+ Move the cursor up a row, and attempt to preserve the column. | +Navigation | +
w |
+ Move the cursor to the start of the next word or special character, ignoring whitespace. | +Navigation | +
b |
+ Move the cursor to the start of the previous word or special character, ignoring whitespace. | +Navigation | +
i |
+ Enter insert mode, the primary typing mode. |
+ Insert Mode | +
I |
+ Enter insert mode at the start of the current line. |
+ Insert Mode | +
S |
+ Enter insert mode after clearing the current line. |
+ Insert Mode | +
A |
+ Enter insert mode at the end of the line. |
+ Insert Mode | +
v |
+ Enter visual mode (highlighting/selecting) at the cursor’s current location. Select text with navigation keys. |
+ Visual Mode | +
V |
+ Enter visual mode at the cursor’s current row. j and k are used to select more rows. |
+ Visual Mode | +
y |
+ Copy highlighted text to Neovim’s clipboard. NOTE: Neovim’s clipboard is separate from your system clipboard. | +Visual Mode | +
"*y |
+ Copy highlighted text to your system clipboard. | +Visual Mode | +
u |
+ Undo. | +Special Function | +
p |
+ Paste text from Neovim’s clipboard. | +Special Function | +
:Ex |
+ Enter Neovim’s file explorer, netrw. |
+ Enter netrw |
+
% |
+ Create a file inside the current directory. | +netrw keybinds |
+
d |
+ Create a new directory inside the current directory. | +netrw keybinds |
+
D |
+ Delete a file or empty directory. | +netrw keybinds |
+
:w {filename} |
+ Write (save) the current file. You can specify a filename as well. | +File Management | +
:q |
+ Quit (exit without saving) the current file. | +File Management | +
:wq |
+ Write (save) and quit (exit) the current file. | +File Management | +
:%s/original/new/g |
+ The most common command I use, a highly and easily configurable search and replace. The (optional) % means the entire file. By default, it’ll only apply to the current line. original is the current text and new is the replacement. The (optional) g means every instance on each line. By default, it’ll only apply to the first occurrence. |
+ Advanced Command | +
Escape |
+ Exit current mode. | +Exit mode | +
A broad overview on a handful of languages that you can use with the Raspberry Pi:
+Python is the most commonly used language with the Raspberry Pi. Python is known for its syntactic simplicity for novice programmers...
+ +sudo apt install python.python --version.pip --version.Git is a critical component of modern software development...
+ +| Command | +Description | +
|---|---|
git clone https://github.com/<user>/<repo> |
+ Create a local copy of the remote repo owned by <user> called <repo>. |
+
git clone <remote> <destination> |
+ Clone a remote repository and save it in a directory called <destination>. |
+
| Command | +Description | +
|---|---|
git stage -A |
+ Include all changes in the commit. | +
git stage <file> |
+ Add a file you want to include in the commit. | +
| Command | +Description | +
|---|---|
git commit |
+ Open your default text editor to create the commit message. Once you save and quit, a new snapshot of your local repo is saved. | +
git commit -m “A commit message.” |
+ Create the snapshot with a commit message. | +
git commit --all |
+ This option auto-stages your changes for the commit, so you do not need git stage. |
+
git push will attempt to upload your commit(s) to the remote repository.
+ +git pull will download the latest changes from the remote repository.
+ +man is used to open instructional information about a particular command, application, or function. The man command is quite powerful, though a touch verbose. It’ll provide information on all possible parameters, uses, and idiosyncrasies.
| Command | +Description | +
|---|---|
man <command> |
+ Open the manual for a command, application, or function. Press q to quit, and use j and k to move down and up respectively. |
+
tldr is the concise version of man. Personally, I use tldr almost every day. It provides the most common few uses of a command, application, or function.
| Command | +Description | +
|---|---|
tldr <command> |
+ Get quick information about a command, application, or function. | +
zsh is a shell, effectively the programming language your terminal uses. zsh has more customization options available, such as oh-my-zsh, starship, and much more. Using your programming skills to customize your operating system is a deep rabbit-hole that you should at least be aware of.