05-20-2010
help programming for lognames
Hi all,
I have a requirment , can anyone please guide me
Q) If the number of users are 50 or more it should print the login names of users who have logged in last 5 minutes and login names of users who have logged out in last 5 minutes.
Waiting for the reply
Thank you very much
Uma
10 More Discussions You Might Find Interesting
1. Programming
i am new in linux environment .I have used vi editor of Unix to get a programe compiled through "gcc ".kindly give me the options to get a program compiled & executed written in c on vi editor.
I want the command to compile a file and the command to get that compiled file executed with any... (2 Replies)
Discussion started by: Rajraius
2 Replies
2. Programming
i would like advice on the usbject of c programming (in the middle of reading a book on C). could i benefit more if i apply that knowledge in the unix format if i were able to, or would that take the point out of learning C, basically I want to stay away from strying too far away from unix and use... (1 Reply)
Discussion started by: moxxx68
1 Replies
3. Shell Programming and Scripting
Several months ago I found a link that explained the difference between how a Unix Systems Admin would do scripting compared to what a Unix Programmer would do.
It showed a basic script and then show several iterations that explained how the Systems Admin would change it to make it better. I was... (0 Replies)
Discussion started by: BCarlson
0 Replies
4. Programming
Sorry to ask this question here... where can I find a C++ programming thread? Thanks guys! (7 Replies)
Discussion started by: nadiamihu
7 Replies
5. UNIX for Dummies Questions & Answers
Hello,
I am trying to learn Networking Programming in C in unix enviorment. I want to know how good it is to become a network programmer. i am crazy about Network programming but i also want to opt for the best carreer options. Anybody experienced Network Programmer, please tell me is my... (5 Replies)
Discussion started by: vibhory2j
5 Replies
6. Programming
Can someone help me on suggesting some ways to access the memory content in RAM directly from C/C++ source code.
Please provide me any book name or any URL so that I can get an exhaustive
knowledge over it.
If possible please give me some tips on interacting with hardwares directly
through... (3 Replies)
Discussion started by: nandumishra
3 Replies
7. Shell Programming and Scripting
I have started writing one script. It is not taking the if block.
Here is the script:
#!/bin/sh
set USER='/usr/ucb/whoami'
#######################################################################
#Killing Process
#######################################################################... (6 Replies)
Discussion started by: amarpreetka
6 Replies
8. Programming
for a question like this
Assume you have a server with two clients and two child processes. The server retrieves data from the
children through a pipe (one each) and writes data to the clients through a socket (one each). child1
produces data for client1, and child2 for client2.
Write a C... (4 Replies)
Discussion started by: omega666
4 Replies
9. UNIX for Dummies Questions & Answers
How does unix system administration, unix programming, unix network programming differ?
Please help. (0 Replies)
Discussion started by: thulasidharan2k
0 Replies
10. UNIX for Dummies Questions & Answers
Hello.
I like Linux and C programming language. Allways wanted to understand kernel and become a Linux system programmer. And I also like Objective-C and iOS. These two programming areas have relations:
1. Linux and iOS are UNIX-like systems, POSIX compliant.
2. It is useful to know C language... (2 Replies)
Discussion started by: Rockatansky
2 Replies
LEARN ABOUT FREEBSD
poweroff
SHUTDOWN(8) BSD System Manager's Manual SHUTDOWN(8)
NAME
shutdown, poweroff -- close down the system at a given time
SYNOPSIS
shutdown [-] [-h | -p | -r | -k] [-o [-n]] time [warning-message ...]
poweroff
DESCRIPTION
The shutdown utility provides an automated shutdown procedure for super-users to nicely notify users when the system is shutting down, saving
them from system administrators, hackers, and gurus, who would otherwise not bother with such niceties.
The following options are available:
-h The system is halted at the specified time.
-p The system is halted and the power is turned off (hardware support required) at the specified time.
-r The system is rebooted at the specified time.
-k Kick everybody off. The -k option does not actually halt the system, but leaves the system multi-user with logins disabled (for all
but super-user).
-o If one of the -h, -p or -r options are specified, shutdown will execute halt(8) or reboot(8) instead of sending a signal to init(8).
-n If the -o option is specified, prevent the file system cache from being flushed by passing -n to halt(8) or reboot(8). This option
should probably not be used.
time Time is the time at which shutdown will bring the system down and may be the case-insensitive word now (indicating an immediate shut-
down) or a future time in one of two formats: +number, or yymmddhhmm, where the year, month, and day may be defaulted to the current
system values. The first form brings the system down in number minutes and the second at the absolute time specified. +number may
be specified in units other than minutes by appending the corresponding suffix: ``s'', ``sec'', ``m'', ``min''. ``h'', ``hour''.
warning-message
Any other arguments comprise the warning message that is broadcast to users currently logged into the system.
- If '-' is supplied as an option, the warning message is read from the standard input.
At intervals, becoming more frequent as apocalypse approaches and starting at ten hours before shutdown, warning messages are displayed on
the terminals of all users logged in. Five minutes before shutdown, or immediately if shutdown is in less than 5 minutes, logins are dis-
abled by creating /var/run/nologin and copying the warning message there. If this file exists when a user attempts to log in, login(1)
prints its contents and exits. The file is removed just before shutdown exits.
At shutdown time a message is written to the system log, containing the time of shutdown, the person who initiated the shutdown and the rea-
son. The corresponding signal is then sent to init(8) to respectively halt, reboot or bring the system down to single-user state (depending
on the above options). The time of the shutdown and the warning message are placed in /var/run/nologin and should be used to inform the
users about when the system will be back up and why it is going down (or anything else).
A scheduled shutdown can be canceled by killing the shutdown process (a SIGTERM should suffice). The /var/run/nologin file that shutdown
created will be removed automatically.
When run without options, the shutdown utility will place the system into single user mode at the time specified.
Calling ``poweroff'' is equivalent to running:
shutdown -p now
FILES
/var/run/nologin tells login(1) not to let anyone log in
EXAMPLES
Reboot the system in 30 minutes and display a warning message on the terminals of all users currently logged in:
# shutdown -r +30 "System will reboot"
COMPATIBILITY
The hours and minutes in the second time format may be separated by a colon (``:'') for backward compatibility.
SEE ALSO
kill(1), login(1), wall(1), nologin(5), halt(8), init(8), reboot(8)
HISTORY
The shutdown utility appeared in 4.0BSD.
BSD
December 15, 2014 BSD