'Linux'에 해당되는 글 776건

  1. 2020.12.08 shuf
  2. 2020.12.07 ubuntu 20.04 한글입력기 2
  3. 2020.12.04 pdsh
  4. 2020.12.04 bash $$ 변수, 배열, 반복
  5. 2020.12.04 bash 배열
  6. 2020.12.04 find -mmin
  7. 2020.12.02 centos 8.2 네트워크 설정
  8. 2020.11.07 /dev/ipmi를 보고 싶다!!!
  9. 2020.10.14 linux 스토리지 정보
  10. 2020.10.06 우분투에서 부팅 USB 만들기(iso)
Linux2020. 12. 8. 18:47

 

ls dirname | shuf -n 1
find dirname -type f | shuf -n 1

 

파일들 중에 임의의 하나를 빼내는 명령어

[링크 : https://stackoverflow.com/questions/414164/how-can-i-select-random-files-from-a-directory-in-bash]

 

 

play "`ls *mp3 | shuf -n 1`"

'Linux' 카테고리의 다른 글

dsa distributed switch architecture  (0) 2020.12.11
linux command line에서 mp3 재생하기  (0) 2020.12.08
pdsh  (0) 2020.12.04
bash $$ 변수, 배열, 반복  (0) 2020.12.04
bash 배열  (0) 2020.12.04
Posted by 구차니
Linux/Ubuntu2020. 12. 7. 17:51

설정에서 한글 입력기를 추가로 설정을 해주어야 한다.

외산 노트북이라 한영키가 없다 보니 기본 설정으로는 안되고

오른쪽 alt 를 추가해주어도 한영 변환이나

오른쪽 ctrl로 한자 변환이 되지 않는다 -_ㅠ

ibus라 그런가.. 다른걸로 해봐야하나?

 

[링크 : https://velog.io/@yujo/Ubuntu-20.04한글-입력기-설치-설정하기]

'Linux > Ubuntu' 카테고리의 다른 글

ubuntu gnome-control-center over ssh  (0) 2021.04.14
우분투 패키지 버전 확인하기  (0) 2020.12.16
/dev/ipmi를 보고 싶다!!!  (0) 2020.11.07
우분투에서 부팅 USB 만들기(iso)  (0) 2020.10.06
jaaa - JACK and ALSA Audio Analyser  (0) 2020.10.05
Posted by 구차니
Linux2020. 12. 4. 16:12

복수개의 target에 ssh로 접속해서 동일한 명령어로 실행하는 유틸리티

 

Some examples of usage follow:

Run command on foo01,foo02,...,foo05
    pdsh -w foo[01-05] command

Run command on foo7,foo9,foo10
pdsh -w foo[7,9-10] command
Run command on foo0,foo4,foo5
pdsh -w foo[0-5] -x foo[1-3] command

A suffix on the hostname is also supported:
Run command on foo0-eth0,foo1-eth0,foo2-eth0,foo3-eth0
   pdsh -w foo[0-3]-eth0 command

 

[링크 : https://linux.die.net/man/1/pdsh]

[링크 : https://qastack.kr/server/2533/linux-running-the-same-command-on-many-machines-at-once]

'Linux' 카테고리의 다른 글

linux command line에서 mp3 재생하기  (0) 2020.12.08
shuf  (0) 2020.12.08
bash $$ 변수, 배열, 반복  (0) 2020.12.04
bash 배열  (0) 2020.12.04
find -mmin  (0) 2020.12.04
Posted by 구차니
Linux2020. 12. 4. 14:28

 

 

특수 매개 변수(Special Parameters)
문자 설명
$$ 현재 스크립트의 PID
$? 최근에 실행된 명령어, 함수, 스크립트 자식의 종료 상태
$! 최근에 실행한 백그라운드(비동기) 명령의 PID
$- 현재 옵션 플래그
$_ 지난 명령의 마지막 인자로 설정된 특수 변수

[링크 : https://blog.gaerae.com/2015/01/bash-hello-world.html]

 

배열

배열은 콤마가 아니라 공백으로 내용이 구분되어야 한다. 콤마를 넣으면 하나의 값이 들어있는 배열로 인식한다. 주의!!

배열명= ("내용1" "내용2")

[링크 : http://blog.redjini.com/282]

 

for 루프

변수의 제어문에서 존재하지 않는 변수를 사용할 경우 0으로 인식되는게 아니라 에러가 발생하니 주의!!

[링크 : https://skylit.tistory.com/321]

'Linux' 카테고리의 다른 글

shuf  (0) 2020.12.08
pdsh  (0) 2020.12.04
bash 배열  (0) 2020.12.04
find -mmin  (0) 2020.12.04
linux 스토리지 정보  (0) 2020.10.14
Posted by 구차니
Linux2020. 12. 4. 12:44

변수명=("내용", "내용", ...)

으로 선언하는데 접근은

${변수명[index]} 로 해야 한다.

 

 

# 빈 배열
EMPTY_LIST=()

PLANETS=( "EARTH" "MARS" "VINUS" )
# ${PLANETS[0]} == "EARTH"
# ${PLANETS[1]} == "MARS"
# ${PLANETS[2]} == "VINUS"

PLACES[0]="HERE"
PLACES[1]="THERE"
PLACES[2]="WHERE"

NAMES=()
NAMES+=("ME")    # ${NAMES[0]} == "ME"
NAMES+=("YOU")   # ${NAMES[1]} == "YOU"
NAMES+=("THEM")  # ${NAMES[2]} == "THEM"

[링크 : https://blog.leocat.kr/notes/2018/02/18/shell-declare-list]

'Linux' 카테고리의 다른 글

pdsh  (0) 2020.12.04
bash $$ 변수, 배열, 반복  (0) 2020.12.04
find -mmin  (0) 2020.12.04
linux 스토리지 정보  (0) 2020.10.14
linux page cache  (0) 2020.01.13
Posted by 구차니
Linux2020. 12. 4. 10:28

10분 이내로 수정된 파일 찾기

-mmin -10

 

[링크 : http://bahndal.egloos.com/565007]

'Linux' 카테고리의 다른 글

bash $$ 변수, 배열, 반복  (0) 2020.12.04
bash 배열  (0) 2020.12.04
linux 스토리지 정보  (0) 2020.10.14
linux page cache  (0) 2020.01.13
dmesg 시간 환산하기  (0) 2020.01.07
Posted by 구차니
Linux/centos2020. 12. 2. 10:29

minimal 버전으로 설치하긴 했는데 네트워크 넘겼는지 기억이 나지 않는다 -_ㅠ

virtual box에서 NAT로 설정하고 설치를 했는데 네트워크가 잡히지 않아서 확인해보니

nmcli유틸을 이용해서 네트워크를 올려주어야 한다.

$ sudo nmcli connection down enp1s0 && sudo nmcli connection up enp1s0

[링크 : https://linuxconfig.org/rhel-8-configure-static-ip-address]

 

위에대로 하면 1회성에 한해 네트워크 설정이 잡히는데

다시 설정 파일을 보니 ONBOOT=no로 되어있었다.

 

 

$ sudo vi /etc/sysconfig/network-script/ifcfg-enp0s3
ONBOOT=yes
#ONBOOT=no

[링크 : https://www.lesstif.com/system-admin/centos-network-centos-static-ip-13631535.html]

 

아니 이런건 기본값이 yes로 해달란 말이야.. ㅠㅠ

'Linux > centos' 카테고리의 다른 글

centos 8.3-2011 용량이 많이 늘었나?  (0) 2020.12.14
centos stream?  (0) 2020.12.10
ls 퍼미션에 .의 의미  (0) 2020.04.01
centos7 minimal / X11 사용하기  (0) 2020.02.04
리눅스 로그인 실패 로그  (2) 2019.07.07
Posted by 구차니
Linux/Ubuntu2020. 11. 7. 15:24

콴타 서버  파워가 이제 돌려받아져서 오랫만에 켜서 테스트 해보는데

영 안뜨네.. 얘도 ipmi 가 있는것 같긴한데 되는 장비를 못 보겠다 ㅠㅠ

$ sudo apt install ipmitool
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  freeipmi-common libfreeipmi17 libopenipmi0 libsensors-config libsensors5
  libsnmp-base libsnmp35 openipmi
Suggested packages:
  freeipmi-tools lm-sensors snmp-mibs-downloader
The following NEW packages will be installed:
  freeipmi-common ipmitool libfreeipmi17 libopenipmi0 libsensors-config
  libsensors5 libsnmp-base libsnmp35 openipmi
0 upgraded, 9 newly installed, 0 to remove and 6 not upgraded.
Need to get 3298 kB of archives.
After this operation, 14.6 MB of additional disk space will be used.
Do you want to continue? [Y/n]

$ ipmitool
Could not open device at /dev/ipmi0 or /dev/ipmi/0 or /dev/ipmidev/0: No such file or directory

$ sudo dmidecode -t 1
# dmidecode 3.2
Getting SMBIOS data from sysfs.
SMBIOS 2.7 present.

Handle 0x0001, DMI type 1, 27 bytes
System Information
        Manufacturer: Quanta
        Product Name: Freedom
        Version: C1
        Serial Number: To be filled by O.E.M.
        UUID: 26f47cac-5bb2-11d9-899f-9c4c68493100
        Wake-up Type: LAN Remote
        SKU Number: 16DIMM
        Family: Server

$ sudo dmidecode -t 2
# dmidecode 3.2
Getting SMBIOS data from sysfs.
SMBIOS 2.7 present.

Handle 0x0002, DMI type 2, 15 bytes
Base Board Information
        Manufacturer: Quanta
        Product Name: Winterfell
        Version: To be filled by O.E.M.
        Serial Number: To be filled by O.E.M.
        Asset Tag: To be filled by O.E.M.
        Features:
                Board is a hosting board
                Board is replaceable
        Location In Chassis: Left
        Chassis Handle: 0x0003
        Type: Motherboard
        Contained Object Handles: 0

$ sudo dmidecode -t 3
# dmidecode 3.2
Getting SMBIOS data from sysfs.
SMBIOS 2.7 present.

Handle 0x0003, DMI type 3, 22 bytes
Chassis Information
        Manufacturer: Quanta
        Type: Rack Mount Chassis
        Lock: Not Present
        Version: To Be Filled By O.E.M.
        Serial Number: To Be Filled By O.E.M.
        Asset Tag: To Be Filled By O.E.M.
        Boot-up State: Safe
        Power Supply State: Safe
        Thermal State: Safe
        Security Status: None
        OEM Information: 0x00000000
        Height: 2 U
        Number Of Power Cords: 1
        Contained Elements: 0
        SKU Number: To be filled by O.E.M.

$ sudo modprobe ipmi_devintf
$ ll /dev/i
i2c-0    initctl  input/
$ sudo modprobe ipmi_si
modprobe: ERROR: could not insert 'ipmi_si': No such device

$ dmesg | tail
[  197.942225] IPMI message handler: version 39.2
[  197.944408] ipmi device interface
[  210.061984] ipmi_si: IPMI System Interface driver
[  210.062167] ipmi_si: Unable to find any System Interface(s)

 

+

[링크 : http://coffeenix.net/board_print.php?bd_code=1765]

'Linux > Ubuntu' 카테고리의 다른 글

우분투 패키지 버전 확인하기  (0) 2020.12.16
ubuntu 20.04 한글입력기  (2) 2020.12.07
우분투에서 부팅 USB 만들기(iso)  (0) 2020.10.06
jaaa - JACK and ALSA Audio Analyser  (0) 2020.10.05
ipmitool  (0) 2020.09.24
Posted by 구차니
Linux2020. 10. 14. 12:47

lshw 를 통해서는 아래와 같이 제조사 정도의 정보 밖에 없고

모델명이나 시리얼은 나오지 않는다.

$ sudo lshw -class storage
  *-storage                 
       description: Non-Volatile memory controller
       product: NVMe SSD Controller SM981/PM981
       vendor: Samsung Electronics Co Ltd
       physical id: 0
       bus info: pci@0000:3a:00.0
       version: 00
       width: 64 bits
       clock: 33MHz
       capabilities: storage pm msi pciexpress msix nvm_express bus_master cap_list
       configuration: driver=nvme latency=0
       resources: irq:16 memory:92300000-92303fff
  *-storage
       description: Non-Volatile memory controller
       product: SK hynix
       vendor: SK hynix
       physical id: 0
       bus info: pci@0000:3b:00.0
       version: 00
       width: 64 bits
       clock: 33MHz
       capabilities: storage pm msi msix pciexpress nvm_express bus_master cap_list
       configuration: driver=nvme latency=0
       resources: irq:16 memory:92200000-92203fff memory:92205000-92205fff memory:92204000-92204fff

 

사용중인 노트북에는 nvme가 2개가 있는데

/dev/nvme0로 잡히고

/sys/block/nvme0n1/devices

/sys/block/nvme1n1/devices 하위에

model, serial 등이 내가 nvme 모델명, nvme 시리얼 값이다.

/sys/block/nvme0n1/device$ ll
합계 0
drwxr-xr-x  4 root root    0 10월 14 09:29 ./
drwxr-xr-x  3 root root    0 10월 14 09:29 ../
-r--r--r--  1 root root 4096 10월 14 12:45 address
-r--r--r--  1 root root 4096 10월 14 12:45 cntlid
-r--r--r--  1 root root 4096 10월 14 12:45 dev
lrwxrwxrwx  1 root root    0 10월 14 09:31 device -> ../../../0000:3a:00.0/
-r--r--r--  1 root root 4096 10월 14 12:45 firmware_rev
-r--r--r--  1 root root 4096 10월 14 09:29 model
-r--r--r--  1 root root 4096 10월 14 12:45 numa_node
drwxr-xr-x 13 root root    0 10월 14 09:29 nvme0n1/
drwxr-xr-x  2 root root    0 10월 14 12:45 power/
-r--r--r--  1 root root 4096 10월 14 12:45 queue_count
--w-------  1 root root 4096 10월 14 12:45 rescan_controller
--w-------  1 root root 4096 10월 14 12:45 reset_controller
-r--r--r--  1 root root 4096 10월 14 09:29 serial
-r--r--r--  1 root root 4096 10월 14 12:45 sqsize
-r--r--r--  1 root root 4096 10월 14 12:45 state
-r--r--r--  1 root root 4096 10월 14 12:45 subsysnqn
lrwxrwxrwx  1 root root    0 10월 14 09:29 subsystem -> ../../../../../../class/nvme/
-r--r--r--  1 root root 4096 10월 14 12:45 transport
-rw-r--r--  1 root root 4096 10월 14 09:29 uevent

 

[링크 : https://unix.stackexchange.com/questions/273971/how-to-get-hard-disk-information-on-linux-terminal]

'Linux' 카테고리의 다른 글

bash 배열  (0) 2020.12.04
find -mmin  (0) 2020.12.04
linux page cache  (0) 2020.01.13
dmesg 시간 환산하기  (0) 2020.01.07
screen 사용법  (0) 2019.12.18
Posted by 구차니
Linux/Ubuntu2020. 10. 6. 15:43

USB sd 리더에서 해보긴 했는데

fat32 였던지라 넣으면 바로 인식해서 마운트 되는 바람에

수동으로 umount를 해주어야 했지만 그래도 꽤 편하게 쓸 수 있는 툴

 

woeusbgui로 실행하면 된다.

 

[링크 : https://ncube.net/우분투에서-윈도우-10-설치-부팅-usb-만들기/]

[링크 : https://shiinachianti.tistory.com/32]

 

+

ntpasswd를 만들어봤는데 부팅이 안된다?

'Linux > Ubuntu' 카테고리의 다른 글

ubuntu 20.04 한글입력기  (2) 2020.12.07
/dev/ipmi를 보고 싶다!!!  (0) 2020.11.07
jaaa - JACK and ALSA Audio Analyser  (0) 2020.10.05
ipmitool  (0) 2020.09.24
rsync with ssh  (0) 2020.09.23
Posted by 구차니