본문 바로가기
반응형

Programming/Linux6

Unzip 'End-of-central-directory signiture not found' 압축해제 오류 $ unzip ftp_PUB_20-02-26_12-49-08.zip Archive: ftp_PUB_20-02-26_12-49-08.zip End-of-central-directory signature not found. Either this file is not a zipfile, or it constitutes one disk of a multi-part archive. In the latter case the central directory and zipfile comment will be found on the last disk(s) of this archive. note: ftp_PUB_20-02-26_12-49-08.zip may be a plain executable, not an archiv.. 2022. 10. 5.
Linux 파일명에서 dash(-) 지우기 ➜ ls -al total 43376 -rw-r--r-- 1 user staff 977K 11 17 15:34 -dab -rw-r--r-- 1 user staff 977K 11 17 15:34 -dac -rw-r--r-- 1 user staff 977K 11 17 15:34 -dad -rw-r--r-- 1 user staff 977K 11 17 15:34 -dae -rw-r--r-- 1 user staff 977K 11 17 15:34 -daf -rw-r--r-- 1 user staff 977K 11 17 15:34 -dag -rw-r--r-- 1 user staff 977K 11 17 15:34 -dah -rw-r--r-- 1 user staff 977K 11 17 15:34 -dai -rw-r--r-.. 2022. 10. 5.
Shell 따옴표 처리 (quote escape) 1. 큰 따옴표 (Double Quote) 쉘에서 " 표기. $ echo "My Name is \\"Apple\\"" 같은 큰따옴표 사용 시 \\ 활용 $ echo 'My Name is "Apple"' 따옴표 ' 사용 시 그대로 큰따옴표 표기 2. 따옴표 (Single Quote) 쉘에서 ' 사용 방법. $ echo "It's a pencil" 큰 따옴표 내에는 그대로 표기 $ echo 'It'\\''s a pencil' 같은 따옴표 표기 시 '\\'' 사용. 참고 https://stackoverflow.com/questions/32122586/curl-escape-single-quote 2022. 10. 5.
iTerms2 ssh session 공유를 통한 자동 로그인 Mac 환경에서 iTerms 터미널 ssh 접속후 새 창을 띄워서 다시 작업해야하는 경우 다시 로그인해야하는 불편함이 있다. 창을 n개로 분할하여 동시에 command를 입력하는 경우에는 더더욱 로그인 과정이 번거로운데 ssh session 공유를 통해 자동 로그인을 해보자. iTerms2 메뉴 > Profiles > Open Profiles 창에서 Edit Profile 선택 좌측하단 + 버튼으로 profile 추가 Command > command 선택 후 ssh -A -p 22 {접속할 connection 정보} 를 입력 Working Directory > Reuse previous session's directory Mac 홈디렉토리에서 .ssh 설정 cd .ssh vim config host * .. 2022. 10. 5.
[Shell] wget 명령어로 FTP 파일 or 폴더 다운로드 외부 FTP에 있는 파일들을 Linux 서버로 다운로드 받아야하는 상황이다. 구현 방법에는 여러가지가 있지만 wget 명령어를 통해 특정 파일 또는 디렉토리에 있는 파일들을 한 번에 받는 방법이 있다. 특정 파일 다운로드 wget --user={username} --password={password} ftp://{host}/{directory_path}/{file_path} -O {download_path} # Example (FTP경로 /picture/20211015/01.jpg 파일 다운로드하는 경우) wget --user=user1 --password=test1234 ftp://111.222.333.444/picture/20211015/01.jpg -O ~/download/01.jpg 특정 폴더 내.. 2021. 10. 15.
[Linux/shell] find 명령어 정리 Linux 기반의 시스템에서 사용할 수 있는 커맨드 중 하나로 특정 Directory에서 원하는 파일을 찾을 수 있는 기능이다. 파일 단위로 뭔가를 다루기 위해서는 반드시 알아야 하는 커맨드 중 하나이다. 다양한 옵션을 제공하기 때문에 잘 활용하면 원하는 파일들의 목록을 가져올 뿐만 아니라 찾은 파일들로 추가로 작업 할 수도 있다. 기본적인 사용법부터 알아가보자. 커맨드의 사용법을 알기 위해서는 find --help나 man find 를 통해 사용법을 알 수 있다. $ man find NAME find - search for files in a directory hierarchy SYNOPSIS find [-H] [-L] [-P] [-D debugopts] [-Olevel] [path...] [expre.. 2020. 5. 26.