-
최신 글
- VSCode 사설망 원격 개발 구성 2022년 3월 3일
- 유럽 50개국 수도와 공용어 2022년 2월 15일
- 태극기의 의미를 알아보자 2022년 2월 14일
- Dev Lee의 프로그래밍 초급 강의 – 2 2022년 2월 13일
- [ICT 기본지식] Bit, Byte, IP 란? 2022년 2월 13일
최신 댓글
글 목록
- 2022년 3월 (1)
- 2022년 2월 (6)
- 2021년 8월 (1)
- 2021년 2월 (4)
- 2021년 1월 (9)
- 2020년 12월 (8)
- 2020년 11월 (7)
- 2020년 10월 (2)
- 2020년 9월 (8)
- 2020년 8월 (4)
- 2020년 6월 (1)
- 2020년 5월 (15)
- 2020년 4월 (40)
- 2020년 3월 (2)
- 2019년 7월 (2)
- 2019년 6월 (4)
- 2019년 5월 (4)
- 2019년 4월 (8)
- 2019년 3월 (18)
- 2019년 2월 (19)
- 2019년 1월 (1)
- 2018년 7월 (1)
- 2018년 6월 (55)
- 2018년 5월 (14)
- 2018년 4월 (27)
- 2018년 3월 (13)
- 2017년 12월 (5)
- 2017년 11월 (21)
- 2017년 10월 (2)
- 2017년 9월 (1)
- 2016년 12월 (2)
- 2016년 10월 (1)
- 2016년 9월 (3)
- 2016년 8월 (2)
- 2016년 7월 (1)
- 2016년 5월 (2)
- 2016년 4월 (2)
- 2016년 3월 (9)
- 2016년 2월 (10)
- 2016년 1월 (6)
- 2015년 12월 (8)
- 2015년 11월 (5)
- 2015년 10월 (2)
- 2015년 9월 (33)
카테고리 보관물: sh
[bash] 반올림 하기
bash shell 에서 소수점 반올림 하는 방법을 소개합니다. 아주 간단하기 때문에, 아래 예시만 보면 해결이 되실 겁니다. 짧은 포스팅을 마치며, 이글이 누군가에게 도움이 되기를 바랍니다.
카테고리: bash, ICT, Language, sh
태그: bash, bash 반올림, bash 반올림 하기, bash 반올림하기, bash 소수점 반올림, 반올림, 소수점 반올림, shell, shell 반올림, shell 반올림 하기, shell 반올림하기, shell 소수점 반올림
댓글 남기기
[bash] how to split a string with a delimiter
You can split a string with a delimiter, as the command below. string=”This is a test string” delimiter=’ ‘ IFS=$delimiter read -ra result <<< “$string” result_cnt=${#result[@]} for (( i=0; i<$result_cnt; i++ )) do echo “${result[$i]}” done Output
[리눅스] RHEL (Red Hat Enterprise Linux) 버전 확인
RHEL 버전 확인 명령어 cat /etc/redhat-release
[bash] How to round floating point numbers
Use the round function, as the command below. #!/bin/bash round() { echo $(printf %.$2f $(echo “scale=$2;(((10^$2)*$1)+0.5)/(10^$2)” | bc)) }; test=6.6666 echo $(round $test 0) # output : 7 echo $(round $test 1) # output : 6.7 echo $(round $test 2) … 계속 읽기
[bash] How to insert a string into a text variable at specified position
To insert a string into the variable ‘text’ at position ‘p’, refer to the command below. p=5 text=”text variable” text=”${text:0:p}a string${text:p}”
du 명령어
디렉토리 별로 사용하고 있는 용량을 체크하고 싶을 땐 ‘du’ 명령어를 사용하면 되는데요 아래와 같은 두 형태로 많이 사용됩니다. 🙂 현재 디렉토리에서 사용하고 있는 총 용량을 확인하고 싶을 땐 du -sh 현재 디렉토리에서 각 폴더 별로 사용하고 있는 용량을 확인하고 … 계속 읽기
Setup default umask under linux
리눅스에서 파일이나 디렉토리를 생성 하면 당연하게도 일정한 권한이 생기게 된다. 그런데 어떻게 항상 똑같은 권한으로 파일 혹은 디렉토리가 생성되는 것일까? 그 이유는 바로 umask에 있다. umask 명령어 위와 같이 umask 명령어를 사용해 보면 002, 022 등의 값을 확인할 수 있을 … 계속 읽기
how to find process from port number
특정 포트 number에 해당하는 프로세스를 찾아내는 방법에 대해 포스팅 하겠습니다. 아래의 명령어를 통해 해결하면 됩니다. netstat -anp tcp | grep portNumber OSX EI Capitan이나 netstat이 -p 옵션을 지원하지 않는 경우에는 lsof 명령어로 해결 하면 됩니다. lsof -i tcp:portNumber
how to find date of the most activity in log file
로그 파일을 분석해 가장 접근(트래픽)이 많았던 날짜를 산출하는 방법에 대해 포스팅 하겠습니다. 아래는 로그 파일의 포맷 예입니다. 2015-11-26 19:04:20 2.2.2.2 GET /bdgdb/file_manager.php action=download&filename=cc.php 443 – 1.1.1.1 Mozilla/5.0 (Windows NT 6.1; WOW64; rv:42.0) Gecko/20100101 Firefox/42.0 – 200 0 0 15 … 계속 읽기