ls ファイル一覧表示
cp コピー
mv 移動 / 名前変更
mkdir ディレクトリ作成
rm ファイル削除(※危険)
rmdir 空ディレクトリ削除
touch 空ファイル作成 / タイムスタンプ更新
file ファイルの種類判別
find ファイル検索(条件指定)
gzip 圧縮(元ファイル消える)
bzip2 高圧縮(gzipより遅いが圧縮率高い)
gunzip gzip解凍
bunzip2 bzip2解凍
xz 高圧縮(さらに圧縮率高い)
tar アーカイブ作成・展開(圧縮は別)
dd 低レベルコピー(ディスク/データ丸ごと)

名前 意味 語源
ls ファイル一覧表示 list
cp コピー copy
mv 移動 / 名前変更 move
mkdir ディレクトリ作成 make directory
rm ファイル削除(※危険) remove
rmdir 空ディレクトリ削除 remove directory
touch 空ファイル作成 / タイムスタンプ更新 touch(触れる=更新時刻に触れる)
file ファイルの種類判別 file
find ファイル検索(条件指定) find
gzip 圧縮(元ファイル消える) GNU zip
bzip2 高圧縮(gzipより遅いが圧縮率高い) Burrows-Wheeler zip 2
gunzip gzip解凍 GNU unzip
bunzip2 bzip2解凍 Burrows-Wheeler unzip 2
xz 高圧縮(さらに圧縮率高い) XZ Utilsの圧縮形式名
tar アーカイブ作成・展開(圧縮は別) tape archive
dd 低レベルコピー(ディスク/データ丸ごと) data definition / dataset definition 由来とされる
名前 意味
* 0文字以上の任意の文字列に一致 ls *.txt
? 任意の1文字に一致 ls file?.txt
{} 複数の文字列候補を展開 touch file{1,2,3}.txt
[] 指定した文字のどれか1文字に一致 ls file[123].txt
書き方 意味
find 検索場所 条件 指定した場所から条件に合うファイルを検索 find /home -name "*.txt"
-name ファイル名で検索 find . -name "test.txt"
-type f 通常ファイルを検索 find . -type f
-type d ディレクトリを検索 find . -type d
-type l シンボリックリンクを検索 find . -type l
-atime 最終アクセス日時で検索 find . -atime -7
-mtime 最終更新日時で検索 find . -mtime -7
-size サイズで検索 find . -size +100M
-user 所有者で検索 find . -user taro
-perm 権限で検索 find . -perm 755
-print 見つかったファイル名を表示(デフォルト) find . -name "*.txt" -print
-ls 詳細情報付きで表示 find . -name "*.txt" -ls
-exec 見つけたファイルにコマンドを実行 find . -name "*.log" -exec rm {} \;
-ok 確認してからコマンド実行 find . -name "*.log" -ok rm {} \;
書き方 意味
gzip ファイル名 gzip形式で圧縮(元ファイルは消える) gzip test.txt
gzip -d 解凍 gzip -d test.txt.gz
gzip -c 結果を標準出力へ出す(リダイレクトで元ファイルを残せる) gzip -c test.txt > test.txt.gz
gzip -k 元ファイルを残して圧縮 / 解凍 gzip -k test.txt
gzip -r ディレクトリ内のファイルを再帰的に圧縮 gzip -r logs
gunzip ファイル名.gz gzip形式のファイルを解凍 gunzip test.txt.gz
bzip2 ファイル名 bzip2形式で圧縮(元ファイルは消える) bzip2 test.txt
bzip2 -d 解凍 bzip2 -d test.txt.bz2
bzip2 -c 結果を標準出力へ出す(リダイレクトで元ファイルを残せる) bzip2 -c test.txt > test.txt.bz2
bzip2 -k 元ファイルを残して圧縮 / 解凍 bzip2 -k test.txt
bunzip2 ファイル名.bz2 bzip2形式のファイルを解凍 bunzip2 test.txt.bz2
xz ファイル名 xz形式で圧縮(元ファイルは消える) xz test.txt
xz -d 解凍 xz -d test.txt.xz
xz -k 元ファイルを残して圧縮 / 解凍 xz -k test.txt
xz -l xzファイルの情報を表示 xz -l test.txt.xz
unxz ファイル名.xz xz形式のファイルを解凍 unxz test.txt.xz
書き方 意味 語源
tar -c アーカイブを作成 create
tar -x アーカイブを展開 extract
tar -t アーカイブの中身を一覧表示 table of contents
tar -f アーカイブファイル名を指定 file
tar -z gzip形式を使用 gzip
tar -j bzip2形式を使用 bzip2
tar -J xz形式を使用 xz
tar -v 処理中のファイル名を表示 verbose
tar -u アーカイブ内より新しいファイルだけ追加・更新 update
tar -r アーカイブにファイルを追加 append / add to end
tar -N 指定日付より新しいファイルだけ対象 newer
tar --delete アーカイブ内のファイルを削除 delete
書き方 意味 語源
dd 低レベルコピーを行う data definition / dataset definition 由来とされる
if= 入力元ファイルを指定 input file
of= 出力先ファイルを指定 output file
bs= 一度に読み書きするブロックサイズを指定 block size
count= コピーするブロック数を指定 count
Stay In Touch

Be the first to know about new arrivals and promotions