console
문서의 이전 판입니다!
Console 도구
파일 검색
find {path} -name {filename} find /usr -name libcudnn.so
문서 꺼꾸로 출력
tac a.txt > b.txt # tac script.sh | bash # 꺼꾸로 실행
문서 내용 무작위 출력
cat a.txt | shuf # tac script.sh | shuf | bash # 무작위 실행
문자열 출력
cat {file} head {file} tail {file}
조건에 맞는 문자열 출력
cat {file name} | grep {pattern}
조건에 맞지 않은 문자열 출력
cat {file name} | grep -v {pattern}
줄 수 세기
cat {file} | grep {pattern} | wc -l
진행 속도 측정
cat {file} | grep {pattern} | tqdm --unit_scale | wc -l
다운로드
wget
웹페이지 접속
curl {address} [-silent]
unicode sparkline
https://rosettacode.org/wiki/Sparkline_in_unicode#Python http://www.leancrew.com/all-this/2011/05/textexpander-sparkline-snippet/
# -*- coding: utf -*- import re try: raw_input except: raw_input = input # Unicode: 9601, 9602, 9603, 9604, 9605, 9606, 9607, 9608 try: bar = u'▁▂▃▄▅▆▇█' except: bar = '▁▂▃▄▅▆▇█' barcount = len(bar) - 1 while True: line = raw_input('Numbers please separated by space/commas: ') numbers = [float(n) for n in re.split(r'[\s,]+', line.strip())] mn, mx = min(numbers), max(numbers) extent = mx - mn sparkline = ''.join(bar[int( (n - mn) / extent * barcount)] for n in numbers) print('min: %5f; max: %5f' % (mn, mx)) print(sparkline)
Console widget
- curses
- ncurses
- asciimatics
console.1511358861.txt.gz · 마지막으로 수정됨: 2024/03/23 02:37 (바깥 편집)