The command line
They are great! Will talk through some of them at the end, if we have time.
Command line interface
- Windows
- macOS/Linux
- Terminal
We'll be using the following in the VSCode integrated terminal:
- Windows: Git BASH
- macOS: Bash/zsh
Open it up.
subtitles on
- Darwin (macOS)
- Debian
- Ubuntu
- Mint
- Fedora
- Red Hat Enterprise Linux (RHEL)
- Separators:
- Windows (outside of Git BASH):
\ - macOS/Linux:
/
- Windows (outside of Git BASH):
.- current directory..- parent directory- Absolute vs. relative
pwd- path of working directoryls- list filesls -al- list all files (with dotfiles) with more details
cd- change directory- Mac:
- From Finder, right-click on folder
- Click
Services - Click
New Terminal at Folder
Control-r allows you to search your command history
- Viewing
catless
mvcpmkdirrmdirfind- Editing
nanovim
If files have spaces or special characters, need to put quotes around them.
- Best to avoid these when naming files, sticking to:
- Letters
- Numbers
- Periods
- Hyphens
- Underscores
- For Python files, snake case is most common.
snake_caseTitleCasecamelCase
- less:
q - nano: control-
x - vim: escape, then
:q! - Other command line tools: control-
c
Worst case, close your Terminal, and that will kill whatever process was running.
echoecho abc | less
- Exit codes
echo $?
- Environment variables
whichwhich jupyterwhich -a python3
$PATH- Pipes
ls | xargs cat
- Redirecting output
grepsudoman
Uses a "wildcard":
find . -name 'lecture_*.md'find . -name 'lecture_*.md' | sed -E 's/([0-9]{2})/0\1/'
- PowerShell
- Bash
- zsh
echo $SHELL- Dotfiles
- Shell customization
Done through package managers
- conda
- Anaconda channel, maintained by the company
- conda-forge, maintained by the community
- pip
- Virtual environment
- Linux: Aptitude, Snapcraft, others
- Mac: Homebrew
- Windows: Windows Package Manager / WinGet, Chocolatey, Scoop
- I am curious if there is a way to sync with the home database without doing it manually once in a while. It seems a bit annoying to have to deal with it regularly.
- At what point does the proliferation of branches and pull requests begin to introduce coordination overhead, rather than reducing it?
- If a team hits a WIP limit in a very specialized area, how can generalist team members realistically help clear that bottleneck if they lack the specific expertise?
- While the readings emphasize how safe branches are, I'm curious what are the best practices for the planning phase when multiple branches inevitably need to touch the same files? I'm interested in how teams avoid messy merge conflicts before they happen.
- What's the difference between command line interface, terminal, shell, and bash?
Note to self: Send terminal commands+output.
