Sponsored Content
Top Forums Shell Programming and Scripting List files with *.i extension in a directory and all its subdirectories + 30days old then remove Post 302754883 by jim mcnamara on Friday 11th of January 2013 10:45:25 AM
Old 01-11-2013
Save what in a file? the output?

Code:
cd /path/to/main/directory
find /path/to/main/directory -type f -mtime +30 -name '*.i' |
while read fname
do
    echo $fname
    rm "$fname"
done > /tmp/output_file

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to Remove Ctrl M characters in files from directories and its subdirectories

Hi, How to recursively remove Ctrl M characters in files from a directory and its sub directory ? I know unix2dos command is there but to remove in bunch of files ... ? Thanks (7 Replies)
Discussion started by: skdp
7 Replies

2. UNIX for Dummies Questions & Answers

list largest files in a directory & its subdirectories

I need to find the largest files in a directory & it's subdirectories. I'm not sure what options on ls -l will work to give me this. or is there another way to do this? Thanks, igidttam (6 Replies)
Discussion started by: igidttam
6 Replies

3. UNIX for Advanced & Expert Users

Can't list or remove files from a directory

Hi I have a problem. One of the directories in /var, on one of my servers, has filled up with loads of files. I have tried to list the directory to see what is in it, but the 'ls' command just hangs. Same thing happens when I try to use 'rm' to remove files from that directory. I can see what... (2 Replies)
Discussion started by: m_smith
2 Replies

4. Shell Programming and Scripting

search files in a directory and its subdirectories

Hello my friends, I need to write a simple shell bad file :D that search and delete a file it's name 'Microsoft.txt' in the current directory and its subdirectories? So can you help to guide me how i can write this shell, Just give me the beginning :o thank you. (1 Reply)
Discussion started by: Net-Man
1 Replies

5. UNIX for Dummies Questions & Answers

How to remove directory with subdirectories and files?

I'm trying to remove several directories which contains sun-dirs and files inside. I used the command rm -r <dirname> But, it always ask "examine file in directory <dirname> yes/no?" line by line. So, i need to write "y" for every line. How can i skip this step and remove all directories with... (9 Replies)
Discussion started by: ppa108
9 Replies

6. Shell Programming and Scripting

Remove files from subdirectories given a list of filenames

Dear all, I have a dir structure like main_dir At_nn Ag_js Nf_hc .... mcd32 mgd43... mcd32 mgd43... mcd32 mgd43... and each subdir (e.g. mcd32, mgd43) contains files. Now, i... (15 Replies)
Discussion started by: yogeshkumkar
15 Replies

7. Shell Programming and Scripting

How to list all Subdirectories and files with its full path in a parent directory?

How to list all Subdirectories and files with its full path in a parent directory? (1 Reply)
Discussion started by: johnveslin
1 Replies

8. Shell Programming and Scripting

Help on Backing up all the files in the subdirectories under a parent directory

Hi, I am not too familiar with Unix scripting but I have to write code to find all the files under all the sub directories under a parent directory of unix location and move them to the corresponding Windows location. For eg: I have \home\sreenu\Files\ Under neath this I have multiple sub... (3 Replies)
Discussion started by: raj.sreenu
3 Replies

9. UNIX for Dummies Questions & Answers

Remove all the subdirectories except latest 5 inside any given directory

I Want to remove all the sub-directories except latest five in any given TGTDIR. Is there a way to do so without making a cd to TGTDIR? I have tried the following but not worked. Thank you. rm -rf `ls -t $TGTDIR | awk 'NR>5'` (20 Replies)
Discussion started by: Devendra Hupri
20 Replies

10. Shell Programming and Scripting

Append string to all the files inside a directory excluding subdirectories and .zip files

Hii, Could someone help me to append string to the starting of all the filenames inside a directory but it should exclude .zip files and subdirectories. Eg. file1: test1.log file2: test2.log file3 test.zip After running the script file1: string_test1.log file2: string_test2.log file3:... (4 Replies)
Discussion started by: Ravi Kishore
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 08:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy