Sponsored Content
Homework and Emergencies Homework & Coursework Questions Display sorted list using sed command Post 302788991 by Yoda on Tuesday 2nd of April 2013 10:07:20 PM
Old 04-02-2013
Yes it does make sense. Good work!

By the way if there are multiple sessions from same user, you can use sort to get rid of duplicates. Check the sort man pages to understand how to get unique values.
Code:
man sort

This User Gave Thanks to Yoda For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Trying to get list of logged on users sorted

I'm trying to execute a single shell command that will give me a sorted list of all the users currently logged into the system, displaying the users name as it appears in /etc/passwd. I've tried awk -F: '{print $1}' /etc/passwd | xargs finger -s | cut -c11-28 | uniq This list whoever does... (7 Replies)
Discussion started by: kungfuice
7 Replies

2. UNIX for Dummies Questions & Answers

Need to display sorted output on 1 line!

#!/bin/bash { && ; } || { echo "Must enter between 1 and 5 parameters" exit 1 } for P do echo $P >> /tmp/task3 done echo "SORTED: $(sort -n -r /tmp/task3)" rm -f /tmp/task3 (2 Replies)
Discussion started by: knc9233
2 Replies

3. Shell Programming and Scripting

Sorted list by time of spu processing

Hi, i have to make a command in unix system which make a sorted list by cpu time (not %cpu ). If the application exists more than a time I would like to keep only one copy. Could you help me please ??? P.s : I am trying --> ps aux --sort -%cpu | uniq but I understand that is wrong (5 Replies)
Discussion started by: petros55
5 Replies

4. UNIX for Dummies Questions & Answers

write a program in c in unix that display the files(includ sub-direc and files within) in a sorted

the sorting is based on name of file, file size modification time stamps o f file it should dislay the output in the following format "." and ".." enteries should be ignored please give some idea how to do it (1 Reply)
Discussion started by: pappu kumar jha
1 Replies

5. Shell Programming and Scripting

using sed command to display contents where line numbers are stored in variables

if i want to display the contents of a file between say line number 3 and 10 then i use the following command sed -n '3,10p' filename if this 3 was contained in x and 10 was contained in y then how wud this command modified? sed -n '$x,$yp' filename does not work..please advise (2 Replies)
Discussion started by: arindamlive
2 Replies

6. Shell Programming and Scripting

Match and insert in a sorted list

I have a sorted list (python) and I want to insert a string if it matches the pattern in list. Example : Sorted List Above list is in sorted order. I need to insert a name in sorted order and also if the name already exist then it should be inserted before the existing... (1 Reply)
Discussion started by: pratapsingh
1 Replies

7. Shell Programming and Scripting

Display date in mm/dd/yy format in sed command

Hi All, Following is my issue. $MAIL_DOC = test.txt test.txt contains the following text . This process was executed in the %INSTANCE% instance on %RUNDATE%. I am trying to execute the following script var=`echo $ORACLE_SID | tr ` NOW=$(date +"%D") sed -e... (3 Replies)
Discussion started by: megha2525
3 Replies

8. Shell Programming and Scripting

Inserting lines from one file to a sorted list

Hello friends! I am working a Psychology/Neuro* project where I am sorting inline citations by category. The final step of the process has me a little stuck. I need to take citations from a text list and sort them in another text file. Here is a file X example... (1 Reply)
Discussion started by: danbroz
1 Replies

9. UNIX for Beginners Questions & Answers

UNIX command to display Owner,Group,Root and Subdirectories list

Hi Team, Am a newbie to Unix. As I would like to see the Server Name,Owner Name ( not numeric form), Group Name ( not numeric ID), ROOT path. I would like to send this list as an attachment to my personal mail. Can any one please help me out to to resolve this . Here is the sample result... (6 Replies)
Discussion started by: vasuvv
6 Replies

10. HP-UX

Display SAM user list at the command line

Hello, I've been doing Linux and AIX administration for years, but I'm very new to HPUX. We have an old audit process which involves someone manually using sam to generate user lists. I'd like to kill that old process with fire... But... After working a bit in the morning to try and pull... (3 Replies)
Discussion started by: Celt1977
3 Replies
SLABTOP(1)							Linux User's Manual							SLABTOP(1)

NAME
slabtop - display kernel slab cache information in real time SYNOPSIS
slabtop [ options ] DESCRIPTION
slabtop(1) displays detailed kernel slab cache information in real time. It displays a listing of the top caches sorted by one of the listed sort criteria. It also displays a statistics header filled with slab layer information. OPTIONS
Normal invocation of slabtop(1) does not require any options. The behavior, however, can be fine-tuned by specifying one or more of the following flags: --delay=n, -d n Refresh the display every n seconds. By default, slabtop(1) refreshes the display every three seconds. To exit the program, hit q. --sort=S, -s S Sort by S, where S is one of the sort criteria. --once, -o Display the output once and then exit. --version, -V Display version information and exit. --help Display usage information and exit. SORT CRITERIA
The following are valid sort criteria used to sort the individual slab caches and thereby determine what are the "top" slab caches to dis- play. The default sort criteria is to sort by the number of objects ("o"). The sort criteria can also be changed while slabtop is running by pressing the associated character. a: sort by number of active objects b: sort by objects per slab c: sort by cache size l: sort by number of slabs v sort by number of active slabs n: sort by name o: sort by number of objects p: sort by pages per slab s: sort by object size u: sort by cache utilization COMMANDS
slabtop(1) accepts keyboard commands from the user during use. The following are supported. In the case of letters, both cases are accepted. Each of the valid sort characters are also accepted, to change the sort routine. See the section SORT CRITERIA. <SPACEBAR> Refresh the screen. Q Quit the program. FILES
/proc/slabinfo -- slab information SEE ALSO
free(1), ps(1), top(1), vmstat(8) NOTES
Currently, slabtop(1) requires a 2.4 or later kernel (specifically, a version 1.1 or later /proc/slabinfo). Kernel 2.2 should be supported in the future. The slabtop statistic header is tracking how many bytes of slabs are being used and it not a measure of physical memory. The 'Slab' field in the /proc/meminfo file is tracking information about used slab physical memory. AUTHORS
Written by Chris Rivera and Robert Love. slabtop(1) was inspired by Martin Bligh's perl script, vmtop. The procps package is maintained by Albert Cahalan <albert@users.sf.net>. Please send bug reports to <procps-feedback@lists.sf.net>. Linux 13 Sep 2003 SLABTOP(1)
All times are GMT -4. The time now is 04:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy