Terminal Basics

Package Management, Cheats and Cheatsheets

Definitions

bash - most common shell and command language
zsh - more user friendly bash-like shell
powershell windows command shell
cmd older windows command shell
alias simplify command or set of commands
repo a place on the web where software is stored

CLI - Command Line Interface
GUI - Graphical User Interface

distro - some linux distribution like Fedora, Ubuntu...
package manager - software that installs software with CLI or GUI

cheatsheet - condensed list of commands or shortcuts

Command line shortcuts

Ctrl-C Cancel
Ctrl-U Delete before cursor
Ctrl-K Delete after cursor
Ctrl-A cursor to beginning
Ctrl-E cursor to end
Ctrl-R search in history
Ctrl-P previous entry in history
Ctrl-N next entry in history
Ctrl-L clear by adding empty space

Navigation

print working directory pwd
change directory cd
clear terminal printout clear
list directory items ls

Special characters

/ root directory
~ home directory
. current directory
.. up a directory
- previous directory

File and folder manipulation

create file touch
create directory mkdir
copy items cp
move items mv
remove items rm

Tools

print file in terminal cat
search for string in file grep
view printout in scrollable mode less
stream text editor sed

Search

fzf fuzzy finder
which installed binary location
whereis also binary finder
find file system search
locate prebuilt filesystem database search

Package managers

Linux advanced package manager - apt, pacman, dnf
Windows winget, chocolatey
MacOS homebrew

Linux

  • Ubuntu, Debian based distros
    • apt install somesoft
  • Fedora, CentOS, SUSE
    • dnf install somesoft
    • pacman -S somesoft
    • Manjaro, Arch based distros
    • pacman -S somesoft

Windows

  • winget install somesoft
  • choco install somesoft

Windows WSL

  • wsl --install -d Ubuntu
  • wsl --export Ubuntu C:\Users\tud\wsl-backups

MacOS

  • brew install somesoft
  • brew search somesoft

Editors

  • vi, vim, nvim, nano, emacs...

My setup

OS Fedora 34
Text editor NeoVim
Shell zsh
Zsh plugins oh my zsh, zsh-syntax-highlighting, zsh-autosuggestions, git, autojump, fzf
Theme powerlevel10k