Chrome OS croshで実行コマンド一覧

未分類
未分類

ChromebookのChrome OSでも、GUI以外にターミナルモード(コマンド実行モード)があり、
Linuxのようにコマンドが打てます。

ただし、コマンド実行できることが限られていまして、動作確認用のコマンドが多いです。
以下にchromebook Chrome OSで実行できるコマンドを紹介します。

ChromebookのChrome OSでターミナルモード(crosh)を起動する方法

ctrl+alt+t

でcroshが起動します。

また、chromeブラウザのアドレスに、直接

chrome-untrusted://crosh/

と入力してもcroshが起動し実行できます。

Chrome OSでターミナルモード(crosh)画面のカスタマイズ

crosh画面上で、

Shift+Ctrl+P

を押しますと、上記ターミナル設定画面になり、デザインからSSHファイルまで変更ができます。

Chrome OS croshのコマンド一覧

Google Chrome OS バージョン: 97.0.4692.102(Official Build)(64 ビット)のコマンド一覧情報です。

arc

Usage: arc
[ ping [ NETWORK ] [ | ] |
http [ NETWORK ] |
dns [ NETWORK ] |
proxy |
list [ networks ] |
stats [ sockets | traffic ]
]
where NETWORK := [ wifi | eth | ethernet | cell | cellular | vpn ]

ping: check the reachability of a host or IP address.
http: do a GET request to an URL and print the response header.
dns: perform a DNS lookup of a domain name.
proxy: resolve the current proxy configuration for a given URL.
list networks: show properties of all networks connected in Android.
stats sockets: show TCP connect and DNS statistics by Android Apps.
stats traffic: show traffic packet statistics by Android Apps.

If NETWORK is not specified, the default network is used.
autest [–scheduled]
Trigger an auto-update against a test update server.

WARNING: This may update to an untested version of Chrome OS which was never
intended for end users!

The –scheduled option fakes a scheduled update.

authpolicy_debug

authpolicy_debug
Set authpolicy daemon debugging level.
can be 0 (quiet), 1 (taciturn), 2 (chatty), or 3 (verbose).

battery_firmware

battery_firmware
info : Query battery info.
check : Check whether the AC adapter is connected.
Also check whether the battery firmware is the latest.
update : Trigger battery firmware update.

battery_test

battery_test []
Tests battery discharge rate for given number of seconds. Without an argument,
defaults to 300 seconds.

bt_console

bt_console []
Enters a Bluetooth debugging console. Optional argument specifies the
capability of a pairing agent the console will provide; see the Bluetooth
Core specification for valid options.

ccd_pass

ccd_pass
When prompted, set or clear CCD password (use the word ‘clear’ to clear
the password).

chaps_debug

chaps_debug [start|stop|]
Sets the chapsd logging level. No arguments will start verbose logging.

connectivity

connectivity
Shows connectivity status. “connectivity help” for more details

cras

cras [ enable | disable | telephony [arg] ]
Interact with CRAS(CrOS Audio Server) to set flags or trigger events.

Subcommands:
enable/disable :
Enable or disable feature flag inside CRAS.
Available flags:
– wbs: Turn on this flag to make CRAS try to use wideband speech mode in
Bluetooth HFP, if both the Bluetooth controller and peripheral supports
this feature.
– noise_cancellation: Turn on this flag to enable noise cancellation
processing to input devices who support noise cancellation.

  Notice: The flag changes made through this command do not persist after
  reboot.

telephony <event> [args...]:
  Trigger a telephony event pass to CRAS in Bluetooth HFP.

  Available events:
  - IncomingCall <PhoneNumber>: Make a call from external line.
      Ex: $ cras telephony IncomingCall 12345678
  - AnswerCall: Answer the call.
  - TerminateCall: Terminate the call.
  - SetDialNumber [DailNumber]: Set the last dialed number recorded. Clear
    the recorded number if no DailNumber is provided.
  - SetBatteryLevel <BatteryLevel>: Set and transfer the battery level to
    HF. The BatteryLevel should range from 0 to 5.
  - SetSignalStrength <SignalStrength>: Set and transfer the signal strength
    to HF. The SignalStrength should range from 0 to 5.
  - SetServiceAvailability <0/1>: Set if the service is available or not.
  - SetCallheld <CallHeldIndicator>: Set the callheld indicator.
    CallHeldIndicator:
      0 = No calls held
      1 = Call is placed on hold or active/held calls swapped
      (The AG has both an active AND a held call)
      2 = Call on hold, no active call
  - SetCallsetup <CallSetupIndicator>: Set the callsetup indicator.
    CallSetupIndicator:
      0 = No call setup in progress
      1 = Incoming call setup in progress
      2 = Outgoing call setup in dialing state
      3 = Outgoing call setup in alerting state
  - SetCall <CallIndicator>: Set the call indicator.
    CallIndicator:
      0 = No call (held or active)
      1 = Call is present (active or held)

diag

diag
Usage: [list|routine]

Usage: dmesg [options]
-d, –show_delta
Display the timestamp and the time delta
spent between messages
-H, –human
Enable human-readable output.
-k, –kernel
Print kernel messages.
-L, –color
Colorize the output.
-p, –force-prefix
Add facility, level or timestamp
information to each line of a multi-line message.
-r, –raw
Print the raw message buffer.
-T, –ctime
Print human-readable timestamps.
-t, –notime
Do not print kernel’s timestamps.
-u, –userspace
Print userspace messages.
-x, –decode
Decode facility and level (priority) numbers
to human-readable prefixes.
dump_emk
Show the EMK (Enterprise Machine Key).

enroll_status

enroll_status [–mode] [–domain] [–realm] [–user]
Displays device enrollment information.

evtest

evtest
Run evtest in safe mode.

exit

exit
Exit crosh.

ff_debug

ff_debug
Usage: ff_debug []|[–reset]|[–help]|[–list_valid_tags]|[–level ]

ff_debug adds and removes debug tags for flimflam.
Current debug settings are displayed if no parameters are provided

is defined in boolean notation using separated
by an operator [+-], where + and – imply adding and removing of the tag immediately
following the operator. An expression beginning with either operators [+-]
takes the existing tags and modifies them appropriately. Otherwise, the existing tags
are replaced by those specified in the command.

<debug_tag> can be listed using the --list_valid_tags

e.g.: ff_debug network+wifi
  Sets debug tags to network and wifi
e.g.: ff_debug +network-service
  Adds network and removes service tags from the existing debug settings

–list_valid_tags : Displays all valid tags

–level: Displays or sets current debug level for logging
All messages at, or above, the current log level are logged. Normal log
levels range from 4 (LOG_FATAL) to 0 (LOG_INFO). In addition VERBOSE log
levels are available starting at -1.

e.g.: ff_debug --level 4
  Logs only FATAL messages.
e.g.: ff_debug --level 0
  Logs INFO, WARNING, ERROR, ERROR_REPORT, and FATAL messages.
e.g.: ff_debug --level -4
  Logs everything that "--level 0" does, plus SLOG(<tag>, <n>) messages,
  where <tag> has been enabled for logging, and <n> <= 4. (NOTE: you must
  negate SLOG levels for use with ff_debug. In this example, SLOG(<tag>, 4)
  maps to "--level -4".)

–reset : Removes all tagging

–help : Displays this output

free

Linuxのコマンドでもあるメモリの使用量をみるコマンドですね。

crosh> free
total used free shared buff/cache available
Mem: 8003216 4934180 285600 2305200 2783436 265680
Swap: 11723460 6366168 5357292

free [options]
Display free/used memory info

gesture_prop

gesture_prop [ devices | list | get | set ]
Read and change gesture properties for attached input devices. The “Enable
gesture properties D-Bus service” flag must be enabled for this command to
work.

For more details, see:
https://chromium.googlesource.com/chromiumos/platform/gestures/+/HEAD/docs/gesture_properties.md

Subcommands:
devices, devs:
List the devices managed by the gestures library, with their numeric IDs.

list <device ID>:
  List the properties for the device with the given ID.

get <device ID> <property name>:
  Get the current value of a property. Property names containing spaces
  should be quoted. For example:
  $ gesture_prop get 12 "Mouse CPI"

set <device ID> <property name> <value>:
  Set the value of a property. Values use the same syntax as dbus-send
  (https://dbus.freedesktop.org/doc/dbus-send.1.html#description), and
  should either be arrays or strings. For example:
  $ gesture_prop set 12 "Mouse CPI" array:double:500
  $ gesture_prop set 12 "Log Path" string:/tmp/foo.txt

help

help [command]
Display general help, or details for a specific command.

help_advanced

help_advanced
Display the help for more advanced commands, mainly used for debugging.

ipaddrs

パソコンのIPアドレスが確認できるコマンド。

crosh> ipaddrs -4
/0 [ ip -4 addr show ]
/1 1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
/2 inet 127.0.0.1/8 scope host lo
/3 valid_lft forever preferred_lft forever
/4 2: wlan0: mtu 1500 qdisc noqueue state UP group default qlen 1000
/5 inet 192.168.116.82/24 brd 192.168.116.255 scope global wlan0
/6 valid_lft forever preferred_lft forever
/7 3: arc_ns0@if2: mtu 1500 qdisc noqueue state UP group default qlen 1000 link-netnsid 0
/8 inet 100.115.92.129/30 brd 100.115.92.131 scope global arc_ns0
/9 valid_lft forever preferred_lft forever

ipaddrs [-4] [-6]
Display IP addresses.
-4: Only show IPv4 addresses.
-6: Only show IPv6 addresses.

meminfo

メモリ状態の詳細を確認できるコマンド。

crosh> meminfo
MemTotal: 8003216 kB
MemFree: 386496 kB
MemAvailable: 304112 kB
Buffers: 5136 kB
Cached: 2148832 kB
SwapCached: 2084 kB
Active: 1678832 kB

meminfo
Display detailed memory statistics

memory_test

memory_test
Performs extensive memory testing on the available free memory.

modem

modem [args…]
Interact with the 3G modem. Run “modem help” for detailed help.

network_diag

ネットワークが通信できるか確認するコマンド。

crosh> network_diag
Saving output to Downloads under: network_diagnostics_2022-02-09.14-06-45.txt
Trying to contact https://clients3.google.com … (waiting up to 10 seconds)
PASS: Loaded clients3.google.com via HTTPS
Entering diag_date clients3.google.com
Local time of day: Wed Feb 9 14:06:47 JST 2022
PASS: Time offset is small (-1)

network_diag
Usage: /usr/bin/network_diag [–date|–flimflam|–link|–wifi|–help] [host]
–date: Diagnose time-of-day
([host] must support SSL)
–dhcp: Display DHCP information
–flimflam: Diagnose flimflam status
–hosts: Diagnose SSL connection to Google hosts
–interface: Diagnose interface status
–link: Diagnose all network links
–no-log: Do not log output
–proxy: Specify proxy to use with tests
–route: Diagnose routes to each host
–wifi: Display driver-specific debugging information
–help: Display this message
[host] Hostname to perform web access test on (default: clients3.google.com)

p2p_update

p2p_update [enable|disable] [–num-connections] [–show-peers]
Enables or disables the peer-to-peer (P2P) sharing of updates over the local
network. This will both attempt to get updates from other peers in the
network and share the downloaded updates with them. Run this command without
arguments to see the current state. Additional switches will display number
of connections and P2P peers.

Usage: packet_capture [options]
–device
–max-size
–frequency
–ht-location
–vht-width <80|160>
–monitor-connection-on

Start packet capture. Start a device-based capture on ,
or do an over-the-air capture on with an optionally
provided HT channel location or VHT channel width. An over-the-air
capture can also be initiated using the channel parameters of a
currently connected . Note that over-the-air
captures are not available with all 802.11 devices. Set
to stop the packet capture if the output .pcap file size exceedes this
limit. Only device-based capture options (–device and –max-size) are
available in verified mode. Switch to developer mode to use other
options.
ping [-4] [-6] [-c count] [-i interval] [-n] [-s packetsize] [-W waittime]
Send ICMP ECHO_REQUEST packets to a network host. If is “gw”
then the next hop gateway for the default route is used.
Default is to use IPv4 [-4] rather than IPv6 [-6] addresses.

rlz

rlz < status | enable | disable >
Enable or disable RLZ. See this site for details:
http://dev.chromium.org/developers/design-documents/extensions/proposed-changes/apis-under-development/rlz-api

rollback

rollback
Attempt to rollback to the previous update cached on your system. Only
available on non-stable channels and non-enterprise enrolled devices.

Please note that this will powerwash your device.

route

routeテーブルを確認するコマンド。

crosh> route -4
/0 

/24 [ ip -4 route show table 1002 ]
/25 default via 192.168.116.254 dev wlan0 metric 10 

route [-4] [-6] [–all]
Display the routing tables.
-4: Only show IPv4 routes.
-6: Only show IPv6 routes.
–all: Show all routing tables.

set_apn

set_apn [-c] [-n ] [-u ] [-p ]
Set the APN to use when connecting to the network specified by .
If is not specified, use the network-id of the currently
registered network.

The -c option clears the APN to be used, so that the default APN will be used
instead.

set_arpgw

set_arpgw
Turn on extra network state checking to make sure the default gateway
is reachable.

set_cellular_ppp

set_cellular_ppp [-c] [-u ] [-p ]
Set the PPP username and/or password for an existing cellular connection.
If neither -u nor -p is provided, show the existing PPP username for
the cellular connection.

The -c option clears any existing PPP username and PPP password for an
existing cellular connection.

set_time

set_time
Sets the system time if the the system has been unable to get it from the
network. The uses the format of the GNU coreutils date command.

set_wake_on_lan

set_wake_on_lan
Enable or disable Wake on LAN for Ethernet devices. This command takes
effect after re-connecting to Ethernet and is not persistent across system
restarts.

storage_test_1

storage_test_1
Performs a short offline SMART test.

storage_test_2

storage_test_2
Performs an extensive readability test.

swap

swap状態を見たりするコマンド。

crosh> swap status
Filename Type Size Used Priority
/dev/zram0 partition 11723460 6655940 -2
low-memory margin (MiB): 406 3126
min_filelist_kbytes (KiB): 0
ram_vs_swap_weight: 4
extra_free_kbytes (KiB): 0

swap [ enable | disable | start | stop | status
| set_margin | set_extra_free
| set_min_filelist ]
Change kernel memory manager parameters
(FOR EXPERIMENTS ONLY — USE AT OWN RISK)

“swap status” (also “swap” with no arguments) shows the values of various
memory manager parameters and related statistics.

The enable/disable options enable or disable compressed swap (zram)
persistently across reboots, and take effect at the next boot. The enable
option takes the size of the swap area (in megabytes before compression).
If the size is omitted, the factory default is chosen.

The start/stop options turn swap on/off immediately, but leave the settings
alone, so that the original behavior is restored at the next boot.

WARNING: if swap is in use, turning it off can cause the system to
temporarily hang while the kernel frees up memory. This can take
a long time to finish.

The set_margin, set_min_filelist, and set_extra_free options change
kernel parameters with similar names. The change is immediate and
persistent across reboots. Using the string “default” as the value
restores the factory default behavior.

sync

sync
Run the sync command

syslog

syslog
Logs a message to syslog (the system log daemon).

time_info

time_info
Returns the current synchronization state for the time service.

top

プロセスの状態、PIDをリアルタイム確認するコマンド。

crosh> swap status
top - 14:12:56 up 5:21, 0 users, load average: 0.65, 0.84, 0.92
Tasks: 432 total, 1 running, 431 sleeping, 0 stopped, 0 zombie
%Cpu(s): 11.1 us, 3.4 sy, 0.0 ni, 85.4 id, 0.1 wa, 0.0 hi, 0.1 si, 0.0 st
MiB Mem : 7815.6 total, 442.3 free, 5140.7 used, 2232.6 buff/cache
MiB Swap: 11448.7 total, 4881.4 free, 6567.3 used. 412.1 avail Mem

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
3118 chronos 20 0 24.4g 118044 68816 S 21.8 1.5 0:31.29 chrome
1916 chronos 12 -8 18.2g 124384 21504 S 13.2 1.6 31:04.14 chrome
1825 chronos 12 -8 17.0g 285248 116380 S 10.2 3.6 20:30.30 chrome

top
Run top.

tracepath

通信経路を確認するトレースルートコマンド。

crosh> tracepath -4 www.google.co.jp
1?: [LOCALHOST] pmtu 1500
1: 192.168.116.254 2.161ms
2: 254.**.ne.jp 9.073ms

tracepath [-4] [-6] [-n] [/port]
Trace the path/route to a network host.
Default is to trace IPv4 [-4] rather than IPv6 [-6] targets.

u2f_flags

u2f_flags [, user_keys, verbose]

### IMPORTANT: The U2F feature is experimental and not suitable for
### general production use in its current form. The current
### implementation is still in flux and some features (including
### security-relevant ones) are still missing. You are welcome to
### play with this, but use at your own risk. You have been warned.

Set flags to override the second-factor authentication daemon configuration.
u2f: Always enable the standard U2F mode even if not set in device policy.
g2f: Always enable the U2F mode plus some additional extensions.
user_keys: Enable user-specific keys.
verbose: Increase the daemon logging verbosity in /var/log/messages.

uname

Linuxにもあるunameコマンド。

crosh> uname -a
Linux localhost 5.4.157-17191-g6575d22de694 #1 SMP PREEMPT Thu Jan 20 19:38:15 PST 2022 x86_64 Intel(R) Pentium(R) Silver N6000 @ 1.10GHz GenuineIntel GNU/Linux

uname [-a|-s|-n|-r|-v|-m|-p|-i|-o]
Display system info

upload_crashes

upload_crashes
Uploads available crash reports to the crash server.

upload_devcoredumps

upload_devcoredumps [enable|disable]
Enable or disable the upload of devcoredump reports.

uptime

Chrome OSの起動時間(起動していた時間)を確認するコマンド。

crosh> uptime
14:16:46 up 5:24, 0 users, load average: 0.88, 0.87, 0.91

uptime
Display uptime/load info

verify_ro

verify_ro
Verify AP and EC RO firmware on a Chrome OS device connected over SuzyQ
cable, if supported by the device.

vmc

USAGE: vmc
[ start [–enable-gpu] [–enable-vulkan] [–enable-big-gl] [–enable-audio-capture] [–untrusted] [–extra-disk PATH] [–kernel PATH] [–initrd PATH] [–writable-rootfs] [–kernel-param PARAM] [–bios PATH] [–timeout PARAM] |
stop |
launch |
create [-p] [ []] [– additional parameters]
create-extra-disk –size SIZE [–removable-media] |
adjust [additional parameters] |
destroy |
disk-op-status |
export [-d] [-f] [] |
import [-p] [] |
resize |
list |
share |
unshare |
container [ ( ) | ( )] [ –privileged ]
usb-attach : |
usb-detach |
usb-list |
pvm.send-problem-report [-n ] [-e ] |
–help | -h ]

vmstat

Linuxにもあるパフォーマンス(CPUやメモリといったリソース使用状況)を確認するコマンド。

crosh> vmstat 1 4
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
r b swpd free buff cache si so bi bo in cs us sy id wa st
1 0 6814412 659984 16300 2325904 152 299 155 157 163 255 17 5 77 0 0
0 0 6814412 658112 16300 2327020 4 0 0 0 1631 2637 4 3 93 0 0
0 0 6814412 657692 16300 2327020 0 0 4 0 1334 2315 4 2 94 0 0
2 0 6814412 660128 16308 2326064 8 0 0 252 1409 2653 5 2 92 0 0

vmstat [-a|-d|-f|-m|-n|-s|-w] [delay [count]]
Report virtual memory statistics

vsh

vsh []
Connect to a shell inside the VM , or to a shell inside the container
within the VM .

wifi_fw_dump

wifi_fw_dump
Manually trigger a WiFi firmware dump. This command will currently only
complete successfully if the intel-wifi-fw-dumper package is present on the
device with USE=iwlwifi_dump enabled.

wifi_power_save

wifi_power_save < status | enable | disable >
Enable or disable WiFi power save mode. This command is not persistent across
system restarts.

wireguard wireguard

wireguard wireguard []

Available subcommands:

list
Show all configured WireGuard services.
show
Show the WireGuard service with name .
new
Create a new WireGuard service with name .
del
Delete the configured WireGuard service with name .
set [local-ip ] [private-key] [mtu ] [dns [,]…]
[peer [remove]
[endpoint /:]
[preshared-key]
[allowed-ips /[,/]…]
[persistent-keepalive ] ]…
Configure properties for the WireGuard service with name . Most options should
have the same meaning and usage as in wireguard-tools (and wg-quick). Exceptions
are:
– Only IPv4 is supported for the VPN overlay, so local-ip, dns, and allowed-ips
should be set to IPv4 address(es).
– If dns is not set, it will be defaulted to “8.8.8.8,8.8.4.4”.
– If mtu is not set, it will be determined automatically. Set it to 0 to reset the
existing value.
endpoint must be set before using connect command.
private-key and preshared-key take no parameters. If they are used, this command
will prompt you to change the key (or remove the key) via stdin, to avoid leaving
them in the history of shell.
connect
Connect to the configured WireGuard service with name .
disconnect
Disconnect from the configured WireGuard service with name .

Utility to configure and control a WireGuard VPN service

コメント

タイトルとURLをコピーしました