タグ

grepとawkに関するnabinnoのブックマーク (2)

  • Find and kill a process in one line using bash and regex

    I often need to kill a process during programming. The way I do it now is: [~]$ ps aux | grep 'python csp_build.py' user 5124 1.0 0.3 214588 13852 pts/4 Sl+ 11:19 0:00 python csp_build.py user 5373 0.0 0.0 8096 960 pts/6 S+ 11:20 0:00 grep python csp_build.py [~]$ kill 5124 How can I extract the process id automatically and kill it in the same line? Like this: [~]$ ps aux | grep 'python csp_build.

    Find and kill a process in one line using bash and regex
  • AWK - Wikipedia

    AWK(オーク)は、プログラミング言語の一つ。 テキストファイル、特に空白類(スペースの他、タブなど)やカンマなどで区切られたデータファイルの処理を念頭に置いた仕様となっているが、一般的なプログラミングに用いることも可能である。UNIX上で開発された。 概要[編集] AWKは、ベル研究所におけるUNIX開発の過程で、sedやgrepのようなテキスト処理ツールに演算機能を持たせた拡張ツールとして1977年[1]に開発された。そのため、UNIX上のユーティリティである sort の存在を前提としている[1]。 簡単なスクリプトを記述することで効率的にテキストファイルを処理することが目的であった。 当初はそれほど多くの機能は無かったが、普及するにつれ、さまざまな処理をAWKで実行したいと考えるユーザーが増え、その希望に応えて1985年[1]に機能の拡張が行われた。その結果、汎用のプログラミング言

    AWK - Wikipedia
  • 1