Useful tips in terminal
Table of contents
Common tips in terminal
.ssh/config
- Push/Pull code from pycharm to github
Host bitbucket.org
User git
HostName bitbucket.org
IdentityFile ~/.ssh/tis_id_rsa
Host sonnguyen2002.bitbucket.org (alias)
User git
HostName bitbucket.org (actual host)
IdentityFile ~/.ssh/id_bitbucket_sonnguyen2002 (key)
- Sample link in .git/config
git@sonnguyen2002.bitbucket.org:sonnguyen2002/jp-legal-text-preprocessing.git
Adding your SSH key to the ssh-agent
$ eval `ssh-agent`
$ ssh-add path_of_key (no need extension)
Count
- Count the number of files in a directory
ls | wc -l
- Count the number of lines in a file
wc -l file
Search, Replace using command lines in terminal with grep, awk, sed
- Find all file names which matched to “abc”
ls | grep "abc"