【Linux】標準的なLinuxコマンドとその出力
PUBLISHED 2023-09-03
UPDATED 2024-08-13
ファイル操作
-
lsディレクトリの内容をリスト表示します$ ls file1.txt file2.txt dir1/ -
pwd現在の作業ディレクトリを表示します$ pwd /home/user
テキスト操作
-
catファイルの内容を表示します$ cat file1.txt This is the content of file1. -
headファイルの先頭部分を表示します$ head file1.txt First line of the file. -
tailファイルの末尾部分を表示します$ tail file1.txt Last line of the file.
システム情報
-
uname -aシステム情報を表示します$ uname -a Linux hostname 5.4.0-42-generic #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux -
freeメモリ使用状況を表示します$ free -h total used free shared buff/cache available Mem: 7.7Gi 1.2Gi 5.8Gi 123Mi 717Mi 6.2Gi Swap: 2.0Gi 0B 2.0Gi
ネットワーキング
-
pingネットワーク接続をテストします$ ping -c 4 google.com PING google.com (172.217.22.14) 56(84) bytes of data. 64 bytes from fra15s11-in-f14.1e100.net (172.217.22.14): icmp_seq=1 ttl=53 time=29.3 ms ...
その他
-
echoテキストを表示します$ echo "Hello, World!" Hello, World! -
historyコマンド履歴を表示します$ history 1 ls 2 cd .. 3 pwd ...