반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- Replication
- join #postgresql #sql #database
- glossary #database #termins #postgresql #postgresql_architecture
- postgresql_fdw
- streaming_replication
- linux #filesystem #linuxdirectory
- network #network_terminology #network_protocols
- dbms
- SQL_basic
- inux #ome_dir #unix #linux_commands #linux_useradd #useradd
- data_oid
- repmgr #postgresql #replication #HA
- postgresql #system_memory #local_memory #shared_memory #postgresql_architecture
- Network #TCP #IP #Netmask #Host
- Linux #linux_tar #split
- SQL_COMMANDS #DDL #DML #TCL
- postgresql #pgadmin #port #firewalld
- EDB
- postgresql
- High_Availability
- postgresql #vacuum #full_vacuum #verbose
- SQL #NULL #NOT_NULL
- oid2nae #postgresql
- the_one_thing
- SQL_VIEW #SQL #VIEW
- one_thin
- chatgpt3 #AI #datascience
- RAM #CPU #CS #Computer_Science #Terms
- Database
- database #dbms #objects #sql #schema #table #functions
Archives
- Today
- Total
i am lazy
Linux grep command 본문
728x90
반응형
Linux grep이란 ?
리눅스에서 grep 명령어는 특정 파일에서 지정한 문자열이나 정규표현식을 포함한 행을 출력해주는 명령어입니다.
grep [option] [pattern] [file name]
Example:
1) 파일에서 텍스트 찾기
grep " my blog" test.text
2) 대소문자 구분 무시
grep -i "I" test.text
-i --ignore
3) 패턴 수 세기
ps -ef | grep -c edb
-c --count
4) 출력 라인으로 라인 번호 인쇄
cat /etc/passwd | grep -n enterprisedb
-n --line-number
자주 사용하는 옵션:
-c : 일치하는 행의 수를 출력한다.
-i : 대소문자를 구별하지 않는다.
-v : 일치하지 않는 행만 출력한다.
-n : 포함된 행의 번호를 함께 출력한다.
-l : 패턴이 포함된 파일의 이름을 출력한다.
-w : 단어와 일치하는 행만 출력한다.
-x : 라인과 일치하는 행만 출력한다.
-r : 하위 디렉토리를 포함한 모든 파일에서 검색한다.
-m 숫자 : 최대로 표시될 수 있는 결과를 제한한다.
-E : 찾을 패턴을 정규 표현식으로 찾는다.
-F : 찾을 패턴을 문자열로 찾는다.
728x90
반응형
'Linux' 카테고리의 다른 글
Linux userdel command (1) | 2022.10.04 |
---|---|
Linux user home directory 변경 (0) | 2022.10.04 |
Linux chown command (1) | 2022.10.04 |
Linux mkdir command (0) | 2022.10.03 |
Linux file copy command (2) | 2022.09.30 |
Comments