반응형

화면캡쳐


 전체 화면 캡쳐  활성화 창 캡쳐  선택 영역 캡쳐
 그림 파일로 저장 Print  Alt + Print   Shift + Print
 클립 보드로 복사  Ctrl + Print Ctrl + Alt + Print  Ctrl + Shift + Print 

단축키 변경방법

환경설정 (전체설정) -> 키보드 -> 바로가기 -> 스크린샷' 메뉴에 보면 위 6 종류 단축키 설정가능

출처: https://harryp.tistory.com/595 [Park's Life]

 

창 조절: Ctrl + Window Key + 화살표키 (Windows에서 Window Key + 화살표키와 동일기능)

반응형

'etc > linux' 카테고리의 다른 글

linux java process 찾기, java 실행  (0) 2020.01.31
리눅스 PC에 백업  (0) 2019.07.26
시스템 관련  (0) 2019.04.23
troubleshooting  (0) 2019.04.02
Linux 명령어  (0) 2019.03.29
반응형

Disk 관련

  • hdd인지 sdd인지 확인: rota가 1이면 hdd, 0이면 sdd, ROTA means rotational device (1 if true, 0 if false)
    • lsblk -d -o name,rota
    • cat /sys/block/sda/queue/rotational
  • disk 모델, 제조사 등 확인: http://fibrevillage.com/storage/599-how-to-tell-if-a-disk-is-ssd-or-hdisk-on-linux
    • cat /proc/scsi/scsi
  • disk 관리 관련: https://cptyun.tistory.com/3
    • df : 디스크 마운트 상태 및 용량 확인
    • fdisk : 디스크 파티션 관리
    • mkfs.ext4 : EXT4 형식으로 디스크 포맷
    • mount / umount : 디스크 마운트 / 언마운트
    • fstab : 시스템 부팅시에 디스크 마운트
  • df -h (disk free -human readable): 디스크 마운트 상태 및 용량 확인
  • lsblk (list block devices) https://linoxide.com/linux-command/linux-lsblk-command/
    • NAME :This is the device name.
    • MAJ:MIN :This column shows the major and minor device number.
    • RM :This column shows whether the device is removable or not. Note in this example the device sdb and sr0 have their RM values equals to 1 indicating they are removable.
    • SIZE :This is column give information on the size of the device. For example 298.1G indicate the device is 298.1GB and 1K indicate the device size is 1KB.
    • RO :This indicates whether a device is read-only. In this case all devices have a RO=0, indicating they are not read only.
    • TYPE :This column shows information whether the block device is a disk or a partition(part) within a disk. In this example sda and sdb are disks while sr0 is a read only memory (rom).
    • MOUNTPOINT :This column indicates mount point on which the device is mounted.

디스크 마운트 상태 및 용량 확인

Memory 관련

  • free -h : 전체 메모리와 가용 메모리 human readable하게 알려줌
  • top: Windows 작업관리자 같은 것 - top
  • proc/meminfo
  • ps -ef
    • ps -ef --sort -rss, rss(Resident Set Size) : 물리 메모리를 실제 점유하고 있는 크기
    • 가장 위에 있는 프로세스가 물리 메모리를 가장 많이 점유하고 있음!
    • ps -eo user,pid,ppid,rss,size,vsize,pmem,pcpu,time,comm --sort -rss | head -n 11
  • dmidecode: 설치된 RAM 하드웨어 정보 표시.
    • 예) dmidecode -t 17, type 17이 RAM. (그 외 L1/L2 cache 등)

https://m.blog.naver.com/jayeonsaram/220647978281

반응형

'etc > linux' 카테고리의 다른 글

linux java process 찾기, java 실행  (0) 2020.01.31
리눅스 PC에 백업  (0) 2019.07.26
Ubuntu 단축키  (0) 2019.04.26
troubleshooting  (0) 2019.04.02
Linux 명령어  (0) 2019.03.29
반응형

gzip: stdout: No space left on device   

https://askubuntu.com/questions/223248/gzip-stdout-no-space-left-on-device-while-upgrading-the-kernel

https://ubuntuforums.org/showthread.php?t=2362183

  • 먼저 disk용 가용공간 확인
    • df -h: disk free 줄임말, -h는 human readable, 사람이 보기편한 MB,GB 단위로 출력해줌
  • 다운로드된 커널 이미지 목록 확인
    • dpkg -l | grep linux-image: debian package manager? .deb 패키지의 설치, 삭제, 정보 확인등을 위해 사용되는 명령어
  • 현재 사용되는 커널이미지 확인
    • uname -r: find your currently running kernel (uname=UNIX name)
  • 현재 사용되는 것 외에 불필요한 것을 삭제 -> 다시 df 확인하니 가용공간 늘어나고 문제해결됨

Visual Studio Code에서 bootstrap table -  yarn start 잘 되다가 다음날 이런 에러 발생...

Error: ENOSPC: System limit for number of file watchers reached, watch '/home/ibs/react/bootstap-table/public'
    at FSWatcher.start (internal/fs/watchers.js:165:26)
    at Object.watch (fs.js:1274:11)
.....이하 에러메세지 생략

해결책) https://github.com/guard/listen/wiki/Increasing-the-amount-of-inotify-watchers#the-technical-details

inotify watcher increase해야함

  • get your current inotify file watch limit) cat /proc/sys/fs/inotify/max_user_watches -> 8192 였음
  • max value 524388로 increase) echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
  • 다시 cat /proc/sys/fs/inotify/max_user_watches 하니 524388로 늘어남

visual studio code linux 문서에서 관련사항 설명되어 있음 https://code.visualstudio.com/docs/setup/linux

 

 

 

반응형

'etc > linux' 카테고리의 다른 글

linux java process 찾기, java 실행  (0) 2020.01.31
리눅스 PC에 백업  (0) 2019.07.26
Ubuntu 단축키  (0) 2019.04.26
시스템 관련  (0) 2019.04.23
Linux 명령어  (0) 2019.03.29
반응형
hostname -I ip addr show /sbin/ifconfig ip address 확인 (=ipconfig inWindows)
host ftp1.xumo.com
ping ftp1.xumo.com
domain에 해당하는 IP 찾기
nc -vz GB.internal.emp.lgsmartplatform.com 80

NetCat options
-v: Vebose(장황한, 상세한) 상세결과 출력
-z : Zero-I/O mode [used for scanning]
nc -h 하면 help message, 상세옵션 나옴
특정 서버에 특정 port로 접근이 되는지 확인할 때 사용
ping ping은 ICMP protocol이용하는 것으로 특정 port로 접근가능한지는 테스트못함,
ip layer를 통해 internet 연결이 되는지만 확인가능
tar czvf conory.tar.gz /home/conory
tar xzvf conory.tar.gz
압축할때
압축풀때
chmod 755 파일명 파일권한 변경
read=4, write=2, x=1
755 = 4+2+1, 4+0+1, 4+0+1
644 = 4+2+0, 4+0+0, 4+0+0
find -name 'webos.conf'
find / -name '*.conf'
find / -name 'ab*'
find / -name 'ab*' -type d
현재 디렉토리에서 webos.conf파일 찾기
root아래에서 즉, 전체 디렉토리에서 conf확장자를 가진 파일 찾기
전체 디렉토리에서 ab로 시작하는 파일 찾기
전체 디렉토리에서 ab로 시작하는 디렉토리 찾기
grep [option] [검색 문자열] [파일명]
grep -rc home_amazon 
grep -rl home_amazon 
grep CATALINA_OUT ./*.sh 
옵션
-c 검색할 문자열이 속한 행이 개수를 출력한다.
-H 파일 이름과 함께 출력을 한다.
-i 대소문을 구분하지 않고 출력을 한다.
-n 찾으려는 문자가 속해있는 행의 번호와 같이 출력 한다.
-r 현재 경로부터 하위경로까지 검색해서 출력을 한다.
-v 찾으려는 문자가 없는 행을 출력 한다.
-w 패턴 표현식을 하나의 단어로 취급하여 검색


폴더내 모든 파일에 대해 home_amazon 검색갯수 출력
폴더내 home_amazon이 들어있는 파일에 대해 그 리스트 출력
sh확장자를 가진 파일중에서 CATALINA_OUT을 검색

















ssh seongro@10.186.119.212
ssh seongro@10.186.119.212 -p1022
exit
ssh 연결
22번아닌 1022번포트로 연결할 때
연결종료
sudo minicom serial cable 연결
   

 

TFTP
sudo apt-get install xinetd tftp tftpd
sudo vi /etc/xinetd.d/tftp
service tftp { socket_type = dgram protocol = udp wait = yes user = root server = /usr/sbin/in.tftpd server_args = -s /tftpboot disable = no per_source = 11 cps = 100 2 flags = IPv4 }
sudo mkdir /tftpboot ~$ sudo chmod 777 /tftpboot
~$ sudo /etc/init.d/xinetd restart
~$cd /tftpboot ~$ vi test.txt 아무런 문자열을 입력하고 저장한 후, VI 에디터를 종료합니다.
~$ cd /tmp // 임시 디렉토리로 이동
~$ tftp localhost // tftp 서버와 연결
tftp> get test.txt // test.txt 다운로드
Received 6 bytes in 0.0 seconds
tftp> quit
~$ ls -al // 다운 받은 파일 확인
합계 76 drwxrwxrwt 14 root root 4096 2009-05-25 13:35 . drwxr-xr-x 22 root root 4096 2009-05-25 13:30 .. drwxrwxrwt 2 root root 4096 2009-05-25 13:26 .ICE-unix -r--r--r-- 1 root root 11 2009-05-25 13:22 .X0-lock drwxrwxrwt 2 root root 4096 2009-05-25 13:22 .X11-unix drwx------ 2 jwjw jwjw 4096 2009-05-25 13:26 .esd-1000 drwx------ 2 jwjw jwjw 4096 2009-05-25 13:27 ssh-CxzfZm6269 -rw-r--r-- 1 jwjw jwjw 5 2009-05-25 13:35 test.txt -rw------- 1 root root 0 2009-05-25 13:22 tmp.btyMJW5940
~$ cat test.txt // 내용 출력 tftp로 전송할 파일

 

ps -> Process Status의 준말인가

대표적인 사용옵션: ps -ef     e는 모든 프로세스를, f는 full format으로 보여줘라는 뜻결과는 UID        PID  PPID  C STIME TTY          TIME CMD 순으로 정렬하여 나옴ps -ef | grep com.lge.ibis.crawler.watch.ViewershipCrawler | head -1 | awk '{print $2}' | xargs kill                -> 첫번째 행 process kill
ps -ef | grep com.lge.ibis.crawler.watch.ViewershipCrawler | head -2 | tail -1 | awk '{print $2}' | xargs kill    -> 두번째 행 process kill head -1은 첫번째 행까지head -2는 두번째 행까지 (즉 1행 + 2행)tail -1은 마지막 첫행tail -2은 마지막 첫행부터 2행까지


특정 port 번호를 사용하는 process (PID) 찾는 방법 3가지

  1. netstat -ntp | grep 50064  결과) tcp        0      0 ::ffff:165.244.145.18:50064 ::ffff:10.185.19.36:3310    ESTABLISHED 24664/java 
  2. lsof -i tcp:8080 -> Q2 sdpbat 계정으로 실행시 없는 명령어라 함 ㅠ
  3. fuser 8080/tcp -> Q2 sdpbat 계정으로 실행시 없는 명령어라 함 ㅠ

Crontab 

현재 사용자 [root@zetawiki ~]# crontab -l다른 사용자 [root@zetawiki ~]# crontab -l -u testuser직접등록 crontab -e작업삭제 crontab -r* * * * * 수행할 명령어 ┬ ┬ ┬ ┬ ┬ │ │ │ │ └───────── 요일 (0 - 6) (0 =일요일) │ │ │ └────────── 월 (1 - 12) │ │ └─────────── 일 (1 - 31) │ └──────────── 시 (0 - 23) └───────────── 분 (0 - 59)

  • * * * * * /root/every_1min.sh                        → 매 1분마다 /root/every_1min.sh 를 수행 (하루에 1440회[2])
  • 15,45 * * * * /root/every_30min.sh             → 매시 15분, 45분에 /root/every_30min.sh 를 수행 (하루에 48회[3])
  • */10 * * * * /root/every_10min.sh                → 10분마다 /root/every_10min.sh 를 수행 (하루에 144회[4])
  • 0 2 * * * /root/backup.sh                              → 매일 02:00에/root/backup.sh 를 수행 (하루에 1회)
  • 30 */6 * * * /root/every_6hours.sh              → 매 6시간마다 수행(00:30, 06:30, 12:30, 18:30)
  • 30 1-23/6 * * * /root/every_6hours.sh        → 1시부터 매 6시간마다 수행(01:30, 07:30, 13:30, 19:30)
  • 0 8 * * 1-5 /root/weekday.sh                        → 평일(월요일~금요일) 08:00
  • 0 8 * * 0,6 /root/weekend.sh                        → 주말(일요일, 토요일) 08:00

로그: /var/log/cron에 변경/수행 이력이 기록됨

00 09 * * * /home/ibs/crawler/watch/crawler.sh restart >> /home/ibs/logs/crontab.log 2>&1

00 02 * * * /usr/bin/find /home/ibs/crawler/crawler_daily_checker/log -name "*.log.201*" -atime +7(7일지난거) -exec rm -rf {}(find로 찾은 애들가리킴) \;(exec option의 끝을 표시하기 위해 \;써줌) &> /dev/null

 


sudo: 현재 계정에서 다른 계정의 권한만 빌려서 일회성으로 명령어 실행

su: 로그아웃하지 않고 다른 계정으로 전환

su -: 로그아웃하지 않고 다른 계정으로 전환 + 그 계정의 환경변수 적용 

sdpbat 으로 계정변경: sudo su - sdpbat , su - sdpbat

반응형

'etc > linux' 카테고리의 다른 글

linux java process 찾기, java 실행  (0) 2020.01.31
리눅스 PC에 백업  (0) 2019.07.26
Ubuntu 단축키  (0) 2019.04.26
시스템 관련  (0) 2019.04.23
troubleshooting  (0) 2019.04.02

+ Recent posts