git add files by pattern

By all unstaged files

-> ga --dry-run --verbose .

By file extension

-> ga --dry-run --verbose *.md
-> ga --dry-run --verbose \*.md

By some part of file name

-> ga --dry-run --verbose *moon*

Example

git-add-with-file-with-pattern
Demonstration of git add file with patterns
Advertisements

Setting locales so that terminal in Mac OS would display Unicode character

locale

Output:

LANG=
LC_COLLATE="C"
LC_CTYPE="UTF-8"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL=

We can set the LANG variable by

export LANG=en_US.UTF-8

Or you can also add that line into the file ~/.bash_profile, and then source ~/.bash_profile

Different ways to output Christmas tree [from fileformat] in terminal:

perl -CS -E 'say "\x{1F384}"'
echo -e "\xF0\x9F\x8E\x84"

To display Christmas tree in git log

Turn out that because less program is not up-to-date in Mac OS. Hence we need to update it.

http://www.recursion.org/2016/6/19/displaying-emoji-in-git-log

 

Concatenate multiple files ignoring the first line

Working solution

{ for f in part*; do tail -n+2 "$f"; done; } > stepB

Non-working solution

tail -n +2 part* > stepB

The non-working solution produced the output with ==> part <==

==> part-00000 <==
00052e572d0e29d03bcb98c3d104fbbe,222-01-61320-08976,1,38,0,152,1
00052e572d0e29d03bcb98c3d104fbbe,222-01-61320-08976,14,23,0,0,1