본문 바로가기

분류 전체보기

(282)
[ 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..
[리눅스 쉘 스크립트 마스터] 01쉘기초명령어_10실행파일 실행 방법 4가지 홍영기님 리눅스 쉘 스크립트 마스터 강의 입니다. 실행파일을 실행하는 방법 4가지 1. PATH 환경변수에 등록된 /usr/bin 밑에 실행파일을 옮기고 이름만으로 실행한다. test@ykd2:~$ echo "echo -e 'hello world'" > hello.sh test@ykd2:~$ chmod +x hello.sh test@ykd2:~$ sudo mv hello.sh /usr/bin [sudo] password for test: test@ykd2:~$ hello.sh hello world 2. 현재 실행파일 경로를 PATH 환경변수에 등록 후 이름만으로 실행한다. test@ykd2:~$ PATH=$PATH:~ test@ykd2:~$ echo $PATH /usr/local/sbin:/usr/loc..
[리눅스 쉘 스크립트 마스터] 01쉘기초명령어_09while문 홍영기님 리눅스 쉘 스크립트 마스터 강의 입니다. while문 while do done 형태로 사용한다. while문 안에는 (( expression ))이 온다. do 문 다음에는 done을 선언하기 전까지 여러 라인을 서술해도 된다. test@ykd2:~$ no=1; while (( no < 10 )); do printf "%02d" $no; printf " is number\n"; (( no++ )); done 01 is number 02 is number 03 is number 04 is number 05 is number 06 is number 07 is number 08 is number 09 is number
[리눅스 쉘 스크립트 마스터] 01쉘기초명령어_08read사용법 홍영기님 리눅스 쉘 스크립트 마스터 강의 입니다. read명령어 사용자 입력값을 변수로 저장 test@ykd2:~$ read num 12345 test@ykd2:~$ echo $num 12345 문장을 출력 후 사용자 입력값을 변수로 저장 test@ykd2:~$ read -p "what is your phone number? : " v what is your phone number? : 010-9890-1111 test@ykd2:~$ echo $v 010-9890-1111 문장을 출력 후 사용자 입력값을 1글자로 제한하여 변수로 저장 test@ykd2:~$ read -n 1 -p "Are you man? : " v Are you man? : Ytest@ykd2:~$ test@ykd2:~$ echo $v Y
[리눅스 쉘 스크립트 마스터] 01쉘기초명령어_07printf사용법 홍영기님 리눅스 쉘 스크립트 마스터 강의 입니다. printf명령어 숫자인자를 받아 형식화된 출력 test@ykd2:~$ printf "%02d\n" 5 05 test@ykd2:~$ printf "%05d is \n" 5 00005 is name 변수에 michael값 저장 printf -v 로 legend변수에 형식화된 값 저장 test@ykd2:~$ name=michael test@ykd2:~$ printf -v legend "%s jackson" $name test@ykd2:~$ echo $legend michael jackson
[리눅스 쉘 스크립트 마스터] 01쉘기초명령어_06alias사용법 홍영기님 리눅스 쉘 스크립트 마스터 강의 입니다. alias 명령어 mkdir만 입력해도 mkdir -p가 되도록 alias 설정 test@ykd2:~$ alias mkdir='mkdir -p' test@ykd2:~$ mkdir aaa/bbb test@ykd2:~$ tree aaa aaa └── bbb 1 directory, 0 files alias목록 조회 및 alias삭제 test@ykd2:~$ alias alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' al..
[리눅스 쉘 스크립트 마스터] 01쉘기초명령어_05tail사용법 홍영기님 리눅스 쉘 스크립트 마스터 강의 입니다. tail명령어 마지막 10라인 출력 test@ykd2:~/shell_cmd$ seq 1 200 > num200 test@ykd2:~/shell_cmd$ tail -n 10 num200 191 192 193 194 195 196 197 198 199 200 191라인부터 마지막까지 출력 test@ykd2:~/shell_cmd$ tail -n +191 num200 191 192 193 194 195 196 197 198 199 200 101라인부터 출력하는데 위에 10라인, 즉 101부터 110까지 출력 test@ykd2:~/shell_cmd$ tail -n +101 num200 | head -n 10 101 102 103 104 105 106 107 108..