Mostly "notes to self" as I occasionally forget...
uname -a
ps aux | grep [something]
kill -9 [pid]
zcat [fileName.gz]
Flags roughly: -x
extract, -v
verbose, -z
gzip, -f
file
tar -xvzf [fileName.tar.gz]
wc -w [fileName]
cat [fileName] | wc -l
cat [fileName] | sort
tree -I '.git|node_modules'
hostname # server domain
hostname -i # ip
hostname --fqdn # fully qualified domain name
whoami
find . -name "node_modules" -type d -prune -exec rm -rfv '{}' +
-Rin
~ recursive, ignore case, line number (-l
instead of -n
for file name only)
grep -Rin "text-to-find" --include=\*.js --exclude-dir={.git,node_modules} .
--exclude=\*.jpg
--include=\*.{css,html}
--exclude-dir={dir1,dir2}
Credit: https://askubuntu.com/a/300763
for d in */; do cp someFile.txt "$d"; done
Excludes node_modules
via .gitignore
, for example
git archive -o latest.zip HEAD
In ~/.profile
or ~/.bashrc
export PATH="$HOME/.local/bin:$PATH" # adds to start
export PATH+=":$HOME/.local/bin" # adds to end