일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |
- PERL
- 게임
- 포탈
- 카카오
- 요리
- 구글
- 맥북
- 유튜브
- 클리어
- 프렌즈런
- 설치
- Linux
- arduino
- Java
- 인그레스
- game
- 공략
- OSX
- Python
- 이마트트레이더스
- Mac
- IntelliJ
- 닌텐도스위치
- Ingress
- Installation
- 판교
- 맛집
- 아이폰
- Today
- 52
- Total
- 3,170,918
목록Shell (17)
준호씨의 블로그
https://github.com/git/git/tree/master/contrib/completion 에서 관련 파일을 받을 수 있다. cd ~ wget https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh -O .git-prompt.sh ~/.bashrc 파일 수정. PS1 보다 위에 아래 내용을 추가 source ~/.git-prompt.sh PS1 설정에 $(__git_ps1) 추가 junho85@junho85:~/git_branch_test$ (my-branch) git checkout master Switched to branch 'master' junho85@junho85:~/git_b..
some.log 라는 파일이 다음과 같을 때 aaa bbb ccc tail -n +2 some.log 의 결과는 bbb ccc 가 나온다. 한줄 더 제거 하고 싶으면 다음과 같이 하면 된다. tail -n +3 some.log ccc -n x 옵션에서 x 에 + 를 붙이면 x-1 만큼 라인을 빼고 tail 을 한다고 보면 된다. 참고 https://stackoverflow.com/questions/339483/how-can-i-remove-the-first-line-of-a-text-file-using-bash-sed-script
apache httpd.conf 의 특정 내용을 바꾸고 싶다거나, sendmail.cf 의 특정 설정만 바꾼다던지 하고 싶을 때가 있다. 설정파일은 텍스트 파일이기 때문에 sed 커맨드를 이용하면 손쉽게 바꿀 수 있다. 아래와 같이 하면 some.conf 라는 파일의 DebugLevel=old 가 DebugLevel=new 로 바뀌게 된다. sed -i 's/DebugLevel=old/DebugLevel=new/g' some.conf sed 는 Stream EDitor 라는 유틸이다. -i 옵션은 in-place 의 의미로, 원본 파일에다가 바로 수정을 하겠다는 의미이다. s/old/new/g 에서 s 는 substitute 라고 내용을 바꿀 때 쓰는 커맨드이다. old 는 찾으려는 원본 문자인데, 정규..
pkill -f my_pattern ps -ef | grep myProcessName | grep -v grep | awk '{print $2}' | xargs kill -9 참고 https://stackoverflow.com/questions/8987037/how-to-kill-all-processes-with-a-given-partial-name
You can see stderr "No such file or directory" when you 'cat' none exists file $ cat nonexistent_file cat: nonexistent_file: No such file or directory If you want to hide stderr, attach 2>/dev/null after command cat nonexistent_file 2>/dev/null Tip 'grep' command has '-s' option to hide error message about nonexistent or unreadable files. -s, --no-messages Suppress error messages about nonexiste..