본문 바로가기

Infra Architecture

(34)
[ Shell Script ] grep 명령어 옵션 -o 매칭되는 문자열만 출력하는 걸 쓰려했는데 awk로 해결했었음. -E 정규식으로 검색하려면 이걸로 해야됨. grep [OPTION...] PATTERN [FILE...] -E : PATTERN을 확장 정규 표현식(Extended RegEx)으로 해석. -F : PATTERN을 정규 표현식(RegEx)이 아닌 일반 문자열로 해석. -G : PATTERN을 기본 정규 표현식(Basic RegEx)으로 해석. -P : PATTERN을 Perl 정규 표현식(Perl RegEx)으로 해석. -e : 매칭을 위한 PATTERN 전달. -f : 파일에 기록된 내용을 PATTERN으로 사용. -i : 대/소문자 무시. -v : 매칭되는 PATTERN이 존재하지 않는 라인 선택. -w : 단어(word) 단위로..
[ Linux ] 윈도우와 리눅스의 줄바꿈 차이 리눅스에서는 줄바꿈을 LF(Line Feed) 로만 하지만 윈도우에서 만들어진 문서의 줄바꿈은 CR(carriage return) + LF(Line Feed)로 한다. LF는 16진수로 0A , CR은 16진수로 0D 이다. test@ykd2:~$ cat hello_echo.txt hello test@ykd2:~$ cat hello_ms.txt hello test@ykd2:~$ hexdump -C hello_echo.txt 00000000 68 65 6c 6c 6f 0a |hello.| 00000006 test@ykd2:~$ hexdump -C hello_ms.txt 00000000 68 65 6c 6c 6f 0d 0a |hello..| 00000007
[ Linux ] 리눅스에서 16진수로 출력(hexdump) hexdump명령어 hexdump -C 파일이름 을 하면 16진수와 아스키코드 모두를 출력한다. test@ykd2:~$ cat hello_echo.txt hello test@ykd2:~$ hexdump -C hello_echo.txt 00000000 68 65 6c 6c 6f 0a 0a |hello..| 00000007 test@ykd2:~$
[ cmd ] cmd에서 sftp로 파일 전송 cmd에서 sftp로 파일 전송 sftp userid@IP 형태로 접속 후 put 파일이름을 통해 전송 D:\>dir | find "hello" 2023-01-05 ?ㅽ썑 05:11 7 hello_ms.txt D:\>sftp test@192.168.219.114 test@192.168.219.114's password: Permission denied, please try again. test@192.168.219.114's password: Connected to 192.168.219.114. sftp> put hello_ms.txt Uploading hello_ms.txt to /home/test/hello_ms.txt hello_ms.txt
[ cmd ] 특정 명령어 도움말 보기 help 특정명령어 도움말 보기 명령어 /? D:\>find /? Searches for a text string in a file or files. FIND [/V] [/C] [/N] [/I] [/OFF[LINE]] "string" [[drive:][path]filename[ ...]] /V Displays all lines NOT containing the specified string. /C Displays only the count of lines containing the string. /N Displays line numbers with the displayed lines. /I Ignores the case of characters when searching for the string. /OFF[LI..
[ Linux ] Ubuntu 버전 확인 /etc/issue파일에서 리눅스 버전을 확인할 수 있다. test@ykd2:~$ cat /etc/issue Ubuntu 22.04.1 LTS \n \l
[ Linux ] vi editor 사용법정리 1. number링 하기 명령문 모드에서 set nu
[ Infra linux ] linux에 xwindow 설치 - 설치 $apt-get install ubuntu-desktop - 실행 $ startx