본문 바로가기

linux20

grep (패턴 맞춤 출력 명령) 00 개요grep 명령어는 텍스트 검색 기능을 가진 명령어즉, 파일에서 특정 패턴을 검색하는 데 사용되는 강력한 도구로, 리눅스/유닉스 환경에서 주로 활용됨개발자나 시스템 관리자는 로그 파일 분석, 대규모 텍스트 데이터 처리 등 다양한 작업에서 효율적으로 grep를 사용해 데이터를 검색할 수 있음다음은 grep 명령어의 정의, 기능, 문법, 및 다양한 옵션들에 대한 정리01  grep 명령어란1. grep 정의"global regular expression print"의 약자텍스트 파일 내 정규 표현식 (Regular Expression)이나 단어를 기반으로 패턴을 찾아 출력하는 명령어grep을 활용하여 파일에서 특정 패턴이 포함된 줄을 빠르게 검색 가능2. grep 명령어 기능텍스트 검색: 파일 내에서.. 2024. 10. 17.
readlink (심볼릭 파일 경로 읽는 명령어) 00 개요회사 내에서 작성한 코드에 이 명령어가 나와서 찾아봄!01 readlink 명령어란1. readlink 정의'reads the link'2. readlink 명령어의 기능심볼릭 링크 (바로가기 버튼이 실질적으로 참조하는 경로 같은 개념) 또는 캐노니컬 파일 이름을 출력3. readlink 명령어 문법readlink [OPTION]... FILE02 readlink 명령어 옵션1. 옵션 종류옵션설명--canonicalize,-fcanonicalize by following every symlink in every component of the given name recursively.all but the last component must exist.--canonicalize-existing,-e.. 2024. 6. 5.
dirname (파일 이름 제거 명령어) 00 개요shell script에서 많이 등장!!01 dirname 명령어란1. dirname 정의'directory name'2. dirname 명령어의 기능파일이름의 마지막 요소를 제거하여 출력즉, 인자로 주어진 파일명의 마지막 /-없는 요소를 출력하고 (끝에 /가 붙어있다면 그것도 제거)파일명에 /가 미포함이라면 (현재 경로를 뜻하는) .를 반환 3. dirname 명령어 문법# dirname [OPTION] NAME ... 예시# dirname /Desktop/root/bash.sh/Desktop/root# dirname /dir1/str dir2/strdir1 dir2# dirname stdio.h. 02 dirname 명령어 옵션1. 옵션 종류옵션설명--zero,-zseparate output.. 2024. 6. 4.
netstat (네트워크 명령어) 00 개요참 많이 쓰는 명령어, 데몬들 떠있는지 확인 할 때에도 사용되고 여러가지로 참 많이많이 사용되는 명령어라서 기록하지 않을 수가 없었음01 netstat 명령어란1. netstat 정의'network statistics'의 약자네트워크 통계2. netstat 명령어 기능네트워크 연결, routing tables, interface statistics, masquerade connections, and multicast memberships을 출력리눅스 네트워킹 서브시스템(Linux Networking Subsystem) 정보 출력netstat 다음으로 오는 인자에 따라 어느 정보를 출력할지 결정됨Note: This program is obsoleteReplacement: netstat → ss, .. 2024. 6. 4.
dialog (dialog 박스 시각화 패키지) 00  개요리눅스 환경에서 VERTICA를 설치할 때 yum install dialog로 dialog라는 패키지를 설치하였는데, 이 dialog 패키지가 정확히 어떤 것을 하는 것인지에 대해 알아보고자 한다 01 dialog 패키지란리눅스 환경에서 yum install dialog로 dialog를 설치할 수 있다1. 정의dialog는 리눅스 환경에서 console 기반으로 dialog를 만들기 위한 utility package"display dialog boxes from shell scripts" (man dialog)이를 통해 shell script에서 다양한 dialog 구성 가능기능: buildlist, calendar, checklist, dselect, editbox, form, fselect.. 2024. 5. 10.
exportfs (nfs을 export/unexport하는 명령어) 01 exportfs란1. 정의NFS (Network File System) 파일 시스템을 내보내는(export) 테이블을 관리(maintain)하는 명령어로컬 디렉토리를 NFS 클라이언트가 마운트할 수 있게 함2. 문법/usr/sbin/exportfs [-avi] [-o options,..] [client:/path ..]/usr/sbin/exportfs -r [-v]/usr/sbin/exportfs [-av] -u [client:/path ..]/usr/sbin/exportfs [-v]/usr/sbin/exportfs -f 3. 설명An NFS server maintains a table of local physical file systems that are accessible to NFS clien.. 2024. 5. 2.
chkconfig (실행 프로그램 설정 도구) 00 개요문서 작성 목적: 서비스를 실행하는 shell script (si-service.sh)에서 윗 칸에 # chkconfig 2345 20 80 라고 적혀있는데 이것이 무엇을 의미하는지 알고자 함01 chkconfig란1. 정의updates and queries runlevel info for system services명령어로 사용되거나 .init 또는 .sh 등의 파일 윗부분에 설정하여 사용 가능2. 문법name = 서비스명chkconfig [--list] [--type type][name]chkconfig --add namechkconfig --del namechkconfig --override namechkconfig [--level levels] [--type type] name chkco.. 2024. 4. 30.
unzip (압축 파일 해제 명령어) 00 개요리눅스 환경 터미널에서 .zip 압축 파일을 풀 수 있음01 unzip이란1. 정의lists and extracts files in zip archives.기본값으로 extracts zipfile entries to the current directory, creating directories as neededZip files do not store ownership info The extracted files are owned by the user that runs the commandYou must have write permissions on the directory where you are extracting the ZIP archive.2. 문법# 기본 문법unzip [-Z] optio.. 2024. 4. 29.
nohup (터미널 끊겨도 proc 진행 시키는 명령어) 01 nohub이란1. 정의리눅스에서 프로세스 (process, proc)를 실행한 터미널 (terminal, tty)의 세션 연결이 끊어지더라도 프로세스를 계속해서 동작시키는 명령어 원래 리눅스에서는 터미널에서 ssh 세션 로그아웃(logout) 발생 시 해당 터미널에서 실행한 프로세스들에게 HUP signal을 전달하여 종료시키게 되는데 이 HUP signal을 프로세스가 무시(ignore)하도록 하고 프로세스들을 마치 데몬(daemon)인 것처럼 동작시키는 명령어라서 nohup 이라고 명명또한 nohup 명령어로 인해 백그라운드에서 실행된 프로세스들의 표준 출력(standard output)은 nohup.out 파일로 재지향(redirection)됨터미널이 종료되어도 표준 출력은 nohup.out .. 2024. 4. 29.