find . -name "rc.conf" -exec rm '{}' \;
find . -empty -exec rmdir '{}' \;
find . -type f -exec clean '{}' \;
7z u -p{password} -mhe target.7z files
git reset --soft HEAD\^
git checkout -f
or
git reset --HARD
git reset --hard origin/master
git show {branch/tag/commit}:{path/to/file/from/repo/root}
example:
git show master:dir1/dir2/file.txt
git reflog --all
git fsck --lost-found
git reset --merge
git filter-branch \
--index-filter 'git rm --cached --ignore-unmatch path/to/file' \
{from}..{to}
git branch -d {branch}
git push --delete origin {branch}
git clean -f (all untracked files)
git clean -f -n (dry run)
git clean -f -n {path} (dry run on files in path)
convert --sample 50% input.png output.jpg
convert -colors 2 input.png output.png
convert file1.png file2.png output.pdf
convert -page {width}x{height} file1.png file2.png output.pdf
convert arrow-left.png -flop arrow-right.gif
convert arrow-up.png -flip arrow-down.gif
ctrl+c reset
ctrl+c stty sane
# show only summary (e.g. "file1 differs"):
diff -rq dirA dirB
# show diff for each file:
diff -r dirA dirB
awk '{ print $2 }'
awk '{s+=$6} END { print s }'
awk '{ printf "%''d\n", $1 }'
awk "{ printf \"%'d\n\", $1 }"
wc -l
name='file.ext'
echo ${name:r} # => outputs 'file'
fullpath='/path/to/file.ext'
echo ${fullpath:t} # => outputs 'file.ext'
name='file-bob.txt'
echo ${name:s/bob/joe} # => outputs 'file-joe.txt'
compinit
tmux attach -d
tmux attach -d -t specific_session_name
bzr branch bzr+ssh://{username}@{hostname}/path/to/repo local_dir_to_create
/msg nickserv help
/msg nickserv register <password> <email-address>
sudo killall VDCAssistant
(see https://discussions.apple.com/thread/4158054?start=0&tstart=0)
cat file.xml | xmllint --format -
od -xcb {file}
dscacheutil -flushcache
cat $filename | while read line; do echo $line; done
psql -h {host} -p {port} -U {username} {database} ? - show help (all commands) \l - show all databases \d - show all tables and other objects \dt - show all tables \db - show all tablespaces \d+ - describe table
echo "hello" | cut -c 3- # will output "llo"