タグ

関連タグで絞り込む (1)

タグの絞り込みを解除

shellとcommandに関するsnomofのブックマーク (4)

  • Stop using tail -f (mostly)

    Stop using tail -f (mostly) 12 Mar 2015 I still see a lot of people using tail -f to monitor files that are changing, mostly log files. If you are one of them, let me show you a better alternative: less +F The less documentation explains well what this +F is all about: Scroll forward, and keep trying to read when the end of file is reached. Normally this command would be used when already at the e

  • rupa/z: z - jump around

    Z(1) User Commands Z(1) NAME z - jump around SYNOPSIS z [-chlrtx] [regex1 regex2 ... regexn] AVAILABILITY bash, zsh DESCRIPTION Tracks your most used directories, based on 'frecency'. After a short learning phase, z will take you to the most 'frecent' directory that matches ALL of the regexes given on the command line, in order. For example, z foo bar would match /foo/bar but not /bar/foo. OPTIONS

    rupa/z: z - jump around
    snomof
    snomof 2014/06/14
    ディレクトリの履歴を参照して、カレントディレクトリ以下の深いディレクトリに一気に飛べるコマンド。名前は最悪
  • seq で 0 padding した数字列を作る

    Linux の seq コマンドは、シンプルな数列を作ってくれる。例えば、1 から 10 までの数字を表示させるには次のやうにする。 $ seq 10 1 2 3 4 5 6 7 8 9 10 途中の数字から始めたい場合は、その数字を第一引数にとる。5 から 10 までの数字列を得る場合の例は次の通り。 $ seq 5 10 5 6 7 8 9 10 このコマンドを何に使うのかというと、shell script の中で連番ファイルを作成するのに活用する。例えば、こんな感じ。 #!/bin/bash for i in `seq 10`; do echo $i.jpg done echo コマンドの代わりに、wget を使えば、連番ファイルのダウンロード。touch コマンドを使えば、連番ファイルの作成。etc... さて、10 個以上の連番ファイルを作る場合、0 パディングを加えておくと便利

  • 【 nohup 】 ログアウトした後もコマンドを実行し続ける

    nohupでコマンドを実行した場合は,ログアウトしてもプログラムを実行し続ける。長い処理を行っており,席を外したいときなどに使用すると便利である。ログアウトした後は,ジョブではなくプロセスとして管理することになる。また,処理中に出力されたメッセージは"nohup.out"に保存される。 grepをlogout後も継続して実行し続ける $ nohup grep "Jan" access_log > result & [1] 3769 nohup: appending output to `nohup.out' $ exit logout. ←ログアウトしても実行し続ける

    【 nohup 】 ログアウトした後もコマンドを実行し続ける
  • 1