Skip to content

Instantly share code, notes, and snippets.

@aalin
Created March 8, 2010 13:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aalin/325164 to your computer and use it in GitHub Desktop.
Save aalin/325164 to your computer and use it in GitHub Desktop.
# watch for new files in /tmp/
def clear
puts "\e[H\e[2J"
end
hostname = `hostname`.strip
loop do
clear
puts [hostname, Time.now].join(" - ")
Dir['/tmp/*'].sort.each do |filename|
stat = File.stat(filename)
puts "%-40s %15d %s" % [filename, stat.size, stat.ctime.to_s]
end
sleep 0.5
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment