티스토리 뷰

Linux

Linux, file명령어 & strings명령어

hwangyoungjae 2016. 4. 22. 18:03
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

-. file [파일명 혹은 디렉토리]

file 명령어 뒤에 파일이름을 넣으면 해당파일의 종류가 출력

[root@localhost ~]#file typescript

typescript: UTF-8 Unicode text, with CRLF, LF line terminators, with escape sequences

 

여러개 파일의 종류를 보고싶다면 [*] 문자를 사용해주면 됨

[root@localhost ~]#file *

Desktop:               directory

anaconda-ks.cfg:       ASCII English text

icmp_echo_ignore_all~: ASCII text

install.log:           UTF-8 Unicode text

install.log.syslog:    empty

rpm_list.txt:          UTF-8 Unicode English text

scsrun.log:            UTF-8 Unicode text

systest:               directory

typescript:            UTF-8 Unicode text, with CRLF, LF line terminators, with escape sequences

이는 현재 디렉토리에 있는 모든 파일 종류를 출력 #디렉토리는 디렉토리라는 출력함

 

-. 데이터파일의 내용보기

[root@localhost ~]#file /var/log/wtmp

/var/log/wtmp: data

이런 데이터파일은 binary형식으로 저장되어 있어 vi cat으로 읽기가 힘듬,

[root@localhost ~]#strings /var/log/wtmp

strings명령어로 해당파일을 보면 binary형식 문자는 제외하고 ASCII형식으 문자들만 출력해줌

 

 

참조 : 리눅스 서버관리 실무 바이블 3.0(박성수 저) 

'Linux' 카테고리의 다른 글

Linux, 리눅스 부팅과정  (0) 2016.04.26
Linux, 부팅레벨(Run level)  (0) 2016.04.26
Linux, script 명령어  (0) 2016.04.22
Linux, .bash* 파일  (0) 2016.04.22
Linux, alias  (0) 2016.04.22
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/07   »
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
글 보관함