티스토리 뷰
.bash_profile 에 등록해놓으면 되겠다
alias tt='ll -lrt | grep ^- | head -1 | awk '"'"'{print $9}'"'"' | xargs tail -f'
tt 입력 시 마지막으로 수정된 파일 tail건다
설명
ll -lrt (시간 역순 정렬)
grep ^- (-로 시작하는 항목 grep, 폴더는 ^d로 걸린다)
awk '"'"'{print $9}'"'"' 항목 중 9번째 항목을 가져온다. OS별로 숫자는 다를 수 있다
xargs tail -f 태일 건다
끝
.bash_profile 수정후 재접속 혹은
source .bash_profile을 통해 적용
그냥 명령어로 칠려면 다음처럼 심플하게(순서
ls -lt | grep ^- | head -1 | awk '{print $8}' | xargs tail -f
'개발 > Linux, Server' 카테고리의 다른 글
| vmstat 파일에 쓰기 (0) | 2014.08.25 |
|---|---|
| shell 색상 입히기 (0) | 2013.11.28 |
| 서버 공인 및 사설 IP 확인 (0) | 2013.08.21 |
| 방화벽 설정(iptables) (0) | 2013.06.19 |
| SVN 서버 설치하기(Cent OS) (0) | 2013.05.14 |
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- properties
- vi
- ls
- resttemplate
- Kotlin
- 도커
- maven
- Access
- java
- 톰캣
- Profile
- oracle
- Tomcat
- jQuery
- boot
- Build
- Spring
- IntelliJ
- grant
- mybatis
- 합정
- Linux
- 맛집
- vrapper
- Eclipse
- Shell
- Database
- vim
- 코틀린
- docker
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
글 보관함
