본문 바로가기

Linux/Shell13

[macOS] sed -i 에러 sed: 1: "/etc/hosts": extra characters at the end of d command 발생 macOS에서 sed -i를 사용하여 파일안에 있는 문자를 치환하려 하는 경우, 아래와 같이 하면 작동하지 않는다. sed 's/foo/bar/g' file 해결 방법 # BSD/macOS sed sed -i '' 's/foo/bar/' # GNU sed (대부분의 Linux) sed -i 's/foo/bar/g' BSD/macOS sed가 정상적으로 작동하지 않는 케이스들 **sed -i 's/foo/bar/' file # Breaks; script is misinterpreted as backup-file suffix sed -i'' 's/foo/bar/' file # Ditto se.. 2021. 2. 24.
man signal (mac os, 파파고 번역) NAME sigal - 단순화된 소프트웨어 신호 설비 LIBRARY 표준 C 라이브러리 (libc, -lc) SYNOPSIS #include void (*signal(int sig, void (*func)(int)))(int); or in the equivalent but easier to read typedef'd version: typedef void (*sig_t) (int); sig_t signal(int sig, sig_t func); DESCRIPTION 이 signal() 설비는 보다 일반적인 sigaction(2) 설비에 대한 단순화된 인터페이스이다. 신호는 도메인 외부에서 온 프로세스를 조작할 수 있을 뿐만 아니라 프로세스가 자체 또는 자신(자녀)의 복사본을 조작할 수 있도록 합니다. 두.. 2021. 2. 6.
tmux - alias, sh를 이용하여 편리하게 사용하기 alias 등록하기 (https://sondho.tistory.com/44) # tmux alias t='tmux' alias tn='~/git/my-settings/my-sh/tmux/tmux_new_name.sh' alias ta='tmux a #' alias tan='~/git/my-settings/my-sh/tmux/tmux_a_t_name.sh' alias tl='tmux ls' alias tk='~/git/my-settings/my-sh/tmux/tmux_kill-session.sh' tmux a # 세션을 재연결하는 명령어 a는 attach를 뜻함 #는 특정 세션번호를 뜻하는 와일드카드. 사용자가 명시적으로 세션번호를 입력하지 않아도 가장 최근에 사용한 세션을 자동으로 찾아서 연결합니다. t.. 2021. 1. 22.
맥 os - SSH환경에서 화면 분할하기 (tmux) brew 설치 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" tmux 설치 brew install tmux tmux 명령어 tmux a # : attach. 터미널 -> tmux. attach. 터미널 -> tmux. dettach시킨 tmux로 이동 > tmux a # tmux ls : 현재 실행중인 세션 일람 > tmux ls tmux kill-session -t 세션이름 : 세션 강제 종료 > tmux kill-session -t 세션이름 tmux 단축키 ※ ctrl + b 누른 뒤, 다음 키 눌러야함. 동시에 누르면 안됨. (ctrl + b) -> % : 패널 세로 나누기 .. 2021. 1. 22.