Bash command are mainly supported MacOS, Linux. On Windows, you can use WSL, it’s easy to setup and can use full-featured.
Note: Terminal ZSH
- Apps: We have many applications such as cmder (Windows), iTerm2 (MacOs),… For me only, I usually WezTerm on MacOS and Linux
- Online: repl.it
Ctrl
+C
: interrupt current tasksCtrl
+L
: clear the screenTab
: Autocomplete the commands / directories / file names / …Ctrl
+Shift
+V
: pastes from clipboard.- For a long list:
Enter
to continue read,q
to quit Ctrl
+A
: Move cursor to beginning of the line
# run at oncecommand_1 && command_2
Note+
#!/bin/bash
tells your terminal to run the script with bash
. There are also zsh
, sh
, fish
,…
Multi-column
Note
# using script: file.sh#!/bin/shecho 'some info'command_1command_2
Note
# using script: file.sh# with arguments$file1 = $1wc $file1 # word count
# multiple input argsfor FILE1 in "$@"; do wc $FILE1done
Note
NAME="defaut" # default value! DON'T HAVE SPACE!!!# with flagswhile getopts n:f: option; do case "${option}" in n) NAME=${OPTARG};; f) FILE=${OPTARG};; esacdone
Multi-column
Note
# all files / folders containing 'abc'ls | grep -i abc
Note
# find command lines containing 'abc'dpkg -l | grep -i abc
Note
# search and extract a part of resultpip show numpypip show numpy | sed -n 's/Location: //p'# /usr/lib/python3/dist-packages