12-04-2012
Single UNIX command to display users and to count them
Hello everyone,
I am new to Unix and I am stuck with a problem. I need only a single command to display the output of who and then add the total number of users and display at the bottom of that output.
Example-: (Expected output)
sreyan@debian:~$ <command>
sreyan tty7 2012-12-04 05:50 (:0)
sreyan pts/0 2012-12-04 05:51 (:0.0)
1
By the way I am using Debian 6.0.5 (64-bit). Thank You.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
I have problem in writing the shell script involving MPE command STREAM related to HP-UX and Unix command. Script is
sh "nlshCMD 'STREAM <job name1>' | 'SHOWJOB' | grep $HPJOBNUM"
sh "nlshCMD 'STREAM <job name2>' | 'SHOWJOB' | grep $HPJOBNUM"
sh "nlshCMD 'STREAM <job name3>' |... (0 Replies)
Discussion started by: bosskr
0 Replies
2. HP-UX
Hello,
I have problem in writing the shell script involving MPE command STREAM related to HP-UX and Unix command. Script is
sh "nlshCMD 'STREAM <job name1>' | 'SHOWJOB' | grep $HPJOBNUM"
sh "nlshCMD 'STREAM <job name2>' | 'SHOWJOB' | grep $HPJOBNUM"
sh "nlshCMD 'STREAM <job name3>' |... (1 Reply)
Discussion started by: bosskr
1 Replies
3. UNIX for Dummies Questions & Answers
Hi everybody..
I need to enter in bash mode and then run a command and this just in a single command line.
I tried : "bash ^M| somecommand" but nothing..
How do I do to simulate the return button just right after the bash command ?
Thanks.. (8 Replies)
Discussion started by: Riddick61
8 Replies
4. Shell Programming and Scripting
Hi
I want to display "echo command value in loop" in single line. My requirement is to show the input file (test_1.txt) like the output file (test_2.txt) given below.
Input file :test_1.txt
a1|b1|4|5
a1|b1|42|9
a2|b2|32|25
a1|b1|2|5
a3|b3|4|8
a2|b2|14|6
Output file:test_2.txt... (2 Replies)
Discussion started by: sakthifire
2 Replies
5. UNIX for Dummies Questions & Answers
Hi ,
Can You Please let Know How use unix uniq command on a single column for deleting records from file
with Below Structure.Pipe Delimter File .
Source
Name | Account_Id
A | 101
B... (2 Replies)
Discussion started by: anudeepkumar123
2 Replies
6. Shell Programming and Scripting
HTML Code
archive_history() { HISTORYOLD=${HISTFILE}.archive CURTIME=`date` CURTTY=`tty` IP=$(echo $SSH_CLIENT | awk '{print $1}') if ; then echo "#-${HOSTNAME}-- ${CURBASHDATE} - ${CURTIME} ($CURTTY) ${USER} ${IP}----" >> $HISTORYOLD history... (2 Replies)
Discussion started by: rehantayyab82
2 Replies
7. Shell Programming and Scripting
HTML Code:
archive_history() { HISTORYOLD=${HISTFILE}.archive CURTIME=`date` CURTTY=`tty` IP=$(echo $SSH_CLIENT | awk '{print $1}') if ; then echo "#-${HOSTNAME}-- ${CURBASHDATE} - ${CURTIME} ($CURTTY) ${USER} ${IP}----" >> $HISTORYOLD history... (0 Replies)
Discussion started by: rehantayyab82
0 Replies
8. UNIX for Dummies Questions & Answers
Hi all,
How can i display the middle line of a file using a single line command? (6 Replies)
Discussion started by: Lakme Pemmaiah
6 Replies
9. UNIX for Beginners Questions & Answers
Hello Experts,
I have a log file that contains 4 different type of exception :
1- Exception
2- Fatal
3- Error
4- Exec
My requirement is to find count of each type of exception, i tried using combination of -E and -C but that doesn't seems to be working :
grep -ec 'Exception' -ec... (4 Replies)
Discussion started by: mukulverma2408
4 Replies
10. UNIX for Beginners Questions & Answers
Hi,
I have a file with a list of bunch of IP addresses from different VLAN's . I am trying to find the list the number of each vlan occurence in the output
Here is how my file looks like
1.1.1.1
1.1.1.2
1.1.1.3
1.1.2.1
1.1.2.2
1.1.3.1
1.1.3.2
1.1.3.3
1.1.3.4
So what I am trying... (2 Replies)
Discussion started by: new2prog
2 Replies
LEARN ABOUT POSIX
pts_help
PTS_HELP(1) AFS Command Reference PTS_HELP(1)
NAME
pts_help - Displays help for pts commands
SYNOPSIS
pts help [-topic <help string>+] [-help]
pts h [-t <help string>+] [-h]
DESCRIPTION
The pts help command displays the complete online help entry (short description and syntax statement) for each command operation code
specified by the -topic argument. If the -topic argument is omitted, the output includes the first line (name and short description) of the
online help entry for every pts command.
To list every pts command whose name or short description includes a specified keyword, use the pts apropos command.
OPTIONS
-topic <help string>+
Indicates each command for which to display the complete online help entry. Omit the pts part of the command name, providing only the
operation code (for example, specify "membership", not "pts membership"). If this argument is omitted, the output briefly describes
every pts command.
-help
Prints the online help for this command. All other valid options are ignored.
OUTPUT
The online help entry for each pts command consists of the following two or three lines:
o The first line names the command and briefly describes its function.
o The second line lists aliases for the command, if any.
o The final line, which begins with the string "Usage", lists the command's options in the prescribed order. Online help entries use the
same symbols (for example, brackets) as the reference pages in this document.
EXAMPLES
The following command displays the online help entry for the pts membership command:
% pts help membership
pts membership: list membership of a user or group
aliases: groups
Usage: pts membership -nameorid <user or group name or id>+
[-cell <cell name>] [-noauth] [-force] [-help]
PRIVILEGE REQUIRED
None
SEE ALSO
pts(1), pts_apropos(1)
COPYRIGHT
IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved.
This documentation is covered by the IBM Public License Version 1.0. It was converted from HTML to POD by software written by Chas
Williams and Russ Allbery, based on work by Alf Wachsmann and Elizabeth Cassell.
OpenAFS 2012-03-26 PTS_HELP(1)