본문 바로가기
Bioinformatics &c/Linux & Python

[Linux] guide_ssh

by 이모모 2022. 12. 28.
728x90
반응형

[ Jupyter notebook 실행 ]

Bash 실행 > cd target_folder > jupyter notebook > connect by Internet
Jupiter 단축키 설명 > https://kkokkilkon.tistory.com/151

[ bash로 macpro 연결하기 ]

Macpro1: ssh -p 20022 xxx@xxx.iptime.org

tmux new -s user > 처음에만 만들면 됨.
tmux attach -t user > 들어가는것
ctrl+B > tmux 모든 명령의 기본
+d : 나가기
+c : create window
+n : next window
+p : previous window
+& : kill window

## warning message ##

FYI after wiping the MacPro, if you reconnect to Macpro1 via ssh, you might get an error like this

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY! 

In that case just navigate to cd .ssh in your home directory and remove the file rm known_hosts and it will work again~

[ 공용 macrpo에 있는 파일을 개인 macrpo로 옮기기 ]

개인 컴퓨터 bash에서 실행해야함! (공용 macpro에 bash로 접속하고 명령어 치면 안됨.)
/Volumes/xxx/Projects/Projects_xxx/xxx/ 폴더를 /Users/개인/xxx/ 로 옮기기

scp -r -P 20022 macpro@xxx.iptime.org:/Volumes/drobo3/Projects/xxx /Users/xxx/xxx/

[ 개인 macrpo에 있는 파일을 공용 macrpo로 옮기기 ]

개인 컴퓨터 bash에서 실행해야함! (공용 macpro에 bash로 접속하고 명령어 치면 안됨.)
/Users/xxx/xxx/Computer/samtools/sample/ACC 폴더를 macpro2@xxx.iptime.org:/Volumes/xxx/Projects/ 로 옮기기

scp -r -P 30022 /Users/jawon/xxx/Computer/samtools/sample/ACC macpro2@xxx.iptime.org:/Volumes/xxx/Projects/

cf) Linux 용어

1) pwd
:    pwd 명령을 사용하면 현재 작업중인 디렉토리를 확인할 수 있다.
2) cd /
: 루트 디렉토리(/)로 이동한다.
3) cd /etc/apache2/
: 절대 경로를 사용하여 이동한다. (루트 디렉토리가 기준)
4) cd .
: 현재 디렉토리(.)로 이동한다. (의미없다)
5) cd ..
: 상위 디렉토리(..)로 이동한다.
6) cd ../game
: 상대 경로를 사용하여 이동한다. (현재 디렉토리가 기준)
7) cd ~ 
: 자신의 홈 디렉토리(~)로 이동한다.
8) cd ~/workspace/
: 홈 디렉토리 안에 있는 특정 디렉토리로 이동한다.
9) cd -
: 이전 디렉토리(-)로 이동하다.
10) less
: 실제 파일 보여줌.
11) cp file1 file2
: file1 파일을 똑같이 복사하여 file2 파일을 생성한다.
12) cp file1 dir1/ (앞에 파일이 오고 뒤에 디렉토리가 오는 경우)
: 목적지로 디렉토리를 사용하게 되면 파일을 디렉토리 안에 복사한다.
13) cp file1 file2 dir1/
: 한번에 여러개의 파일을 디렉토리에 복사할 수 있다.
14) cp -r dir1/ dir2/
: 디렉토리 전체를 복사하기 위해서는 -r 옵션을 사용한다. (recursive)
(tree 명령어를 사용하면 디렉토리 구조를 트리형식으로 확인할 수 있다.)

ex1) cp *.txt /Users/xxx/abc
: .txt 형식의 모든 문서를 /Users/xxx/abc 로 복사한다.

ex2) cp ACC/samtools_run.sh BLCA/
: ACC/samtools_run.sh 문서를 BLCA로 복사한다.

728x90
반응형