08-20-2008
for file in `ls -1 *.*`
do
dir="`stat -c "%y|%n" $file | cut -c1-4`/`stat -c "%y|%n" $file | cut -c6-7`"
echo $dir
if [ ! -d $dir ]
then
mkdir -p $dir
fi
cp $file $dir
done
Last edited by sudhamacs; 08-20-2008 at 03:34 PM..
7 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
When i use, 'ls -ltr' I only see the month and day (timestamp) of the file.
How do i see the year also.
Thanks and Regards,
Ram (1 Reply)
Discussion started by: ramky79
1 Replies
2. UNIX for Dummies Questions & Answers
I have a directory which has crores of files since from 2003. I want to move only the 2003 files to another directory. Please help in doing this.
Thanks (1 Reply)
Discussion started by: IHK
1 Replies
3. Shell Programming and Scripting
Hi All,
I have a directory which has crores of files since from 2003 till now. I want to move only the 2003 files to another directory. Please help.
Thanks (2 Replies)
Discussion started by: IHK
2 Replies
4. UNIX for Dummies Questions & Answers
Hi All,
I have a directory which has crores of files since from 2003. I want to move ony the 2003 files to another directory. Please help (9 Replies)
Discussion started by: IHK
9 Replies
5. UNIX for Dummies Questions & Answers
I am trying to move file created/modified in 2008 year to <new directory>. But trapped badly in Xargs {}.
Looks like mv is not getting destination file properly. It assumes source file s to be destination directory n gives me erroir. "Target must be a directory"
Run-
#/home/mktrisk: find... (4 Replies)
Discussion started by: kedar.mehta
4 Replies
6. Shell Programming and Scripting
Hi
I need to get the File creation date (MM,DD,YYYY)
using ls -ltr am getting only Month and Day only, I need year also when the file is modified.
Thanks (3 Replies)
Discussion started by: KiranKumarKarre
3 Replies
7. Red Hat
Hi all,
I have a massive amount of recording files in .WAV format stored in a directory, files dating back to 2006.
It is a huge amount of files as Linux cannot even do a listing of it all, it states: "argument list too long"
What I would like to do is the following:
Find all the files of... (6 Replies)
Discussion started by: codenjanod
6 Replies
curs_move(3) Library Functions Manual curs_move(3)
NAME
curs_move, move, wmove - Move the Curses window cursor
SYNOPSIS
#include <curses.h>
int move(
int y,
int x ); int wmove(
WINDOW *win,
int y,
int x );
LIBRARY
Curses Library (libcurses)
STANDARDS
Interfaces documented on this reference page conform to industry standards as follows:
move, wmove: XCURSES4.2
Refer to the standards(5) reference page for more information about industry standards and associated tags.
DESCRIPTION
These routines move the cursor associated with the Curses window to line y and column x. They do not move the physical cursor of the ter-
minal until refresh is called. The specified position is relative to (0,0), which is the upper left-hand corner of the window.
NOTES
The header file <curses.h> automatically includes the header file <stdio.h>.
Note that move may be a macro.
RETURN VALUES
These routines return the integer ERR upon failure and OK upon successful completion.
SEE ALSO
Functions: curses(3), curs_refresh(3)
Others: standards(5)
curs_move(3)