タグ

2015年11月27日のブックマーク (2件)

  • 『[Linux] ファイルサイズを取得する。』

    Linux のコマンドのみを利用して特定のファイルのサイズを取得するにはどうすればよいのでしょうか? コマンド一発では無理なようですが(...と思っていたのですが、実は...追記参照)、以下のように wc コマンド(または ls コマンド)と awk コマンド(または cut コマンド)を組み合わせれば可能なようです。 【方法1】 wc -c test.txt | awk '{print $1}' -c オプション付きの wc コマンドでファイルのバイト数・ファイル名を出力し、awk コマンドでバイト数のフィールドだけを抜き出して出力しています。 【方法2】 wc -c test.txt | cut -d ' ' -f1 - -c オプション付きの wc コマンドでファイルのバイト数・ファイル名を出力し、cut コマンドでバイト数のフィールドだけを抜き出して出力しています。 【方法3】 l

    『[Linux] ファイルサイズを取得する。』
    embedded
    embedded 2015/11/27
    コマンド一発でファイルサイズを取得する方法。wc -c < test.txt
  • Managing flash storage with Linux

    Note: this article was first written for the German edition of Linux Magazine, and was later posted in the English edition too. We negotiated the right to publish it on our blog after the print editions. Here is the original version (the paper versions were modified by the editors to make them more concise). In the family tree of computers, personal computers (PCs) are the parents, while the child

    Managing flash storage with Linux
    embedded
    embedded 2015/11/27
    MTD, UBIFS