/usr/akts
user@devbox:~$
this talk is on /bin/bash
$HISTORY
& <Tab>
completion
▲
- very familiar.^r
- search history
*as many times needed
!!
- last command in history!20
& !-2
- exec
20th & 2nd last command in history
vi !$
(or)
<Esc> .
- fill the last arg of prev
comm
<Tab>
and
<Tab><Tab>
$FILE
opsfind /folder/path -type f -print
- by file
type
find /folder/path -name *.js -print
- by
file type
find /folder/path -size +50M -print
- by
file size
head
& tail
cat
touch
- create empty file or update
timestamp
$PAGER
- vim -R
//
less
// more
$PIPE
& $REDIRECTION
ls | grep *.log
- pipingnode print_something.js > output.txt
-
redirection
command 2> err.log 1> output.log
>>
- appends to file$NAVIGATION
cd
// pushd
//
popd
// dirs -v
//
cd ~x
// cd -
^a
& ^e
^l
== clear
^◀
& ^▶
$PROCESS
ps
&
kill <pid>
pidof nginx
top -p <p1>,<p2> ...
then,
E/e
netstat
$ARCHIVING
gzip foobar.txt
tar -czvf ar.tar.gz ar
zcat access.log.gz
$HOME/bin
ln -s $TARGET $FILE
.profile .bashrc
-
$PATH
./script.sh
or
sh script.sh
sudo apt install vim tmux
tmux
-
cheatsheet
vimtutor
-
cheatsheet //
print this!!
crontab -e
PS1
and $HOME/bashrc
alias lanip="ip addr show wlp5s0 | grep inet | awk '{ print $2
}' | head -n 1 | cut -f1 -d'/'"
alias v=vim
alias sl=ls
cdls() { cd "$@" && ls;}