LoginSignup
0
0

More than 3 years have passed since last update.

Unixコマンド:よく使うもの一覧

Last updated at Posted at 2015-12-31

※個人で管理しているHPに引っ越ししました。
リンク切れ等考慮して本ページは残しておきますが、今後はHPのほうで更新します。

よく忘れるので、思いついたのを書いていきます。

フォルダ以下にあるファイル名一覧書き出し

下記は、Testフォルダ以下の、[*.jpg]ファイルをlist_jpg.txtに書き出しています。

コマンド
$ cd /Users/Test/
$ find . -name "*.jpg" > list_jpg.txt
出力例(list_jpg.txt)
./test1.jpg
./test2.jpg

フォルダ以下にあるファイルを同じコマンド実行

下記は、Testフォルダ以下の、[*.jpg]ファイルを削除しています。

コマンド
$ cd /Users/Test/
$ find . -name "*.jpg" -print0 | xargs -0 rm

バイナリファイル表示

下記は、jpgファイルをバイナリ(16進数)表示しています。
moreとする事により、画面に表示する分のみ表示されるため、もの凄いデータ量を一気に捌かなくても良くなります。
※最初の頭だけ見たいとかに使えます。

オプション 説明
-c 文字
-h 16進数
コマンド
$ cd /Users/Test/
$ od -h test1.jpg | more
0
0
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
0
0