본문 바로가기

Programming/Bash

if you want to split a large csv file into several smaller ones, just use 'split' in shell. I have a large csv file(10Gb). But it's too large to process on a program. There is a way to solve this problem. You can use bash command 'split'. Just take a look at an example below. $ split -l 100 data.csv this command will separate data.csv into every 100 lines with a lot of files. It's so simple. 더보기
[BASH] Make multiple screenshots into one image(tile, mosaic) by using ffmpeg To make multiple screenshots and place them into a single image file (creating tiles), you can use FFmpeg's tile video filter, like this:ffmpeg -ss 00:00:10 -i movie.avi -frames 1 -vf "select=not(mod(n\,1000)),scale=320:240,tile=2x3" out.png That will seek 10 seconds into the movie, select every 1000th frame, scale it to 320x240 pixels and create 2x3 tiles in the output image out.png, which will.. 더보기
관리자권한으로 cron 설정하기. It's easy to use. If you want to run cron job as super user(administrator), follow the below command. sudo crontab -eAdd just 'sudo' before crontab. It'll work on your system. 더보기
How to check the length of a media file on bash - bash 를 이용한 동영상 파일 길이 알아내기. There are several methods to do that. I'd like to post one of the easiest way how I can find out the length of a video(media) file by using. First of all, you need to install 'FFMPEG' with homebrew on mac (if you are using it). if you don't know how to install homebrew on MAC, you can check it on my blog link below [MAC TIP] Mac에 Homebrew 설치하기 Here we go~, Something similar to:ffmpeg -i input 2>.. 더보기
나만의 유튜브 영상 다운로더 by using bash YOUTUBE DOWNLOADER 만들기 원도우즈를 사용하거나, 맥, 하물며 리눅스를 사용하는 유저들을 위한 유튜브 동영상 다운로드 유틸은 널려있다. 그러나 일부는 유료이고, 또 어떤 프로그램은 잘 작동하는 듯 하더니, 예기치 않은 오류나 에러를 뱉어내곤하여 사용자들로 하여금 불만의 목소리를 듣곤한다. 이번에는 CLI(Command Line Interface)를 이용해 누구나 쉽게 유튜브에 올라와 있는 동영상을 자신의 컴퓨터로 다운받을 수 있는 방법을 알아보고자 한다. 우선 설명은 맥(MAC) 기준으로 설명을 하려고 한다. 그러나 리눅스는 물론이거니와 윈도우즈 사용자도 크게 다르지 않으니 쉽게 익힐 수 있는 방법이다.1. 준비 맥을 사용하는 사용자라면 Spotlight Search 를 눌러 'termin.. 더보기
[BASH] 기본 BASH 업그레이드 및 활용하기 맥에 기본으로 깔려 있는 bash 를 업그레이드 해 보려고 한다. 우선 현재 깔려 있는 bash 버전을 확인해 보았다. 3.2.57 버전이 기본으로 맥에 깔려 있다.그럼 bash 를 왜 업그레이드 해야 할까?대부분의 이용자에게 별 문제없는 기능중 하나일 것이다. 그렇지만 터미널을 많이 사용하는 이들에겐 최신 bash 기능이 없을때 아쉬울 수가 있다. 그 중 bracket expansion 기능을 알아보자. {} 문자를 이용해서 범위를 지정할 수 있는 기능이다. {시작..끝} 이렇게 범위를 지정해서 사용하면 알아서 채워준다. 이와 같은식으로 사용할 수 있다. 어디에 활용할 수 있을까? 파일 이름에 숫자가 이어지는 파일을 한 50개 만들고 싶다고 한다면 아래와 같이 하면 된다. 맥에 기본으로 깔려 있는 ba.. 더보기
[Bash] Photos, Files auto sorting script on Windows,Linux,Mac by dates setlocal enabledelayedexpansion set /p input=Enter the target directory:%=% set RawData=!input!\*.* set target_folder=x:\ for %%a in ("%RawData%") do ( echo Processing %%~nxa ... set File=%%~fa for /f "tokens=1* delims=," %%a in ('wmic datafile where "name='!File:\$ echo %%~nxa: !LastModified! set cYear=!LastModified:~0,4! set cMonth=!LastModified:~4,2! set cDay=!LastModified:~6,2! set TimeStamp.. 더보기