•
"glory"라는 이름의 폴더 생성
◦
mkdir glory
•
"glory"라는 폴더 안에 들어가고 싶을때
◦
cd glory
•
리눅스 서버에 있는 gpu 자원 1초마다 갱신하여 확인하기 (nvidia-smi를 실행하기 위한 패키지는 설치 되어있다고 가정하기)
◦
nvidia-smi -l 1
•
내 컴퓨터 주피터 노트북 실행 (다른 컴퓨터로 원격 접속하려면 다른 명령어 필요)
◦
(추천) jupyter notebook
◦
jupyter notebook --ip=0.0.0.0 --port=1032 --allow-root
•
외부 컴퓨터에서 다른 컴퓨터 ssh 접속하기 (전제조건 포트포워딩 : 1042 / 아이피 주소 : 100.100.100.100 / PC이름 : glory-dl / 양쪽 모든 PC에는 ssh 연결되어야 함)
◦
•
가상환경 리스트 확인하기 (아나콘다 설치가 되어있다는 전제 조건 하에)
◦
conda env list
•
가상환경 키기 (가상환경 이름이 glory)라고 가정
◦
conda activate glory
•
주피터 노트북 설치하기(아나콘다 설치가 되어있다는 전제 조건 하에)
◦
conda install jupyter notebook
•
"tf_gpu" 라는 가상환경을 "glory_gpu"라는 이름의 가상환경으로 복사하기
◦
conda create -n glory_gpu --clone tf_gpu
•
lsof 설치 명령어
◦
sudo apt-get install lsof
•
현재 실행중인 포트 목록 체크하기
◦
lsof -i
•
특정 포트(5000)에 대한 lsof 조회하기
◦
lsof -i 5000
•
PID가 1042인 포트 종료시키기
◦
kill -9 1042
•
현재 실행중인 웹서버들 중 특정하나(gloryglory.py)를 찾아 내어 종료하는 절차
◦
ps -ef | grep 'gloryglory.py'
(glory) l@smmcdl:~/glory/ltop_web/211130_test$ ps -ef | grep 'flask-live-chart.py'
smmc-dl 24113 12219 0 09:59 pts/39 00:00:00 python flask-live-chart.py
smmc-dl 24115 24113 0 09:59 pts/39 00:00:00 /home/l/anaconda3/envs/glory/bin/python /home/smmc-dl/glory/ltop_web/211130_test/flask-live-chart.py
smmc-dl 25067 12219 0 10:01 pts/39 00:00:00 grep --color=auto flask-live-chart.py
(glory) l@smmcdl:~/glory/ltop_web/211130_test$ kill -9 24113
(glory) l@smmcdl:~/glory/ltop_web/211130_test$ kill -9 24115
bash: kill: (24115) - No such process
[1]+ Killed python flask-live-chart.py
Python
복사
•
우분투에서 저장공관 확인하는 명령어 (저장용량)
◦
df -h
none 32G 2.3M 32G 1% /tmp/guest-rxkspg
tmpfs 6.3G 92K 6.3G 1% /run/user/999
tmpfs 6.3G 56K 6.3G 1% /run/user/1000
/dev/sdb2 1.4T 570G 817G 42% /media/sml/DATABASE
(base) sml@sml:/$
Python
복사
•
aaa.zip 파일 압축해제
◦
unzip aaa.zip
•
tar 압축
$ tar -cvf [파일명.tar] [폴더명]
# abc라는 폴더를 aaa.tar로 압축 예시
$ tar -cvf aaa.tar abc
Plain Text
복사
•
tar.gz 압축
$ tar -zcvf [파일명.tar.gz] [폴더명]
# abc라는 폴더를 aaa.tar.gz로 압축 예시
$ tar -zcvf aaa.tar.gz abc
Plain Text
복사
•
zip 압축
$ zip [파일명.zip] [폴더명]
# 현재폴더 전체를 aaa.zip으로 압축 예시
$ zip aaa.zip ./*
# aaa.zip으로 압축하고 현재 폴더의 모든 것과 현재 폴더의 하위 폴더들도 모두 압축 예시
$ zip aaa.zip -r ./*
# 위 명령어를 스크립트에서 실행할 때, 파일 경로가 전부 나올 수 있기 때문에 해당 폴더로 이동한 후 작업하는 것을 권장
Plain Text
복사
•
tar 압축해제
$ tar -xvf [파일명.tar]
# aaa.tar라는 tar파일 압축해제 예시
$ tar -xvf aaa.tar
Plain Text
복사
•
tar.gz 압축 풀기
$ tar -zxvf [파일명.tar.gz]
# aaa.tar.gz라는 tar.gz파일 압축 해제
$ tar -zxvf aaa.tar.gz
Plain Text
복사
•
zip 압축해제
$ unzip [파일명.zip]
# aaa.zip 압축 해제 예시
$ unzip aaa.zip
# 특정 폴더에 압축해제 예시
$ unzip aaa.zip -d ./target
Plain Text
복사
•
tar 명령어 자주쓰는 옵션
Show All
Search
안녕하세요
•
한국전자기술연구원 김영광입니다.
•
관련 기술 문의와 R&D 공동 연구 사업 관련 문의는 “glory@keti.re.kr”로 연락 부탁드립니다.
Hello
•
I'm Yeonggwang Kim from the Korea Electronics Research Institute.
•
For technical and business inquiries, please contact me at “glory@keti.re.kr”