タグ

unixに関するmura-_-miのブックマーク (2)

  • 技術メモ帳 - pgrep, pkill を使用してプロセスを殺す

    最近、会社でシェルの操作方法について教えているのだが、 pgrep / pkill / skill / pidof といった 便利なプロセス操作系コマンドを知らない人が実に多い。 プロセスを殺すというのは、よくある作業なので 今回はコレについて書いてみる。 たとえば、これらのコマンドを知らない人が、 指定した名前のプロセスを kill する手順はだいたい 以下のようなものになることだろう。 $ ps aux | grep プロセス名 | grep -v 'grep' # コマンドの出力結果から pid を目で確認 12345 ... .. hoge .. .. $ kill 12345 この作業は非常に面倒で退屈だ。 もし殺さなければならないプロセスがたくさんあったときは どうするのだろうか。 おまけに、grep コマンド自身が候補に含まれてしまう事があるのだが、 grep -v grep

    mura-_-mi
    mura-_-mi 2017/05/30
    ps aux | grep hogehoge とかやらなくても
  • q - Text as Data

    q - Run SQL directly on CSV or TSV files¶ Overview¶ q's purpose is to bring SQL expressive power to the Linux command line by providing easy access to text as actual data, and allowing direct access to multi-file sqlite3 databases. q <flags> <sql-query> q allows the following: Performing SQL-like statements directly on tabular text data, auto-caching the data in order to accelerate additional quer

    q - Text as Data
    mura-_-mi
    mura-_-mi 2016/10/17
    先輩が使ってて便利そうだった
  • 1