Edward's Tech Site this site made with Next.js 13 , see the code HOWTO: Aug 14 - Macbook
Notes on Scott Simpson's course: Learning Zsh
infosrecorded 2019 course is here Introducing Zsh Installation and initial configuration Linux, Unix, OpenBSD, FreeBSD sudo apt install zsh
then just type zsh
press 0 to create a ~/.zshrc changed HISTSIZE=5 and it works (with source) he went to the main menu and is clicking through the menu to set it up Using Zsh as your primary shell chsh
asks your password, then gives you a file to edit where you can change your shellor chsh -s /usr/bin/zsh edward
or sud usermod -s /usr/bin/zsh edward
adduser.conf on my Debian but not my Macbook Environment and options shell is a program of its own setopt and unsetopt was able to setopt verbose
in .zshrc and it was set when opening any shell Aliases and reserved words order of preferencealias reserved words functions builtins commands if you make an alias with same name as "ls", then "command ls" alias, unalias Functions ml() {
to create functionunfunction as well functionsin Debian, Arch: declare -F echo $fpath
only zshautoload for function loading this loads a tetris game Builtins and commands most in /usr/bin and /bin which pwd: zsh says shell built-in command disable builtin pwd enable builtin pwd Finding help Autocd and cd shorthand working directory pwd
find out what it isDirectory stack and user dirs zsh;how to add an alias for a directory path; in .zshrc add hash -d ss=~/Documents/SCREENSHOTS
, then ls ~ss
and cd ~ss
;4.7 linux;how to move to another users (e.g. "lars") home directory; cd ~lars
;4.2 linux;how to keep a list of directories you are working on and move to them quickly by number; pushd /etc
, pushd /var
, pushd /etc/nginx/conf.d
, dirs -v
, pushd +2
;4.6 Finding files and commands linux; find all files in your home directory that are greater than 100 MB large;find /Users/edward -size +100000k 2>dev/null
linux;how to find all files anywhere named "index.html"; find / -name "index.html" 2>/dev/null
;4.9 which shows where a command is whence shows how it would be interpreted if it ran Autocompletion setopt completeinword setopt correct Redirection and multios setopt noclobber
overwrites
appends
ls | mc -m (counts characters in file) use tee to see information in a pipeline Command history pressing up once recalls the previous command setopt histignorespace setopt interactivecomments History shell variables linux; how to refer to the last argument again; cp dir001.txt dir001.bak
then cat $_
;4.8 linux; how to refer to the same argument again; cat projects/project001/.env
then cp !* proj001.bak
;4.8 Expansions !333 online in interactive shells ls -al ${mdir}TEST Renaming files with zmv there is no undo ** means recursionso: zmv '(**/)/(*).log' ..., just know you can use it get help on this and other zsh commands: man zshcontrib
Scripting Configuration files shellslogin shellecho $-
= lie.g. 569XZilms interactive shell non-interactive shell where they are configuredmost of these files won't exist in your system Customizing the prompt echo $PROMPT colors with %F{green}nnn%f all the colors Using the Oh-My-Zsh configuration manager main site: ../ohmyz.sh https://ohmyz.sh runs the wget command running on archinstall zshsudo pacman -Sy
sudo pacman -S zsh
chsh -s /bin/zsh
he adds plugin: `plugins=(git battery)can now type these commands then in .zshrc Learning Zsh powerline adds symbols to promptsit's complicated, depends on distro gives more options but is not very portable Learn more