The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Need find a file based length J_ang UNIX for Dummies Questions & Answers 8 03-26-2007 08:21 AM
how to move files into different folders based on filename italia5 UNIX for Dummies Questions & Answers 7 08-23-2006 10:04 AM
How would I make a find command NOT show the path of a file? LordJezo Shell Programming and Scripting 1 10-01-2004 06:01 AM
find filename based on file content kollerj UNIX for Dummies Questions & Answers 4 06-02-2001 01:31 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 04-18-2007
Helmi Helmi is offline
Registered User
  
 

Join Date: Apr 2007
Posts: 15
Find, make and move file based on username

hi there,
i'm new to UNIX( just 3month used),
i found my new box contained alot of files and directories in /home/box/
i've tried to search script in tis forum and found many of them but, i don't know
how to combine them to make a script, although using pipes.
my tasks are:

1) to scan user dir in /home/user/ - i'm used ls-ld /home/$user/ , $user must be key in.

2) Then, grouping all files in scanned dir(in task 1), into group of extensions such as ".txt",".sh",".dat"
i used the ls -l | awk 'BEGIN {FS="."} {print $2}'>index.txt

3) Based on index.txt, i'm going to make directories referring to those extensions eg.
/home/user/txtExtension
/home/user/datExtension/

then move all of files to their extension dir. i'm sorry, i can't find the way to create this script.

i tried all my best to combine all above simple script but, no.3 is quite hard for me.
is there any UNIX-Shell expert have ideas, solutions, or even example scripts to guide me
Regards,
Helmi.
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:08 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0