Sponsored Content
Top Forums Shell Programming and Scripting Finding the oldest file in a particular directory Post 302305172 by abinaya on Wednesday 8th of April 2009 07:24:54 AM
Old 04-08-2009
Hi,

Try the below command

ls -ltr | head -1
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Oldest File In A Directory

I'm writing a script to find the oldest file in a directory. I know this can be done by using ls -rt | tail -1 but these are rather large directories and that can be somewhat slow since the script will be running constantly. Are there any other ways to do this that would be faster? I looked to... (2 Replies)
Discussion started by: bergerj3
2 Replies

2. Shell Programming and Scripting

Removing the oldest file in a directory

Hi all, I need your assistance in removing the oldest file in a directory. I posted the same thread 3 days back and I got the following answer ls -1 -t | tail -1 | xargs rm which is not covering the case when there are directories older than the oldest file. So, could you please... (2 Replies)
Discussion started by: pavan_movva
2 Replies

3. Shell Programming and Scripting

how to grep the oldest file in a directory

Hi, Please help me out I want to grep the oldest file in a directory, could I use "ls" command? and how? thanx in advance (1 Reply)
Discussion started by: ericaworld
1 Replies

4. Shell Programming and Scripting

Finding & Moving Oldest File by Parsing/Sorting Date Info in File Names

I'm trying to write a script that will look in an /exports folder for the oldest export file and move it to a /staging folder. "Oldest" in this case is actually determined by date information embedded in the file names themselves. Also, the script should only move a file from /exports to... (6 Replies)
Discussion started by: nikosey
6 Replies

5. Shell Programming and Scripting

Setting Variable to oldest file in a directory

I am using a bash script to perform some automated maintenance on files in a directory. When I run the script using $sh -x script.sh <directory> the script works fine. It sets the variable to the oldest file, and continues on. However when I run the script like this $./script.sh <directory>, it... (5 Replies)
Discussion started by: spaceherpe61
5 Replies

6. Shell Programming and Scripting

Find Oldest file in a directory tree

This might just be one command. Any1 having the solution? Thanks, Rahul. (25 Replies)
Discussion started by: rahulrathod
25 Replies

7. Shell Programming and Scripting

Finding the oldest file

Hi:- I need help with a script I need to modify: - what's the best/easiest way to find out the oldest file in a directory and then move this file to another directory? Thanks, (5 Replies)
Discussion started by: janet
5 Replies

8. 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

9. Shell Programming and Scripting

Deleting the oldest file in a directory

Hey! I have found similar posts both here and on other sites regarding this, but I cannot seem to get my script to work. I want to delete the oldest file in a test directory if there are more than two files. My script is currently: #!/bin/bash MEPATH=/usr/local/bin/test FILECOUNT=`ls... (4 Replies)
Discussion started by: Immolation
4 Replies

10. UNIX for Advanced & Expert Users

Finding oldest files

There are some 25,000 files in 7,000 directories in my source library and I am trying to find oldest files. I am running this find: find /usr/mysrc -name "*." -type f -mtime +8000 -exec ls -l {} 2>/dev/null and playing with the days parameter for mtime, but the output is not sorted... (3 Replies)
Discussion started by: migurus
3 Replies
Pango::Context(3pm)					User Contributed Perl Documentation				       Pango::Context(3pm)

NAME
Pango::Context - Pango object that stores global information used to control the itemization process HIERARCHY
Glib::Object +----Pango::Context METHODS
direction = $context->get_base_dir $context->set_base_dir ($direction) o $direction (Pango::Direction) gravity = $context->get_base_gravity Since: pango 1.16 $context->set_base_gravity ($gravity) o $gravity (Pango::Gravity) Since: pango 1.16 fontdescription = $context->get_font_description $context->set_font_description ($desc) o $desc (Pango::FontDescription) fontmap = $context->get_font_map Since: pango 1.6 gravity = $context->get_gravity Since: pango 1.16 gravityhint = $context->get_gravity_hint Since: pango 1.16 $context->set_gravity_hint ($hint) o $hint (Pango::GravityHint) Since: pango 1.16 language = $context->get_language $context->set_language ($language) o $language (Pango::Language) @families = $context->list_families font = $context->load_font ($desc) o $desc (Pango::FontDescription or undef) fontset = $context->load_fontset ($desc, $language) o $desc (Pango::FontDescription) o $language (Pango::Language or undef) matrix or undef = $context->get_matrix Since: pango 1.6 $context->set_matrix ($matrix) o $matrix (Pango::Matrix or undef) Since: pango 1.6 fontmetrics = $context->get_metrics ($desc, $language) o $desc (Pango::FontDescription) o $language (Pango::Language or undef) ENUMS AND FLAGS
enum Pango::Direction o 'ltr' / 'PANGO_DIRECTION_LTR' o 'rtl' / 'PANGO_DIRECTION_RTL' o 'ttb-ltr' / 'PANGO_DIRECTION_TTB_LTR' o 'ttb-rtl' / 'PANGO_DIRECTION_TTB_RTL' o 'weak-ltr' / 'PANGO_DIRECTION_WEAK_LTR' o 'weak-rtl' / 'PANGO_DIRECTION_WEAK_RTL' o 'neutral' / 'PANGO_DIRECTION_NEUTRAL' enum Pango::Gravity o 'south' / 'PANGO_GRAVITY_SOUTH' o 'east' / 'PANGO_GRAVITY_EAST' o 'north' / 'PANGO_GRAVITY_NORTH' o 'west' / 'PANGO_GRAVITY_WEST' o 'auto' / 'PANGO_GRAVITY_AUTO' enum Pango::GravityHint o 'natural' / 'PANGO_GRAVITY_HINT_NATURAL' o 'strong' / 'PANGO_GRAVITY_HINT_STRONG' o 'line' / 'PANGO_GRAVITY_HINT_LINE' SEE ALSO
Pango, Glib::Object COPYRIGHT
Copyright (C) 2003-2011 by the gtk2-perl team. This software is licensed under the LGPL. See Pango for a full notice. perl v5.14.2 2011-11-15 Pango::Context(3pm)
All times are GMT -4. The time now is 06:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy