당당한 프로그래밍 19

[Python] 올림, 내림, 반올림

올림 import math math.ceil(-3.33) # -3.0 math.ceil(3.33) # 4.0 내림 import math math.floor(-3.33) # -4.0 math.floor(3.33) # 3.0 int(-3.33) # -3 int(3.33) # 3 math.trunc(-3.33) # -3 math.trunc(3.33) # 3 반올림 # Python 2.7.16 round(4.5) # 5.0 round(5.5) # 6.0 round(4.55, 1) # 일의 자리까지 나타냄. 둘째 자리에서 반올림. # 4.5 round(4.65, 1) # 4.7 ###################################### # Python 3.7.3 round(4.5) # 4 round(5..

[리눅스] find 명령어 사용법

자주쓰는 명령어 정리 find [Path] [Expression] -name : 이름으로 찾기 find ./ -name "*.csv" find ./ -name "2021*" -empty: 크기 0인 파일 찾기 find ./ -empty -delete: 찾은 파일 지우기 find ./ -name "abc.log" -delete -exec : 찾은 파일에 명령어 실행하기 find ./ -name "abc.log" -exec wc {} \; find ./ -name "abc.log" -exec rm {} \; -size : 크기로 파일 찾기 find ./ -size +1024c #(1024바이트 보다 큰 파일 찾기) find ./ -size -1024M #(1024메가바이트 보다 작은 파일 찾기) find ...

mac에서 iTerm2 디렉토리 및 파일 색상 변경하기

LSCOLORS 사용하기 ".bashrc_profile" 수정을 통해서 색상 적용이 가능하다. cd ~ vi .bash_profile .bash_profile 안에서 아래와 같이 추가하면 된다. export LSCOLORS="EHfxcxdxBxegecabagacad" alias ls='ls -G' 첫 번째 라인의 LSCOLORS는 항목별 색상 정보를 나타내며, 총 22개의 캐릭터로 구성된다. 두 개의 캐릭터(Foreground, Background)가 한 개의 속성 색상을 의미한다. 속성과 색상 정보는 아래와 같다. # 속성 정보 1. directory 2. symbolic link 3. socket 4. pipe 5. executable 6. block special 7. character specia..