Newbie learn more UNIX


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Newbie learn more UNIX
# 1  
Old 03-23-2006
Newbie learn more UNIX

1. If I want to check directory INPUT which files are not update within
5 minutes then move them to DATA1 directory
$ echo a > A.20060321.txt;echo b > B.20060321.txt;echo c > C.20060321.txt;
echo d > D.20060321.txt
$touch control_time; sleep 300
$find . ! -newer control_time -name "*.txt" -print

How do I make a script so if it is not update in 5 min then move it to
directory DATA1 ?

2. If in DATA1 directory have 4 files A, B, C, D with the same date like 20060321
then move it to DATA3 directory ,


3. And if that date like 20060321 have 4 files then
also move all of the files before that date to DATA4.
Thanks.
# 2  
Old 03-24-2006
Quote:
Originally Posted by sabercats
1. If I want to check directory INPUT which files are not update within
5 minutes then move them to DATA1 directory
$ echo a > A.20060321.txt;echo b > B.20060321.txt;echo c > C.20060321.txt;
echo d > D.20060321.txt
$touch control_time; sleep 300
$find . ! -newer control_time -name "*.txt" -print

How do I make a script so if it is not update in 5 min then move it to
directory DATA1 ?
.
Here is my code for this
find . ! -newer control_time -name "*.txt" -exec mv {} ./DATA1 \;


Anyone know about 2 and 3 ? Thannks !

2. If in DATA1 directory have 4 files A, B, C, D with the same date like 20060321 then move it to DATA3 directory ,


3. And if that date like 20060321 have 4 files then
also move all of the files before that date to DATA4.
Thanks
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Solaris

newbie - learn Solaris 10 or 11?

Hello, I looking for becoming a Solaris system administrator. Background: I consider myself an entry-level Linux system administrator. I don't know if I start my studies with Solaris 10 or 11. Maybe Solaris 11 because it's the new thing and the future, and Solaris 10 because since Solaris is... (2 Replies)
Discussion started by: albertoridolfi
2 Replies

2. UNIX for Dummies Questions & Answers

Newbie looking to learn Red Hat

Hi there, I'm looking at learning about Red Hat, I am a beginner, can anyone point me in the direction of the best books/manuals to purchase? there are so many available at the moment. Thanks in advance PJ (4 Replies)
Discussion started by: Paul John
4 Replies

3. UNIX for Dummies Questions & Answers

Best way to learn UNIX

Hi, I am the ultimate noob when it comes to UNIX. Apart from a few basic thing like ls -l and mkdir (and that really is about as good as it gets) I know absolutely nothing about UNIX and I want to learn it and get better! I'm sure like with most things, just getting stuck in and trying... (3 Replies)
Discussion started by: thebdj
3 Replies

4. Linux

**Newbie** Need help to learn.

Hi, I have just now started working with a company. I am working on black screen and earlier I didn't knew whether it was unix or linux but today I searched google and found uname command and found that I am using Linux kernel :D . As you all must've figured out that I am a real ultra newbie and... (5 Replies)
Discussion started by: csrohit
5 Replies

5. UNIX for Dummies Questions & Answers

UNIX newbie NEWBIE question!

Hello everyone, Just started UNIX today! In our school we use solaris. I just want to know how do I setup Solaris 10 not the GUI one, the one where you have to type the commands like ECHO, ls, pwd, etc... I have windows xp and I also have vmware. I hope I am not missing anything! :p (4 Replies)
Discussion started by: Hanamachi
4 Replies

6. UNIX for Dummies Questions & Answers

Where 2 learn unix ??????

HI . my friends am very ewager to learn unix and its operations can any experts can say wher can i easily learn unix through net and give me some links to learn unix through also tutorials.plz help me am very interested also i want ot learn AIX so only am asking this help my... (1 Reply)
Discussion started by: harsath24330
1 Replies

7. UNIX for Dummies Questions & Answers

newbie: way to learn more about server's resource usage

I have a dedicated server running centos. It is "slightly managed" meaning I get a little help if I desperately need it; otherwise on my own. Many of the programs on this server I've had to write myself (less than optimal code for sure). Others are commercial but some are renowned resource... (2 Replies)
Discussion started by: blakekr
2 Replies

8. UNIX for Dummies Questions & Answers

want to learn unix

Hey guys, I would like to learn unix but first i need to start to load unix OS into my computer but i dont know where to start or get the CD to load...help appreciated...thanks (2 Replies)
Discussion started by: rxsonny
2 Replies

9. UNIX for Dummies Questions & Answers

want to learn unix

Hi, I am a new joinee.i want to know completely about unix.could you give me some links or soft copies so that i can be good at subject. thank you. (5 Replies)
Discussion started by: mohanp
5 Replies
Login or Register to Ask a Question