3000번 포트를 개방할 경우..


sudo firewall-cmd --permanent --zone=public --add-port=3000/tcp

sudo firewall-cmd --reload


df -k  디렉토리PATH


altibase@MyUbuntu:~$ df -k /home/altibase

Filesystem     1K-blocks     Used Available Use% Mounted on

/dev/sda1       29799484 20630128   7632588  73% /

'시스템 > Unix command' 카테고리의 다른 글

[centos] port 외부로 여는 명령어  (0) 2018.07.24
파일 검색방법 참고  (0) 2018.07.17
포트 스캔하는 명령  (0) 2018.07.14
od - 바이너리 파일 덤프  (0) 2018.07.01
vim을 shell script에서 실행하는 방법  (0) 2018.04.27


파일 검색 관련 유용한 설명 


http://greenfishblog.tistory.com/54

NC 명령을 사용해서  포트 스캔을 할 수 있다.


omegaman@MyUbuntu:~$ nc -zv 127.0.0.1 8085-8088

nc: connect to 127.0.0.1 port 8085 (tcp) failed: Connection refused

Connection to 127.0.0.1 8086 port [tcp/*] succeeded!

nc: connect to 127.0.0.1 port 8087 (tcp) failed: Connection refused

Connection to 127.0.0.1 8088 port [tcp/omniorb] succeeded!

omegaman@MyUbuntu:~$  nc -zv 127.0.0.1 8086

Connection to 127.0.0.1 8086 port [tcp/*] succeeded!

8진수 덤프

od ( Octal dump)  바이너리 파일을 8진수로 덤프한다.


사용예


omegaman@MyUbuntu:~$ od /usr/bin/file | head -5

0000000 042577 043114 000402 000001 000000 000000 000000 000000

0000020 000002 000076 000001 000000 016740 000100 000000 000000

0000040 000100 000000 000000 000000 041520 000000 000000 000000

0000060 000000 000000 000100 000070 000011 000100 000035 000034

0000100 000006 000000 000005 000000 000100 000000 000000 000000


omegaman@MyUbuntu:~$ od -t a  /usr/bin/file | head -5

0000000 del   E   L   F stx soh soh nul nul nul nul nul nul nul nul nul

0000020 stx nul   > nul soh nul nul nul   `  gs   @ nul nul nul nul nul

0000040   @ nul nul nul nul nul nul nul   P   C nul nul nul nul nul nul

0000060 nul nul nul nul   @ nul   8 nul  ht nul   @ nul  gs nul  fs nul

0000100 ack nul nul nul enq nul nul nul   @ nul nul nul nul nul nul nul


omegaman@MyUbuntu:~$ od -t c /usr/bin/file | head -5

0000000 177   E   L   F 002 001 001  \0  \0  \0  \0  \0  \0  \0  \0  \0

0000020 002  \0   >  \0 001  \0  \0  \0 340 035   @  \0  \0  \0  \0  \0

0000040   @  \0  \0  \0  \0  \0  \0  \0   P   C  \0  \0  \0  \0  \0  \0

0000060  \0  \0  \0  \0   @  \0   8  \0  \t  \0   @  \0 035  \0 034  \0

0000100 006  \0  \0  \0 005  \0  \0  \0   @  \0  \0  \0  \0  \0  \0  \0


omegaman@MyUbuntu:~$ od -t x1z -A x /usr/bin/file | head -5

000000 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00  >.ELF............<

000010 02 00 3e 00 01 00 00 00 e0 1d 40 00 00 00 00 00  >..>.......@.....<

000020 40 00 00 00 00 00 00 00 50 43 00 00 00 00 00 00  >@.......PC......<

000030 00 00 00 00 40 00 38 00 09 00 40 00 1d 00 1c 00  >....@.8...@.....<

000040 06 00 00 00 05 00 00 00 40 00 00 00 00 00 00 00  >........@.......<


omegaman@MyUbuntu:~$ od -t x1c -A x /usr/bin/file | head -5

000000  7f  45  4c  46  02  01  01  00  00  00  00  00  00  00  00  00

       177   E   L   F 002 001 001  \0  \0  \0  \0  \0  \0  \0  \0  \0

000010  02  00  3e  00  01  00  00  00  e0  1d  40  00  00  00  00  00

       002  \0   >  \0 001  \0  \0  \0 340 035   @  \0  \0  \0  \0  \0

000020  40  00  00  00  00  00  00  00  50  43  00  00  00  00  00  00







vim 을 통해서 shell 에서 문자열 치환도 가능하다.

문자열 치환시 정규표현식도 사용가능하다.

vim 에서 사용하는  기타 명령어 기술이 가능하다.



/* a.sh */

# 특정 문자열 라인 삭제

vim -e a.dat <<EOF

:g/\<JAEIK\>/d         <---  해당 라인 삭제

:g/\<Nara\>/d          <---- 해당 라인 삭제

:wq                           <--- 저장후 종료

EOF



#특정 문자열 교체후 다른 파일로 저장

TABLE="T1"

vim -e template.form <<EOF

:%s/#TABLE#/$TABLE/g     

:wq! newfile.form

EOF



'시스템 > Unix command' 카테고리의 다른 글

파일 검색방법 참고  (0) 2018.07.17
포트 스캔하는 명령  (0) 2018.07.14
od - 바이너리 파일 덤프  (0) 2018.07.01
rlwrap - readline 이 적용되지 않은 program 을 위한 wrapper  (0) 2018.04.27
vim 관련 정보  (0) 2018.04.08

sqlplus  에서 이전 명령어를 다시 실행할 때  편리하다.


rlwrap - readline 이 적용되지 않은 program 을 위한 wrapper




'시스템 > Unix command' 카테고리의 다른 글

파일 검색방법 참고  (0) 2018.07.17
포트 스캔하는 명령  (0) 2018.07.14
od - 바이너리 파일 덤프  (0) 2018.07.01
vim을 shell script에서 실행하는 방법  (0) 2018.04.27
vim 관련 정보  (0) 2018.04.08

아래 사이트에 정리 잘되어 있음.

https://opentutorials.org/course/730/4573

+ Recent posts