Sponsored Content
Full Discussion: Sort all files in one folder
Top Forums UNIX for Beginners Questions & Answers Sort all files in one folder Post 303014682 by Eve on Sunday 18th of March 2018 09:49:38 AM
Old 03-18-2018
A reply to rbatte1. Yes, you have understood everything correctly. But I'm getting a error report in my C Shell window when I'm trying to use your code:
Code:
% sort -bn "$inputfile" > "z-$inputfile"
inputfile: Undefined variable.

What to do?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to sort the file in specified folder

hi im having soo many .top files and i have to sort a set of files in one folder like tat so many sets of folders have to be created ... like say i have the file name j1 , g2 ,s3,k4,h1,j2,k3,s4..And i have to create one folder in tat i to have copy the files j1, g2 ,s3,k4 in one folder and... (0 Replies)
Discussion started by: maximas
0 Replies

2. UNIX for Advanced & Expert Users

Auto copy for files from folder to folder upon instant writing

Hello all, I'm trying to accomplish that if a file gets written to folder /path/to/a/ it gets automatically copied into /path/to/b/ the moment its get written. I thought of writing a shell script and cron it that every X amount of minutes it copies these files over but this will not help me... (2 Replies)
Discussion started by: Bashar
2 Replies

3. Shell Programming and Scripting

script for Finding files in a folder and copying to another folder

Hi all, I have a folder '/samplefolder' in which i have some files like data0.txt, data1.txt and data2.txt. I have to search the folder for existence of the file data0.txt first and if found have to copy it to some other file; next i have to search the folder for existence of file... (5 Replies)
Discussion started by: satish2712
5 Replies

4. Shell Programming and Scripting

check how many files in folder or total files in folder

Hi all, I have copied all my files to one folder.and i want to check how many files (count) in the folder recently moved or total files in my folder? please send me the query asap. (3 Replies)
Discussion started by: durgaprasad
3 Replies

5. Shell Programming and Scripting

Find all text files in folder and then copy to a new folder

Hi all, *I use Uwin and Cygwin emulator. I´m trying to search for all text files in the current folder (C/Files) and its sub folders using find -depth -name "*.txt" The above command worked for me, but now I would like to copy all found text files to a new folder (C/Files/Text) with ... (4 Replies)
Discussion started by: cgkmal
4 Replies

6. Shell Programming and Scripting

Help with sort folder results

Here is the code, but the list is not sorted properly (alphabetically)? <?php function folderlist(){ $startdir = './'; $ignoredDirectory = '.'; $ignoredDirectory = '..'; if (is_dir($startdir)){ if ($dh = opendir($startdir)){ while (($folder = readdir($dh)) !== false){ if... (0 Replies)
Discussion started by: mrlayance
0 Replies

7. Shell Programming and Scripting

URGENT!!! bash script to sort files into folder according to a string in the filename

Hi all. I am very new to linux scripting and i have a task i can only solve with a script. I need to sort files base on the date string in their filenames and create a folder using the same date string then move the files to their respective folders. Scenario: Folder Path:... (1 Reply)
Discussion started by: ace47
1 Replies

8. Shell Programming and Scripting

Bash script to sort files into folder according to a string in the filename

Hi all. I am very new to linux scripting and i have a task i can only solve with a script. I need to sort files base on the date string in their filenames and create a folder using the same date string then move the files to their respective folders. Scenario: Folder Path:... (1 Reply)
Discussion started by: ace47
1 Replies

9. Shell Programming and Scripting

Shell scripting for moving folder specific files into target directory of that country folder.

I need help to write shell script to copy files from one server to another server. Source Directory UAE(inside i have another folder Misc with files inside UAE folder).I have to copy this to another server UAE folder( Files should be copied to UAE folder and Misc files should be copied in target... (3 Replies)
Discussion started by: naresh2389
3 Replies

10. Shell Programming and Scripting

Request for Shell script to move files from Subfolder to Parent folder and delete sub folder

Hi Team, I am new to shell script and there is a requirement where files should be moved from Subfolder to parent folder. Eg: parent folder --> /Interface/data/test/IN Sub folder -->/Interface/data/test/IN/Invoice20180607233338 Subfolder will be always with timestamp... (6 Replies)
Discussion started by: srivarun15
6 Replies
SORTM(1)							     [nmh-1.5]								  SORTM(1)

NAME
sortm - sort messages SYNOPSIS
sortm [+folder] [msgs] [-datefield field] [-textfield field] [-notextfield] [-limit days] [-nolimit] [-verbose | -noverbose] [-version] [-help] DESCRIPTION
Sortm sorts the specified messages in the named folder according to the chronological order of the "Date:" field of each message. The -verbose switch directs sortm to tell the user the general actions that it is taking to place the folder in sorted order. The -datefield field switch tells sortm the name of the field to use when making the date comparison. If the user has a special field in each message, such as "BB-Posted:" or "Delivery-Date:", then the -datefield switch can be used to direct sortm which field to examine. The -textfield field switch causes sortm to sort messages by the specified text field. If this field is "subject", any leading "re:" is stripped off. In any case, all characters except letters and numbers are stripped and the resulting strings are sorted datefield-major, textfield-minor, using a case insensitive comparison. With -textfield field, if -limit days is specified, messages with similar textfields that are dated within `days' of each other appear together. Specifying -nolimit makes the limit infinity. With -limit 0, the sort is instead made textfield-major, date-minor. For example, to order a folder by date-major, subject-minor, use: sortm -textfield subject +folder FILES
$HOME/.mh_profile The user profile PROFILE COMPONENTS
Path: To determine the user's nmh directory Current-Folder: To find the default current folder SEE ALSO
folder(1) DEFAULTS
`+folder' defaults to the current folder `msgs"'defaultstoall" `-datefield' defaults to date `-notextfield' `-noverbose' `-nolimit' CONTEXT
If a folder is given, it will become the current folder. If the current message is moved, sortm will preserve its status as current. HISTORY
Timezones used to be ignored when comparing dates: they aren't any more. Messages which were in the folder, but not specified by `msgs', used to be moved to the end of the folder; now such messages are left untouched. Sortm sometimes did not preserve the message numbering in a folder (e.g., messages 1, 3, and 5, might have been renumbered to 1, 2, 3 after sorting). This was a bug, and has been fixed. To compress the message numbering in a folder, use "folder -pack" as always. BUGS
If sortm encounters a message without a date-field, or if the message has a date-field that sortm cannot parse, then sortm attempts to keep the message in the same relative position. This does not always work. For instance, if the first message encountered lacks a date which can be parsed, then it will usually be placed at the end of the messages being sorted. When sortm complains about a message which it can't temporally order, it complains about the message number prior to sorting. It should indicate what the message number will be after sorting. MH.6.8 11 June 2012 SORTM(1)
All times are GMT -4. The time now is 04:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy