목록컴퓨터/Shell (5)
저항하는 것

미디어위키(MediaWiki)를 윈도우 wsl2 환경에서 설치하는 과정을 기록합니다. 설치 방법 1. 아래 명령대로 실행 # 패키지 설치 sudo apt install apache2 composer git git-review imagemagick mysql-client mysql-server php php-apcu php-cli php-gd php-intl php-mbstring php-mysql php-xml zip # mysql, apache2 서비스 기동 sudo service mysql start sudo service apache2 start sudo mysql 2. MySQL에서 다음 명령대로 실행함 [아이디]는 추가할 사용자 ID를, [패스워드]는 사용자 ID에 대한 패스워드를, [데이터베이..
맥 OS의 파인더(Finder)에서 생성되는 임시 파일인 .DS_Store 파일을 터미널에서 일괄적으로 지우는 스크립트입니다. 맥 OS 및 리눅스에서 동작합니다. find . -name ".DS_Store" -depth -exec rm {} \;
Bash를 이용하여 iconv로 특정 인코딩을 변경하는 방법 (예: UHC에서 UTF-8로 변경) xargs도 사용해 보려고 하였지만, replacement symbol (-I{}에 해당하는 {})이 다중 파일에 대해서 적용이 안 되는 모양이다. find *.list -exec bash -c 'iconv -c -f uhc -t utf-8 {} > {}.out' \; 관련 링크 http://bahndal.egloos.com/577448 https://hyeonseok.com/soojung/dev/2016/06/27/796.html
bash의 sed를 이용하여 각 단어에 html 등의 태그를 다음과 같이 달 수 있다. 예) 단어1 단어2 단어3 -> 단어1 단어2 단어3 cat INPUT | sed -e 's/ / /g' -e 's/^//g' -e 's/$//g' -e 's/^$//g' > OUTPUT
Youtube 영상을 shell script로 실행하는 명령어 youtube-dl 사용법 # youtube-dl download sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl sudo chmod a+rx /usr/local/bin/youtube-dl youtube-dl [URL]# download video clip youtube-dl --write-auto-sub --sub-lang ko --skip-download [URL]# download Korean (auto-generated) subtitle without clip youtube-dl -x --audio-format wav [URL]..