안녕하세요.
오늘은 history 명령어를 알아보겠습니다.
history
[root@localhost ~]# history 1 ls -al 2 cd /ex 3 ls -al 4 cd /dir1 5 vi sample.txt 6 history ... |
[root@localhost ~]# cd /etc/profile [root@localhost ~]# HISTTIMEFORMAT="%F %T - " [root@localhost ~]# export HISTTIMEFORMAT [root@localhost ~]# [root@localhost ~]# source /etc/profile |
[root@localhost ~]# history 1 2017-02-07 20:00:00 - ls -al 2 2017-02-07 20:00:30 - cd /ex 3 2017-02-07 20:01:00 - ls -al 4 2017-02-07 20:01:30 - cd /dir1 5 2017-02-07 20:02:00 - vi sample.txt 6 2017-02-07 20:03:00 - history ... |
좀 더 유용해졌죠?
이렇게 history를 활용하여 좀 더 편하게 리눅스를 사용합시다!
한 가지 더 말씀드리자면... grep을 함께 활용하면 더욱 유용합니다.
[root@localhost ~]# history | grep sample.txt |
위와 같이 활용하면 됩니다 ^^
그럼 오늘의 history 명령어에 대한 소개를 마치겠습니다.
감사합니다.
'Linux' 카테고리의 다른 글
[Linux Study-18] OS정보 확인하기 (0) | 2017.05.24 |
---|---|
[Linux Study-17] find 명령어 (0) | 2017.02.27 |
[Linux Study-15] ln 명령어 (0) | 2016.12.27 |
[Linux Study-14] rm 명령어 (0) | 2016.12.15 |
[Linux Study-13] chown 명령어 (0) | 2016.12.04 |