Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How can I list the file under a directory both in alphabetical and in reverse alphabetical order? Post 302369302 by g.ashok on Saturday 7th of November 2009 11:06:31 AM
Old 11-07-2009
How can I list the file under a directory both in alphabetical and in reverse alphabetical order?

How can I list the file under current directory both in alphabetical and in reverse alphabetical order?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

shell program for sorting strings in an alphabetical order

Hi, I trying to find the solution for writing the programming in unix by shell programming for sorting thr string in alphabetical order. I getting diffculty in that ,, so i want to find out the solution for that Please do needful Thanks Bhagyesh (1 Reply)
Discussion started by: bp_vanarse
1 Replies

2. Shell Programming and Scripting

alphabetical order with out using sort command

hai, how can i sort a file alphabetically without using sort command (6 Replies)
Discussion started by: rahul801
6 Replies

3. Shell Programming and Scripting

Counts a number of unique word contained in the file and print them in alphabetical order

What should be the Shell script that counts a number of unique word contained in a file and print them in alphabetical order line by line? (7 Replies)
Discussion started by: proactiveaditya
7 Replies

4. UNIX for Dummies Questions & Answers

Alphabetical sort for multi line records contains in a single file

Hi all, I So, I've got a monster text document comprising a list of various company names and associated info just in a long list one after another. I need to sort them alphabetically by name... The text document looks like this: Company Name: the_first_company's_name_here Address:... (2 Replies)
Discussion started by: quee1763
2 Replies

5. Homework & Coursework Questions

Alphabetical help.

1. The problem statement, all variables and given/known data: Find the first letter in alphabet from the input: Accept the input of a series of upper case alphabetic letters one at a time. The input ends with a 0. Find and display the first letter in alphabetic order. For example, input... (27 Replies)
Discussion started by: Ren_kun
27 Replies

6. Shell Programming and Scripting

[SHELL] Userlist alphabetical order

Hi everyone! I am new to the forum and have recently started working with Linux. Quick question, I want a user list in alphabetical order as the output of a shell script. Who can help me!? Thanks! From the netherlands ;) (5 Replies)
Discussion started by: dennisbest85
5 Replies

7. UNIX for Dummies Questions & Answers

Script to list applications in alphabetical order

I've looking over a script for work and I've had a problem with the script not listing the files in alphabetical order. To look up PIDs for apps, it would be beneficial to have them listed in that order. Here is what I've been reviewing. #!/usr/bin/perl $str = sprintf "%4s %-40s", "PID",... (7 Replies)
Discussion started by: whysolucky
7 Replies

8. Shell Programming and Scripting

Sorting lines between patterns in alphabetical order

Hi, need help in sorting lines between strings "<section status = “ole-service”>" and "</section>" in alphabetical order, based on the text in red. Hoping for an AWK or SED solution. Thank you. ... <section status = “ole-service”>... <p service = "OOO">XZZ</p> <p service = "AAA">AAA... (3 Replies)
Discussion started by: pioavi
3 Replies

9. Shell Programming and Scripting

Want to grep records in alphabetical order from a file and split into other files

Hi All, I have one file containing thousands of table names in single column. Now I want that file split into multiple files e.g one file containing table names starting from A, other containing all tables starting from B...and so on..till Z. I tried below but it did not work. for i in... (6 Replies)
Discussion started by: shekhar_4_u
6 Replies

10. UNIX for Beginners Questions & Answers

How to create a summary file of all files in a directory sorted in reverse alphabetical order.?

I have an interactive script which works terrific at processing a folder of unsorted files into new directories. I am wondering how I could modify my script so that( upon execution) it provides an additional labelled summary file on my desktop that lists all of the files in each directory that... (4 Replies)
Discussion started by: Braveheart
4 Replies
SG_SCAN(8)							     SG3_UTILS								SG_SCAN(8)

NAME
sg_scan - does a scan of sg devices (or given SCSI/ATAPI/ATA devices) and prints the results SYNOPSIS
sg_scan [-a] [-i] [-n] [-w] [-x] [DEVICE]* DESCRIPTION
If no DEVICE names are given, sg_scan does a scan of the sg devices and outputs a line of information for each sg device that is currently bound to a SCSI device. If one or more DEVICEs are given only those devices are scanned. Each device is opened with the O_NONBLOCK flag so that the scan will not "hang" on any device that another process holds an O_EXCL lock on. Any given DEVICE name is expected to comply with (to some extent) the Storage Architecture Model (SAM see www.t10.org). Any device names associated with the Linux SCSI subsystem (e.g. /dev/sda and /dev/st0m) are suitable. Devices names associated with ATAPI devices (e.g. most CD/DVD drives and ATAPI tape drives) are also suitable. If the device does not fall into the above categories then an ATA IDENTIFY command is tried. OPTIONS
-a do alphabetical scan (i.e. sga, sgb, sgc). Note that sg device nodes with an alphabetical index have been deprecated since the linux kernel 2.2 series. -i do a SCSI INQUIRY, output results in a second (indented) line. If the device is an ATA disk then output information from an ATA IDENTIFY command -n do numeric scan (i.e. sg0, sg1...) [default] -w use a read/write flag when opening sg device (default is read-only) -x extra information output about queuing NOTES
This utility was written at a time when hotplugging of SCSI devices was not supported in Linux. It used a simple algorithm to scan sg device nodes in ascending numeric or alphabetical order, stopping after there were 4 consecutive errors. In the linux kernel 2.6 series, this utility uses sysfs to find which sg device nodes are active and only checks those. Hence there can be large "holes" in the numbering of sg device nodes (e.g. after an adapter has been removed) and still all active sg device nodes will be listed. This utility assumes that sg device nodes are named using the normal conventions and searches from /dev/sg0 to /dev/sg4095 inclu- sive. EXIT STATUS
The exit status of sg_scan is 0 when it is successful. Otherwise see the sg3_utils(8) man page. AUTHORS
Written by D. Gilbert and F. Jansen COPYRIGHT
Copyright (C) 1999-2006 Douglas Gilbert This software is distributed under the GPL version 2. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PUR- POSE. sg3_utils-1.23 December 2006 SG_SCAN(8)
All times are GMT -4. The time now is 09:40 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy