Sponsored Content
Full Discussion: Grep and Sort
Homework and Emergencies Homework & Coursework Questions Grep and Sort Post 302787619 by Jagst3r21 on Saturday 30th of March 2013 12:35:43 AM
Old 03-30-2013
Oh, sorry, it sounded like you were asking me what those things were because you didn't know (which you obviously do, so my apologies). I know that "Who" is a command that lists the users currently on the server and piping uses | to create a sequence of commands.

So for #2, maybe something like:

Code:
sort -n | who

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Sort/Grep Question

Hello all, I have a test file that has the format: ..... O 3.694950 -.895050 1.480000 O 5.485050 .895050 1.480000 Ti -4.590000 4.590000 2.960000 Ti -2.295000 ... (5 Replies)
Discussion started by: aarondesk
5 Replies

2. Shell Programming and Scripting

how to grep sort userids

hello folks i have a file that have data like /test/aa/123 /test/aa/xyz /test/bb/xyz /test/bb/123 in above lines i just wants to grep "aa" and "bb". Thanks, Bash (4 Replies)
Discussion started by: learnbash
4 Replies

3. Shell Programming and Scripting

history awk grep sort

can someone help me in the awk part...little confuse on that part. The problem is this: what input each utility gets and what it does with data and what output is provides to the next utility) history | awk '{a++}END{for(i in a){print a " " i}}' | sort -rn | grep '^' Thanks (4 Replies)
Discussion started by: Learnerabc
4 Replies

4. Shell Programming and Scripting

Grep empty space and sort

Hi Expert, Kindly request for your expertise in this matter. I have below output: 12.125.124.173,xx1.common.com 12.125.124.174,xx2.common.com 12.125.124.175,xx3.common.com 12.125.124.176, 12.125.124.177, 12.125.124.178, 12.125.124.179,xx4.common.com 12.125.124.180,xx5.common.com... (8 Replies)
Discussion started by: regmaster
8 Replies

5. Programming

[ask]SQL command act like sort and grep

for example, I have a text file in random content inside, maybe something like this. 234234 54654 123134 467456 24234234 7867867 23424 568567if I run this command cat "filename.txt" | sort -n | grep "^467456$" -A 1 -B 1the result is 234234 467456 568567is it possible to do this command... (2 Replies)
Discussion started by: 14th
2 Replies

6. Shell Programming and Scripting

grep from 3 lines and sort

Pseudo name=hdiskpower54 Symmetrix ID=000190101757 Logical device ID=0601 state=alive; policy=SymmOpt; priority=0; queued-IOs=0 ============================================================================== ---------------- Host --------------- - Stor - -- I/O Path - -- Stats --- ### HW... (7 Replies)
Discussion started by: Daniel Gate
7 Replies

7. Shell Programming and Scripting

How to sort grep result based on timestamp?

Hi, Trying to sort grep result based on timestamp of the filename. I have the following result and want to sort them on timestampgrep -i 'ERROR' *log*2013* s_m_xxx_xxx_xxx_xxx_xxxx.log.20130906092431:TRANSF_1_1_1> DBG_21216 Finished transformations for Source Qualifier . Total errors ... (5 Replies)
Discussion started by: bobbygsk
5 Replies

8. Homework & Coursework Questions

awk questions using sort and grep

1. The problem statement, all variables and given/known data: So i'll probably get told off for this but I have a few problems and rather than clog up the whole forum I'll post them here. Please bare in mind I am a complete novice when it comes to all this and so if you help please treat me like a... (4 Replies)
Discussion started by: jamesb18
4 Replies

9. Homework & Coursework Questions

awk with Grep and Sort

1. The problem statement, all variables and given/known data: Please bare in mind I am a complete novice to this and have very very basic knowledge so please keep any answers as simple as possible and explain in terms I will understand ahha :):) I have a text file of names and test scores... (1 Reply)
Discussion started by: jamesb18
1 Replies

10. Shell Programming and Scripting

Grep -v -f and sort|diff which way is faster

Hi Gurus, I have two big files. I need to compare the different. currently, I am using sort file1 > file1_temp; sort file2 > file2_tmp diff file1_tmp file2_tmp I can use command grep -v -f file1 file2 just wondering which way is fast to compare two big files. Thanks... (4 Replies)
Discussion started by: ken6503
4 Replies
ruptime(1c)															       ruptime(1c)

Name
       ruptime - show host status of local machines

Syntax
       ruptime [ options ] [ machinename ]

Description
       The  command  gives  a  status  line  like  for each machine on the local network.  If a machinename is given, the status of only the named
       machine is given.  These status lines are formed from packets broadcast by each host on the network once a minute.

       Machines for which no status report has been received for 5 minutes are shown as being down.

Options
       -a   Users idle an hour or more are not counted unless this option is specified.

       -d   Display only those hosts that are considered down.

       -l   Sort the status list by load average.  If more than one sort option is given, uses the last one.

       -r   Show only hosts that are up and running.

       -t   Sort the status list by uptime.  If more than one sort option is given, uses the last one.

       -u   Sort the status list by number of users.  If more than one sort option is given, uses the last one.

       -nn  Show only those hosts with nn or more users.

Restrictions
       Because the daemon sends its information in broadcast packets it generates a large amount of network traffic.  On large networks the  extra
       traffic	may  be  objectionable.   Therefore,  the  daemon is disabled by default.  To make use of the daemon for both the local and remote
       hosts, remove the comment symbols (#) from in front of the lines specifying in the file.

       If the daemon is not running on a remote machine, the machine may incorrectly appear to be down when you use the command to  determine  its
       status.	See the reference page for more information.

       If  a  system  has  more  than 40 users logged in at once, the number of users displayed by the command is incorrect.  Users who login to a
       machine after that point fail to increment the user count that appears in the output of the command.  This is due to the maximum size limit
       of an Ethernet packet, which is 1500 bytes, and the fact that the daemon must broadcast its information in a single packet.

Files
       /usr/spool/rwho/whod.*	Information about other machines

See Also
       rwho(1c), rwhod(8c)

																       ruptime(1c)
All times are GMT -4. The time now is 07:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy