리눅스 find/date/cal/cat/tail/head/|(파이프)/more 사용법
<find : 파일을 검색>
[root@localhost ~]# find / -name test (/ 위치에서 test라는 이름의 파일검색)
[root@localhost ~]# find /test -name 1 (/test 위치에서 1이라는 이름의 파일 검색)
[root@localhost ~]# find / -cmin +5 (/위치에 생성된지 5분 이상된 파일 검색)
[root@localhost ~]# find / -cmin -5 (/위치에 생성된지 5분 이내 파일 검색)
<date :현재 시간 확인>
[root@localhost ~]# date
<cal : 달력 보기 >
[root@localhost ~]# cal
<cat : 파일 문자 확인>
[root@localhost ~]# cat /etc/passwd (/etc/passwd 파일을 확인)
[root@localhost ~]# cat -n /etc/passwd ( 파일의 줄번호를 표시하며 출력)
[root@localhost ~]# cat >test (test라는 파일이 없으면 생성하며 글쓰기 가능)
가나다라 마바사
(내용을 저장 하기 위해서는 엔터를 사용 후 ctrl + c )
[root@localhost ~]# cat < test ( test 라는 파일 읽기 굳이 <안해도됨)
[root@localhost ~]# cat >> test (파일없을시 생성 글쓰기가능 파일이 있을경우 내용추가 가능)
아자차카 타파하
[root@localhost ~]# cat test (내용출력
가나다라 마바사
아자차카 타파하
[root@localhost ~]# cat >test1
1 2 3 4
[root@localhost ~]# cat test test1 >test2 (test2 에 test , test1 내용 합침 -구별잘할것)
[root@localhost ~]# cat test test1 >> test2 (test2에 test test 내용 병합 -구별잘할것)
<tail :파일의 밑에서 10줄 출력 >
[root@localhost ~]# tail /etc/passwd (10줄 출력)
[root@localhost ~]# tail -15 /etc/passwd (옵션으로 숫자를 넣으면 원하는 만큼 출력가능)
<head : 파일의 위에서 10줄 출력>
[root@localhost ~]# head /etc/passwd (10줄 출력)
[root@localhost ~]# head -15 /etc/passwd (옵션으로 숫자를 넣으면 원하는 만큼 출력가능)
<more : 창 크기 만큼 끊어서 보기>
[root@localhost ~]# more /etc/passwd
[root@localhost ~]# more -5 /etc/passwd (옵션으로 숫자를 넣으면 원하는 만큼 출력가능)
< | (\+shift) : 파이프 >
[root@localhost ~]# head -15 /etc/passwd | cat -n (위에 15줄 출력하며 줄번호)
[root@localhost ~]# cat -n /etc/passwd | more -4 (줄번호 출력 하며 4줄씩 끊어서 보기)
[root@localhost ~]# touch /test/123 | mkdir /test (/test/123 파일 생성 | /test 디렉토리 생성)
-조합하여 편리하게 사용가능-