Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to archive old files from the recently added 10 files? Post 302728959 by jim mcnamara on Thursday 8th of November 2012 08:41:58 PM
Old 11-08-2012
How about
Code:
cd /user
ls -t  | awk 'FNR>10' | 
while read fname
do
mv $fname /archive/${fname}
done

This User Gave Thanks to jim mcnamara For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

chmod command for recently modified files

hello! is there a way for me to use the chmod command to change permissions for several files all at once -based on the fact that these files were all most recently modified TODAY ? I can't use a wildcard on their filenames because the filenames are varied. But I was hoping I could somehow do... (2 Replies)
Discussion started by: polka_friend
2 Replies

2. Shell Programming and Scripting

Trying to Copy Files Changed Recently

I have been toying around with a script that will copy all files altered in a development directory over to a testing directory and have been trying to construct the command to meet my needs. Basically I am using find in a directory to see what files have changed over the past 24 hours. Then if... (4 Replies)
Discussion started by: scotbuff
4 Replies

3. UNIX for Dummies Questions & Answers

recently updated files

How do I find files those have been updated in the last 24 hours, sort them by size descending and then display the top of the long list? (6 Replies)
Discussion started by: shantanuo
6 Replies

4. UNIX for Dummies Questions & Answers

Find recently changed files

Hi, Can you guys tell me how do i find the most recently changed files, say an hour before, few hours before, a day before etc.... Thanks!!!! (3 Replies)
Discussion started by: raghu_shekar
3 Replies

5. Shell Programming and Scripting

subtring and copy recently files and another folder

Hi I have the following files A320_ZONAL_v24_-_AMM_Suffix_jess_2011-05-31.xls Jun 10 17:21 A320_ZONAL_v24_-_AMM_Suffix_jess_.xls Nov 10 17:21 A320_ZONAL_v24_-_AMM_Suffix_jess_2011-03-31.xls Nov 23 20:21 And I need only the more recent one using UNIX timestamp... (2 Replies)
Discussion started by: javeiregh
2 Replies

6. Shell Programming and Scripting

how to delete the older files other than the recently added 5 files

Number of files will get created in a folder automatically daily.. so i hav to delete the older files other than the recently added 5 files.. Could u help me through this..?? (5 Replies)
Discussion started by: shaal89
5 Replies

7. UNIX for Advanced & Expert Users

List all files in subdirectories which are modifiled recently.

Hello, I wanted to list all files in subdirectories which are modifiled recently. need to display all files with full details like hpw it display with ls -l ( date, size,..) Thanks Bala (3 Replies)
Discussion started by: balareddy
3 Replies

8. UNIX for Dummies Questions & Answers

Copy files from one drive to another, keeping most recently modified files

Hi all, I am a bit of a beginner with shell scripting.. What I want to do is merge two drives, for example moving all data from X to Y. If a file in X doesn't exist in Y, it will be moved there. If a file in X also exists in Y, the most recently modified file will be moved to (or kept) in... (5 Replies)
Discussion started by: apocolapse
5 Replies

9. Shell Programming and Scripting

How to copy the two most recently added files to another directory - HP-UX?

Hello, I am attempting to find and copy the two most recently added files to a specific directory, that fit a specific format. I was able to find the command to list the two most recently added files in directory: ls -1t | head -n 2 The command lists the two files names in a vertical list,... (11 Replies)
Discussion started by: mattkoz
11 Replies

10. Shell Programming and Scripting

Check files and archive the files using sftp

Hi, I have to check the files in another server using sftp to do that, below is the code i am going with #!/bin/bash export SRC_FOLDER=$1 export ARC_FOLDER=$2 HOST=as07u3456 USER=relfag sftp ${USER}@${HOST} <<EOF cd $SRC_FOLDER/DSCOR ls bye EOF echo "done" whatever the files i... (8 Replies)
Discussion started by: ursrami
8 Replies
clm close(1)							  USER COMMANDS 						      clm close(1)

  NAME
      clm close - Fetch connected components from graphs or subgraphs

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

  SYNOPSIS
      clm close -imx <fname> [options]

      clm close -imx fname (specify matrix input) -abc fname (specify label input) -dom fname (input domain/cluster file) [-o fname (output file)]
      [--is-undirected	(trust	input  graph  to  be  undirected)] [--write-count (output component count)] [--write-sizes (output component sizes
      (default))] [--write-cc (output components as clustering)] [--write-block (output graph restricted to -dom argument)] [--write-blockc  (out-
      put  graph  complement  of  -dom	argument)]  [-cc-bound	num  (select components with size at least num)] [-tf spec (apply tf-spec to input
      matrix)] [-h (print synopsis, exit)] [--apropos (print synopsis, exit)] [--version (print version, exit)]

  DESCRIPTION
      Use clm close to fetch the connected components from a graph. Different output modes are supported (see below). In matrix mode  (i.e.  using
      the  -imx option) the output returned with --write-cc can be used in conjunction with mcxsubs to retrieve individual subgraphs corresponding
      to connected components.

  OPTIONS
      -abc <fname> (label input)
	The file name for input that is in label format.

      -imx <fname> (input matrix)
	The file name for input that is in mcl native matrix format.

      -o fname (output file)
	Specify the file where output is sent to. The default is STDOUT.

      -dom fname (input domain/cluster file)
	If this option is used, clm close will, as a first step, for each of the domains in file fname retrieve the associated subgraph  from  the
	input graph. These are then further decomposed into connected components, and the program will process these in the normal manner.

      --write-count (output component count)
      --write-sizes (output component sizes (default))
      --write-cc (output components as clustering)
      --write-block (output graph restricted to -dom argument)
      --write-blockc (output graph complement of -dom argument)
	The  default  behaviour  is  currently to output the sizes of the connected components. It is also possible to simply output the number of
	components with --write-count or to write the components as a clustering in mcl format with -write-cc. Even more options exist: it is pos-
	sible to output the restriction of the input graph to a domain, or to output the complement of this restriction.

      --is-undirected (omit graph undirected check)
	With  this option the transformation to make sure that the input is undirected is omitted. This will be slightly faster. Using this option
	while the input is directed may lead to erronenous results.

      -cc-bound num (select components with size at least num)
	Transform the input matrix values according to the syntax described in mcxio(5).

  AUTHOR
      Stijn van Dongen.

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

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