Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Finding the lowest sequenced file in a directory? Post 302203148 by Franklin52 on Friday 6th of June 2008 03:19:10 PM
Old 06-06-2008
Try something like this:

Code:
awk -F"_" '!m || $2<m{m=$2;s=$0}END{print s}' file

Regards
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

finding file in a directory

hi can i know how to locate a file in a directory by using the "find" command? i want to know the exact path the files reside in in the result. thanks :confused: (4 Replies)
Discussion started by: legato
4 Replies

2. Programming

Finding largest file in current directory?

I was hoping to get some assistance with this C program I am working on. The goal is to find the largest file in the current directory and then display this filename along with the filesize. What I have so far will display all the files in the current directory. But, how do I deal with "grabbing"... (1 Reply)
Discussion started by: AusTex
1 Replies

3. Shell Programming and Scripting

Finding the oldest file in a particular directory

Hi all, I am a newbie to scripting and I need your help regarding finding the oldest file in a particular directory. My intention is to remove that oldest file. Are there any options available with the "find" command to do this.. Thanks in advance for your help Pavan (4 Replies)
Discussion started by: pavan_movva
4 Replies

4. Shell Programming and Scripting

Korn Shell - Finding lowest number of a file.

I'm writing a KSH script that will get a file on the command line (such as input.txt), and in this file there is on number per line. The program needs to take the file, read each and determine the lowest number in the file. I currently have a while loop setup that will correctly out put every... (8 Replies)
Discussion started by: denyal
8 Replies

5. UNIX and Linux Applications

Finding the oldest file in a directory without ls

I am trying to determine the oldest and most recent files in a huge directory. I am using an ls -tr statement outside my find statement. The directory is too big and I am getting an "arg list too long" error. Is there something I can put in my find statement that doesn't create a list to... (2 Replies)
Discussion started by: hiyofjord
2 Replies

6. UNIX for Dummies Questions & Answers

Finding file in a directory structure + move

Hi All, im a new guy if it comes to Unix. I am trying to auto categorize Nzbget downloads the most basic way. I already manage to find files within the directory i'm at and move them with if check to a certain dir. Unfortunately this command is restricted to the directory i'm at and does not... (2 Replies)
Discussion started by: RoxXxoR
2 Replies

7. Shell Programming and Scripting

finding lowest numbers

i want to basically get the lowest numbers from a list ... for example my input file is .... 1 2 3 6 7 8 9 10 11 13 Now i want to create a script or a one liner which i can use like this ... for example ..../getlowest 3 --> this gives me the next 3 lowest numbers which... (6 Replies)
Discussion started by: greycells
6 Replies

8. UNIX for Dummies Questions & Answers

[Solved] Finding the latest file in a directory

Hi All, I am using the below command to find the latest file in a dir: ls -tr $v_sftphomedir/$v_sourcefile |tail -1 or ls -t1 $v_sftphomedir/$v_sourcefile |head -1 and the outpur returned is below: /home/cobr_sftp/var/controllingload/Backup/Dbrwds_Div_1796050246.txt I need only the... (5 Replies)
Discussion started by: abhi_123
5 Replies

9. UNIX for Dummies Questions & Answers

Finding new file, but excluding directory..

hi, I need to find files that have been created less than 3 days ago. However, I need to only search specific directories. I've searched about the net and found some useful commands such as : find . -type d -name 'dir_to_exclude' -prune -o -print -mtime -3 however I cannot get it... (2 Replies)
Discussion started by: horhif
2 Replies

10. Shell Programming and Scripting

Finding the file name in a directory with a pattern

I need to find the latest file -filename_YYYYMMDD in the directory DIR. the below is not working as the position is shifting each time because of the spaces between(occuring mostly at file size field as it differs every time.) please suggest if there is other way. report =‘ls -ltr... (2 Replies)
Discussion started by: archana25
2 Replies
bootadm(1M)															       bootadm(1M)

NAME
bootadm - manage bootability of GRUB-enabled operating system SYNOPSIS
/sbin/bootadm update-archive [-vn] [-R altroot] /sbin/bootadm list-archive [-vn] [-R altroot] only /sbin/bootadm set-menu [-R altroot] key=value /sbin/bootadm list-menu [-R altroot] The bootadm command manages the boot archive and GRUB (GRand Unified Bootloader) menu. The update-archive option provides a way for user to update the boot archive as a preventative measure or as part of the recovery procedure. The set-menu subcommand allows you to switch the auto-boot timeout and default boot entry in the GRUB menu. The list-menu subcommand displays the location of the GRUB menu and the current GRUB menu entries. While the typical location of the GRUB menu is /boot/grub/menu.lst, depending on the install method used the active GRUB menu might be located somewhere else. Use the list-menu subcommand to locate the active GRUB menu. For example, if a system was installed using Live Upgrade, the GRUB menu might not be located in the current boot environment. See the section for typical output from the list-menu option. Note that a SPARC system does not have the concept of a boot archive. The bootadm command on a SPARC system is intended for managing disk- less clients. SUBCOMMANDS
The bootadm command has the following subcommands: update-archive Updates current boot archive if required. Applies to both SPARC and platforms. list-archive Lists the files and directories to be included in the boot archive. Applies to both SPARC and platforms. set-menu Maintain the GRUB menu. The current GRUB menu is boot/grub/menu.lst, relative to root. Do not depend on this location, because it is subject to change. Applies to platforms only. list-menu Lists the location of the active GRUB menu, as well as the current GRUB menu entries. This includes the autoboot-timeout, the default entry number, and the title of each entry. Applies to platforms only. The bootadm command has the following options: -v In an update-archive operation, stale files are displayed on stderr. -n In an update-archive operation, archive content is checked but not updated. -R altroot Operation is applied to an alternate root path. Note - The root file system of any non-global zones must not be referenced with the -R option. Doing so might damage the global zone's file system, might compromise the security of the global zone, and might damage the non-global zone's file system. See zones(5). key=value Possible values are: default=entrynum The item number (for example, 0, 1, or 2) in the GRUB menu designating the operating system to boot when the timer expires. timeout=seconds The number of seconds before the operating system designated by the default item number is booted. If the value is -1, auto boot is disabled. Example 1: Updating the Current Boot Archive The following command updates the current boot archive: # bootadm update-archive Example 2: Updating the Boot Archive on an Alternate Root The following command updates the boot archive on an alternate root: # bootadm update-archive -R /a Example 3: Listing Installed OS Instances The following command lists the installed operating system instances in a GRUB menu: # bootadm list-menu default=0 timeout=10(0) Solaris10(1) Solaris10 Failsafe(2) Linux Example 4: Switching Default Boot Entry The following command refers to the menu displayed in the previous example. The user selects Linux (item 2). # bootadm set-menu default=2 Example 5: Listing GRUB Menu Entries and Location of GRUB Menu The following command lists the GRUB menu entries and the location of the GRUB menu: # bootadm list-menu The location for the active GRUB menu is: /stubboot/boot/grub/menu.lst default 0 timeout 10 0 Solaris10 1 Solaris10 failsafe 2 Linux Example 6: Displaying Location of GRUB Menu The following command displays the location of the GRUB menu: # bootadm list-menu The location for the active GRUB menu is: /dev/dsk/c0t1d0s0 (not mounted) The filesystem type of the menu device is <ufs> default 2 timeout 10 0 c0t1d0s3 1 c0t1d0s3 failsafe 2 Solaris10 3 Solaris10 failsafe In this example, the active GRUB menu is located on a device which is not mounted. To access the GRUB menu, mount the device and access the GRUB menu at <mountpoint>/boot/grub/menu.lst. The following exit values are returned: 0 The command completed successfully. 1 The command exited due to an error. See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ |Interface Stability |Stable | +-----------------------------+-----------------------------+ boot(1M), installgrub(1M), attributes(5) The GRUB home page: http://www.gnu.org/software/grub/ 10 Oct 2005 bootadm(1M)
All times are GMT -4. The time now is 02:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy