# jog - 현재 폴더에서 실행한 최근 10개의 명령만 보기

> Clean Markdown view of GeekNews topic #5359. Use the original source for factual precision when an external source URL is present.

## Metadata

- GeekNews HTML: [https://news.hada.io/topic?id=5359](https://news.hada.io/topic?id=5359)
- GeekNews Markdown: [https://news.hada.io/topic/5359.md](https://news.hada.io/topic/5359.md)
- Type: news
- Author: [xguru](https://news.hada.io/@xguru)
- Published: 2021-11-11T10:19:01+09:00
- Updated: 2021-11-11T10:19:01+09:00
- Original source: [github.com](https://github.com/natethinks/jog)
- Points: 2
- Comments: 1

## Topic Body

- 간단한 스크립트로 각 폴더별 zsh_history 를 생성

ㅤ→ 나중에 "현재 폴더"에서 실행한 최근 10개의 명령만 보여줌

- .zshrc 에 아래 함수만 넣으면 설치는 끝

function zshaddhistory() {

	echo "${1%%$'\n'}|${PWD}   " >> ~/.zsh_history_ext

}

- zog 스크립트 실행해서 보기

grep -v "jog" ~/.zsh_history_ext | grep -a --color=never "${PWD}   " | cut -f1 -d"|" | tail

## Comments



### Comment 13799

- Author: junghan0611
- Created: 2022-12-16T11:00:41+09:00
- Points: 1

잘 동작합니다. 이게 필요했습니다 ^^
