LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 12-15-2004, 09:06 AM   #1
dvm
Member
 
Registered: Sep 2004
Posts: 62

Rep: Reputation: 15
what type does shutdown use to store seconds?


I want to shutdown the pc in 12-13 hours, so we're talking about 43800 seconds. Does shutdown use an int or a short int? I wouldn't want an overflow

Also, I remember reading about a command giving the first 10 lines from long lines of input. Can someone tell me which one was? Thanks
 
Old 12-15-2004, 09:31 AM   #2
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,990

Rep: Reputation: 67
The shutdown command uses minutes, not seconds, so you should be safe from overflows either way.

With the shutdown command, you can either specify the time as HH:MM (giving the clock time, not the length of time to wait), or as +690 to mean “wait 690 minutes from now”

The other command you're looking for is probably head, although it defaults to 20 lines.
Code:
 cat somelongfile | head -n 10
will do the job. There's also a similar tail command that outputs the last lines.
 
Old 12-15-2004, 09:35 AM   #3
dvm
Member
 
Registered: Sep 2004
Posts: 62

Original Poster
Rep: Reputation: 15
Thanks, I hastilly looked at the man page, saw the -t sec option and thought, hmm, it's in seconds. I think I had read about tail, but head will do just as well. Thanks a lot
 
Old 12-15-2004, 09:44 AM   #4
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,990

Rep: Reputation: 67
The -t option is given to init, which can be used for an additional wait. Basically this can be used to give you shutdown resolution down to a second if you need it. e.g.:
Code:
shutdown -t2 00:01
This will start shutting down at two seconds past one minute past midnight.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
convert total no of seconds in the format hour minutes and seconds suchi_s Programming 15 03-15-2011 11:34 AM
installing redhat 8.0 when text login in I cannot type password?? I type root scrist Linux - General 4 04-22-2006 02:20 AM
arrays of elements with [gcc4]array type has incomplete element type lmmix Linux - Software 0 02-26-2005 08:07 AM
'alsactrl store' doesn't seem to store... endfx Slackware 1 08-20-2004 01:30 AM
wait for x seconds type command sub-genius Slackware 1 07-14-2003 07:11 PM


All times are GMT -5. The time now is 01:21 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration