Sponsored Content
Top Forums Shell Programming and Scripting Search through subfolders and move them into separate folder on the base of file size Post 302366703 by panyam on Friday 30th of October 2009 06:20:22 AM
Old 10-30-2009
Hi infiant ,

I tried but did not find any one line solution .

You can try something like this :

Code:
find . -name "abc.data" -depth -size +2c -print >> healthy_files.lst

find . -name "abc.data" -size -2c >> unhealthy.lst

find . ! -name  "abc.data" >> others.lst

Again for the distinct path names from these files you can move them.

I will put the complete script once i done it.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

send a mail whenever a file is updated in certain folder or its subfolders

send a mail to a group of users whenever a file is updated in certain folder or its subfolders on an unix server (3 Replies)
Discussion started by: ashishabhishek
3 Replies

2. Shell Programming and Scripting

Move the file from one folder to another folder

Hi, I have a requirement to move a file from one folder(a) to another folder(b) only when folder (b) have a write permission. Folder permission is 755 If the permission is otherthan 755 we need to come out of the loop I will appreciate your help Thanks Soll (1 Reply)
Discussion started by: sollins
1 Replies

3. Shell Programming and Scripting

File Management: How do I move all JPGS in a folder structure to a single folder?

This is the file structure: DESKTOP/Root of Photo Folders/Folder1qweqwasdfsd/*jpg DESKTOP/Root of Photo Folders/Folder2asdasdasd/*jpg DESKTOP/Root of Photo Folders/Folder3asdadfhgasdf/*jpg DESKTOP/Root of Photo Folders/Folder4qwetwdfsdfg/*jpg DESKTOP/Root of Photo... (4 Replies)
Discussion started by: guptaxpn
4 Replies

4. Shell Programming and Scripting

Search in folder and subfolders

How can this be done? I mean, I want to search for all *png *jpg *bmp files in my ~/Pictures/ folder....How can I list them? Thank you geeks :) :b: (2 Replies)
Discussion started by: hakermania
2 Replies

5. UNIX for Dummies Questions & Answers

Search current folder and subfolders with grep

Hello, Neither ‘Grep -r' nor ‘grep -R' is working in my environment. (Searching for a text pattern in the files) Any suggestions... Using SunOS 5.9 Thanks, Trinanjan. (1 Reply)
Discussion started by: bhanja_trinanja
1 Replies

6. Shell Programming and Scripting

want to move set of file from one folder to another folder

Hi all, let me explain my requirments i am having 5 folder with different name for eg) abc , cdf , efd, rtg, ead each 5 folders contain 15 files i want to move 10 files to some other folder, remain 5 files should be there in the same folder. give me some suggestion on this. (6 Replies)
Discussion started by: natraj005
6 Replies

7. Solaris

Move files to another folder base on DU

Hi, I want to move files like *.txt to another filesystem on the same server only when the disk usage reaches 80% or more. But need to keep the latest 5 files. After that delete from the original. How to proceed? Please help Gav... (5 Replies)
Discussion started by: Gavisht
5 Replies

8. Red Hat

Separate the apache user file and move or copy some were

Hi all, I'm Using Centos 6.4 /opt/my_aplication/entry/data/0/ There are Thousands of files in this Directory, Only i need to copy or move the apache User's file from this to /tmp/backup , I have listed apache user's file using find . -user apache -type f , its gave me the only apache... (2 Replies)
Discussion started by: babinlonston
2 Replies

9. Shell Programming and Scripting

Move specific folders and subfolders in a directory

I am trying to move specific folders and subfolders within a directory using the below. I can see the folders to move and they are at the location, but I am getting an error. Thank you :). mv -v /home/cmccabe/Desktop/NGS/API/6-10-2016{bam/{validation,coverage},bedtools /media/cmccabe/"My... (6 Replies)
Discussion started by: cmccabe
6 Replies

10. UNIX for Beginners Questions & Answers

UNIX utility to find difference in folder, file and contents of file against a base version

Hi, I am trying to find out whether there are any Unix utilities that compares folders, files and contents within the file and provides a comprehensive report. The comparison can be against base version of a folder and file with content. Can you please let me know of such a utility? Thanks,... (6 Replies)
Discussion started by: Sripathi_ks
6 Replies
refile(1mh)															       refile(1mh)

Name
       refile - file message in other folders

Syntax
       refile [ msgs ] [ +folder ] [ options ]

Description
       Use  the  command to move the specified message from the current folder to another folder.  You can refile messages in more than one folder
       by giving multiple folder names as arguments.

       If you do not specify a message, the current message is refiled.  You can refile a message other than the current  message  by  giving  its
       number  as  a msgs argument.  You can also refile more than one message at a time by specifying more than one message number, or a range of
       message numbers, or a message sequence.	See for more information on sequences.

       The current folder remains the same unless the -src option is specified; in that case, the source folder becomes  current.   Normally,  the
       last message specified becomes the current message.  However, if the -link option is used, the current message is not changed.

       If  the	Previous-Sequence:  entry is set in the file, in addition to defining the named sequences from the source folder, will also define
       those sequences for the destination folders.  See for information concerning the previous sequence.

Options
       -draft	 Refiles the draft message, or the current message in your folder, if you have one set up.  You cannot give a msgs  argument  when
		 you use this option.

       -file filename
		 Moves	a  file into a folder.	This option takes a file from its directory and places it in the named folder, as the next message
		 in the folder.  The file must be formatted as a legal mail message.  This means that the message must	have  the  minimum  header
		 fields separated from the body of the message by a blank line or a line of dashes.

       -help	 Prints a list of the valid options to this command.

       -link
       -nolink	 Keeps	a copy of the message in the source folder.  Normally, removes the messages from the original folder when it refiles them.
		 The -link option keeps a copy in the original folder, as well as filing a copy in the new folder.

       -preserve
       -nopreserve
		 Preserves the number of a message in the new folder.  Normally, when a message is refiled in to another folder, it is set to  the
		 next  available number in that folder.  The -preserve option keeps the number of the message the same in the new folder as it had
		 been in the old.

		 You cannot have two messages with the same number in one folder, so you should use this option with care.

       -src +folder
		 Specifies the source folder to take messages from.  Normally, messages are refiled from the current folder into  another  folder.
		 However, you can take messages from a different folder by using the -src +folder option to specify the alternative source folder.

Examples
       The following example refiles messages 3 and 5 in the folder
       % refile 3 5 +records

       The next example files the current message into two folders:
       % refile +jones +map

       The next example takes message 13 in the current folder and refiles it in the folder.  The message remains in the current folder as well as
       appearing in the folder.
       % refile -link 13 +test

       The next example takes a message from the folder when it is not the current folder, and places it in the folder
       % refile 3 -src +test +outbox

Profile Components
       Path:		 To determine your Mail directory

       Folder-Protect:	 To set protections when creating a new folder
       rmmproc: 	 Program to delete the message

Files
       The user profile.

See Also
       folder(1mh), mark(1mh), mh_profile(5mh)

																       refile(1mh)
All times are GMT -4. The time now is 06:03 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy