memo.xight.org

Home > Changelogメモ > Shell Script > 1ページ目 (全1ページ)
ChangeLog 最新ページ
2008-09 / 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30

2005-11-07 Mon

Adjust Clock

- Source

#!/bin/sh
# Adjust Clock
#    Yoshiki SATO [2002/02/03]
/usr/sbin/ntpdate 133.100.9.2
/bin/sleep 3
/sbin/hwclock --systohc
echo "Hardware Clock : `hwclock --show`"

カテゴリ: [Shell Script]

2005-01-03 Mon

シェルスクリプト リファレンス & Tips

- Reference
  シェルスクリプト リファレンス & Tips
  http://www.rhythm-cafe.com/kb/shell/

カテゴリ: [Shell Script]

2004-10-25 Mon

シェルスクリプトの基礎

- Reference
  Running System V - シェルスクリプトの基礎
  http://warp.syns.net/10/

カテゴリ: [Shell Script]

2004-05-31 Mon

秒間隔でコマンドを繰り返し実行し続ける

- Summary
  netstat -i を1秒間隔で自動実行
- while と sleep を使ってシェルスクリプトを書く

$ while true; do date; netstat -i; sleep 1; clear; done;


- watch コマンドを使う

$ watch --interval 1 netstat -i


- Reference
  Landscape - 2004-05-28
  http://sonic64.com/2004-05-28.html#2004-05-28-1

カテゴリ: [Shell Script]

2004-05-31 Mon

ディレクトリ中のファイルサイズ合計値を バイト表示

- Summary
  Windowsのフォルダのプロパティ表示のように,ファイルサイズの合計値などを表示させたい.
  duではファイルが使用しているブロックサイズを表示するのでダメ.

- ファイルの個数 と ファイルサイズを表示.ファイルサイズは3桁ごとにカンマで区切る.

$ find -type f -printf "%s\n" |perl -ne '$i++; $byte += $_; $str = "\r$i files, $byte byte"; $str =~ s/(\d{1,3})(?=(?:\d\d\d)+(?!\d))/$1,/g; print $str'


- Reference
  Landscape - 2004-05-26
  http://sonic64.com/2004-05-26.html#2004-05-26-1

カテゴリ: [Shell Script]
2008-09 / 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
最終更新時間: 2008-09-05 14:14

Color Reference

ChangeLogを検索
携帯電話からアクセス!

カテゴリ

最近の話題

リンク

過去ログ

Google

QR Code

Since
2002-11-28
Update
2008-09-05 14:14
Copyright © 2005 xight.org All Rights Reserved.