03-05-2012
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hi,
i have probleme to extract the columns info from file to another one;
FILE A look like :
x,inof1
y,inof1
z,info2
t,inof3
and FILE B like
x
t
w
d
z
i want to add correpondant columns (info) to each line of FILE B and sort this file by this columns. (12 Replies)
Discussion started by: kamel.seg
12 Replies
2. UNIX for Dummies Questions & Answers
Hello,
I have a header which I have to add to a sorted file, however if I use
cat header sortedfile > newfile, the operation takes 2 minutes as the sorted file is over 400mb.
I have noticed that when I sort the 400mb unsorted file, this only takes 14 seconds to create the output.
As... (2 Replies)
Discussion started by: clarcombe
2 Replies
3. Shell Programming and Scripting
Hi to all.
I'm trying to sort this with the Unix command sort.
user1:12345678:3.5:2.5:8:1:2:3
user2:12345679:4.5:3.5:8:1:3:2
user3:12345687:5.5:2.5:6:1:3:2
user4:12345670:5.5:2.5:5:3:2:1
user5:12345671:2.5:5.5:7:2:3:1
I need to get this:
user3:12345687:5.5:2.5:6:1:3:2... (7 Replies)
Discussion started by: daniel.gbaena
7 Replies
4. UNIX for Dummies Questions & Answers
Hello,
I'm trying to sort a file which has many lines with the sort command.
I'd like to send the sorted content in the same file.
But when I do that, I've the content which is sorted, but all is on one line... I view the content in Notepad++
Could somebody help me to keep the original... (5 Replies)
Discussion started by: tevious
5 Replies
5. UNIX for Advanced & Expert Users
Hello all -
I am to this forum and fairly new in learning unix and finding some difficulty in preparing a small shell script. I am trying to make script to sort all the files given by user as input (either the exact full name of the file or say the files matching the criteria like all files... (3 Replies)
Discussion started by: pankaj80
3 Replies
6. Shell Programming and Scripting
sort --random-sort
The full command is
path=`find /testdir -maxdepth 1 -mindepth 1 -type d | ***Some sort of sort function*** | head -1`
I have a list I want to randomly sort. It works fine in ubuntu but on a 'osx lion' sort dosen't have the --random-sort option.
I don't want to... (5 Replies)
Discussion started by: digitalviking
5 Replies
7. Shell Programming and Scripting
Input file:
100%ABC2 3.44E-12 USA
A2M%H02579 0E0 UK
100%ABC2 5.34E-8 UK
100%ABC2 3.25E-12 USA
A2M%H02579 5E-45 UK
Output file:
100%ABC2 3.44E-12 USA
100%ABC2 3.25E-12 USA
100%ABC2 5.34E-8 UK
A2M%H02579 0E0 UK
A2M%H02579 5E-45 UK
Code try:
sort -k1,1 -g -k2 -r input.txt... (2 Replies)
Discussion started by: perl_beginner
2 Replies
8. Shell Programming and Scripting
Hi Experts,
I have a filelist collected from another server , now want to sort the output using date/time stamp filed.
- Filed 6, 7,8 are showing the date/time/stamp.
Here is the input:
#----------------------------------------------------------------------
-rw------- 1 root ... (3 Replies)
Discussion started by: rveri
3 Replies
9. UNIX for Beginners Questions & Answers
Hi,
Could anyone kindly show me a link or explain the difference between
sort -n -k2 -k3 & sort -n -k2,3
Also, if I like to remove the row with repetition at both $2 and $3, Can I safely use
sort -u -k2 -k3
Example;
100 20 30
100 20 30
So, both $2 and $3 are same and I... (2 Replies)
Discussion started by: Indra2011
2 Replies
10. Shell Programming and Scripting
How to sort the following output based on lowest to highest BE?
The following sort does not work.
$ sort -t. -k1,1n -k2,2n bfd.txt
BE31.116 0s 0s DOWN DAMP
BE31.116 0s 0s DOWN DAMP
BE31.117 0s 0s ... (7 Replies)
Discussion started by: sand1234
7 Replies
VGS(8) System Manager's Manual VGS(8)
NAME
vgs - report information about volume groups
SYNOPSIS
vgs [-a|--all] [--aligned] [-d|--debug] [-h|-?|--help] [--ignorelockingfailure] [--nameprefixes] [--noheadings] [--nosuffix] [-o|--options
[+]Field[,Field]] [-O|--sort [+|-]Key1[,[+|-]Key2[,...]]] [-P|--partial] [--rows] [--separator Separator] [--unbuffered] [--units hHbB-
sSkKmMgGtTpPeE] [--unquoted] [-v|--verbose] [--version] [VolumeGroupName [VolumeGroupName...]]
DESCRIPTION
vgs produces formatted output about volume groups.
OPTIONS
See lvm for common options.
--all List all volume groups. Equivalent to not specifying any volume groups.
--aligned
Use with --separator to align the output columns.
--nameprefixes
Add an "LVM2_" prefix plus the field name to the output. Useful with --noheadings to produce a list of field=value pairs that can
be used to set environment variables (for example, in udev (7) rules).
--noheadings
Suppress the headings line that is normally the first line of output. Useful if grepping the output.
--nosuffix
Suppress the suffix on output sizes. Use with --units (except h and H) if processing the output.
-o, --options
Comma-separated ordered list of columns. Precede the list with '+' to append to the default selection of columns.
Use -o vg_all to select all volume group columns.
Use -o help to view the full list of columns available.
Column names include: vg_fmt, vg_uuid, vg_name, vg_attr, vg_size, vg_free, vg_sysid, vg_extent_size, vg_extent_count, vg_free_count,
max_lv, max_pv, pv_count, lv_count, snap_count, vg_seqno, vg_tags, vg_mda_count, vg_mda_free, and vg_mda_size.
Any "vg_" prefixes are optional. Columns mentioned in either pvs (8) or lvs (8) can also be chosen, but columns cannot be taken
from both at the same time.
The vg_attr bits are:
1 Permissions: (w)riteable, (r)ead-only
2 Resi(z)eable
3 E(x)ported
4 (p)artial: one or more physical volumes belonging to the volume group are missing from the system
5 Allocation policy: (c)ontiguous, c(l)ing, (n)ormal, (a)nywhere, (i)nherited
6 (c)lustered
-O, --sort
Comma-separated ordered list of columns to sort by. Replaces the default selection. Precede any column with - for a reverse sort on
that column.
--rows Output columns as rows.
--separator Separator
String to use to separate each column. Useful if grepping the output.
--unbuffered
Produce output immediately without sorting or aligning the columns properly.
--units hHbBsSkKmMgGtTpPeE
All sizes are output in these units: (h)uman-readable, (b)ytes, (s)ectors, (k)ilobytes, (m)egabytes, (g)igabytes, (t)erabytes,
(p)etabytes, (e)xabytes. Capitalise to use multiples of 1000 (S.I.) instead of 1024. Can also specify custom units e.g. --units 3M
--unquoted
When used with --nameprefixes, output values in the field=value pairs are not quoted.
SEE ALSO
lvm(8), vgdisplay(8), pvs(8), lvs(8)
Sistina Software UK LVM TOOLS 2.02.67(2) (2010-06-04) VGS(8)