2
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Raspberry Pi でよく使うコマンド

Last updated at Posted at 2020-01-27

よく忘れてググるので自分用のメモとして残しておきます。

システム関連

プロセス確認

$ htop

ファームウェアバージョン

$ uname -a
Linux raspberrypi 4.19.75-v7l+ #1270 SMP Tue Sep 24 18:51:41 BST 2019 armv7l GNU/Linux

Raspberry piの基本設定(OCはメニューがあるけど使えない)

$ sudo raspi-config

カーネルメッセージ確認

# メッセージのリアルタイム監視(USB接続確認など)
$ dmesg -H -w

# -w を外せば最終出力だけ見られる
$ dmesg -H

HDD

# HDDデバイスの確認
$ sudo fdisk -l | grep Disk | grep -v -e ram -e mmc

# HDD, SD Cardの確認
$ sudo fdisk -l | grep Disk | grep -v -e ram

# HDDのID確認
$ sudo blkid /dev/sdx # id確認 xは可変

# マウント
$ sudo mount -t <fs type> <device> <mount point>

# アンマウント
$ sudo umount <device>

# マウントの確認
$ df -h

HDD マウント

  • HDDデバイスの確認
$ sudo fdisk -l | grep Disk | grep -v -e ram -e mmc
  • マウントポイントを作成
# HDDのマウント先のマウントポイントを作成
$ mkdir /mnt/hdd2 # ディレクトリ名は任意

# ログインユーザーを変えないとroot以外で書き込み出来なくなる
# mountしたら変えられないので一度umountする必要あり
$ sudo chmod <user>:<user> /mnt/hdd2 
  • マウント(ext4)
$ sudo mount -t ext4 /dev/sdx /mnt/hdd2
  • マウント(FAT32)

FAT32の場合、charsetにUTF8を指定しないとマルチバイト文字のファイルを扱えない

$ sudo mount -t vfat -o iocharset=utf8 /dev/sdb1 /mnt/hdd2 
  • マウント(NTFS)
# ntfs 3gが必要なのでインストールされているか確認
$ sudo dpkg -l | grep ntfs-3g
# インストールされていなければインストールする
$ sudo apt install ntfs-3g

$ sudo mount -t ntfs-3g /dev/sdb1 /mnt/hdd
  • マウントの確認
$ df -h

USB確認

$ lsusb -t

カードリーダー動作確認

$ sudo pcsc_scan

CPU温度

$ vcgencmd measure_temp
# temp=52.0'C

CPU周波数(デフォルト)MHz

$ vcgencmd get_config arm_freq | cut -c 10-
# 1500

CPU周波数(実際)

$ vcgencmd measure_clock arm
# frequency(48)=600169920

$ echo $((`vcgencmd measure_clock arm | cut -c 15-`/1000/1000))
# 600MHz

CPUのメモリ使用量

$ vcgencmd get_mem arm
# arm=948M

GPUのメモリ使用量

$ vcgencmd get_mem gpu
# gpu=76M

電圧

$ vcgencmd measure_volts
# volt=0.8349V

Wi-Fiを探す

$ sudo iwlist wlan0 scan | grep ESSID

recdvb 録画コマンド

録画

# recdvb [--dev <チューナ番号>] --b25 --strip チャンネル番号 録画秒数 録画ファイル名
$ recdvb --dev 0 --b25 --strip 22 10 test.m2ts

# BS/CSはチューナーがないので未確認

mirakurun等が動作中の場合はエラーになるのでしばらく待ってから試すと良い。

シグナル取得

$ recdvbchksig [--dev devicenumber] channel

# Options:
# --dev N:             Use DVB device /dev/dvb/adapterN
# --help:              Show this help
# --version:           Show version

recdvbプロセスコントロール

$ recdvbctl --pid pid [--channel channel] [--sid SID1,SID2] [--tsid TSID] [--extend time_to_extend] [--time recording_time]

# Options:
# --pid:               Process id of recdvb to control
# --channel:           Tune to specified channel
# --sid SID1,SID2,...: Specify SID number in CSV format (101,102,...)
# --tsid TSID:         Specify TSID in decimal or hex, hex begins '0x'
# --extend:            Extend recording time
# --time:              Set total recording time
# --help:              Show this help
# --version:           Show version
2
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?