Sponsored Content
Full Discussion: Oldest File In A Directory
Top Forums UNIX for Dummies Questions & Answers Oldest File In A Directory Post 16271 by usfrog on Wednesday 27th of February 2002 01:55:53 PM
Old 02-27-2002
awk can also make it.
in the portion of scripts below I look fore some core* archive files and delete the oldest:

ls -r core* | awk '{ fname=$1 } END{ system("rm " fname) }'
 

10 More Discussions You Might Find Interesting

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

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

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

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

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

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

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

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

9. Shell Programming and Scripting

Bash to select oldest folder in directory automatically and log process

The `bash` below uses the oldest folder in the specified directory and logs it. The goes though an analysis process and creates a log. My problem is that if there are 3 folders in the directory folder1,folder2,folder3, the bash is using folder2 for the analysis eventhough folder1 is the oldest... (0 Replies)
Discussion started by: cmccabe
0 Replies

10. Shell Programming and Scripting

Bash to select oldest folder in directory and write to log

In the bash below the oldest folder in a directory is selected. If there are 3folders in the directory /home/cmccabe/Desktop/NGS/test and nothing is done to them (ie. no files deleted, renamed) then the bash correctly identifies f1 as the oldest. However, if something is done to the folder then... (4 Replies)
Discussion started by: cmccabe
4 Replies
clm residue(1)							  USER COMMANDS 						    clm residue(1)

  NAME
      clm residue - extend clustering of subgraph to clustering of graph.

      clmresidue  is  not  in  actual fact a program. This manual page documents the behaviour and options of the clm program when invoked in mode
      residue. The options -h, --apropos, --version, -set, --nop are accessible in all clm modes. They are described in the clm manual page.

  SYNOPSIS
      clm residue -icl fname (input clustering) -imx fname (input graph) [-rpm fname (residue projection matrix)]  [-o	fname  (output	clustering
      file)]

  DESCRIPTION
      The cluster file presumably contains a clustering of a subgraph of the graph G contained by the matrix file, implying that the row domain of
      that clustering is a subset of the node domain of the graph. clm residue will compute  a	simple	upwards  projection  of  that  clustering,
      resulting in a clustering of G.

  OPTIONS
      -imx fname (input graph)

      -icl fname (input clustering)

      -rpm fname (residue projection matrix)
	The name for the file in which the residue projection matrix is stored.  It contains for each node and for each cluster in the input clus-
	tering the combined weight of the (edges to the) neighbours of that node in that cluster.  The default output file name is out.rpm.

      -o fname (output clustering file)
	The name for the file in which the majority vote projection clustering is stored. Aka the majority vote projection clustering storage file
	name.

	This  embodies	a very crude approach to distributing the missing nodes in the input clustering onto that same cluster. For each node, the
	cluster is taken for which the residue projection is the largest (see above). The residue (i.e. the set of  missing  nodes)  is  initially
	viewed	as  a  cluster;  the set of nodes for which the projection is largest for the residue itself will form a new cluster, if it is not
	empty.

	By default output is sent to STDOUT.

  AUTHOR
      Stijn van Dongen.

  SEE ALSO
      mclfamily(7) for an overview of all the documentation and the utilities in the mcl family.

  clm residue 12-068						      8 Mar 2012						      clm residue(1)
All times are GMT -4. The time now is 07:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy