Visit Our UNIX and Linux User Community

Setting Directory Time

Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Setting Directory Time
# 1  
Old 10-16-2003
Setting Directory Time

How would I modify the time of a directory? The touch command appears to only work on files and I searched through the threads looking for an example on dealing with directories.

I have a directory that has a recent date, but none of the files within the directory are recent. I'd like to set the directory date/time to be equal to the most recent file date/time within that directory.

A script example would be great so I could recurse through directories, but a manual command would be helpful.
# 2  
Old 10-16-2003
This works for me.

# mkdir filedir

# touch -t 12012300 filedir

changes the time stamp to Dec 3 2003 and 2300pm for time.
# 3  
Old 10-17-2003
Thanks. I attempted the same thing using my login id and it came back with the message that "xxx is a directory", but when I logged as root it worked fine.

Previous Thread | Next Thread
Test Your Knowledge in Computers #1000
Difficulty: Medium
Trusted Computer System Evaluation Criteria (TCSEC) is frequently referred to as the Red Book.
True or False?

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Setting time for running of the script

Dear all, I wonder if it is possible that we can run the script from time to time..I meant, it should repeat the sourcing of the script by itself? In my case, I need to source this script manually from time to time, like once in every 10 minutes. emily, (2 Replies)
Discussion started by: emily
2 Replies

2. Solaris

Time setting on Solaris 10

Hi all, Any idea please how to: -Change Time format from 24h format to 12h format (AM and PM) -Turn off DST: Daylight Save Time on a Solaris10 server Thanks in advance (1 Reply)
Discussion started by: rafikrafik09
1 Replies

3. UNIX for Dummies Questions & Answers

Setting time from application

Hello all, I wish to set the time and date of the system from my application. (I write code in C ). How can it be done? I found the function stime() - but it gets time in seconds as a parameter, and I don't know how to convert my time & date to seconds since EPOCH. What's the best... (0 Replies)
Discussion started by: klafte
0 Replies

4. Linux

Process time-to-live setting

I have a cron job scheduled to run every 5 mins, and run a php script. Something was not right about the script and when I checked the server had very little spare memory. Looked in running processes and I could see that many instances of the script were still running. I am new to this whole... (1 Reply)
Discussion started by: edzillion
1 Replies

5. Solaris

Setting up SSH - first time

Good day to you all. I have a server (running on SunOS 5.8) that i always got into via telnet. I have eventually decided to block telnet access to it and instead look toward using SSH. The problem is, whne i establish the SSH connection via PuTTy, i get the "Log in as" prompt, but upon... (5 Replies)
Discussion started by: de049
5 Replies

6. UNIX for Dummies Questions & Answers

need help setting time!

I am trying to change the time on a Sun Solaris System, but I am having some difficulties. I thought by accessing the clock icon in the CDE would allow me to change the time. Also when I clicked the help icon I still could not fine any information. (1 Reply)
Discussion started by: wmosley2
1 Replies

7. UNIX for Dummies Questions & Answers

Findout Idle Time Setting

Hi Guru's, How do I find and set the login idle time setting in HP-UX 32? Thanks in advance, Mani (1 Reply)
Discussion started by: jvmani
1 Replies

8. UNIX for Dummies Questions & Answers

Time zone setting

Tru64 (4.0D) How to change the time zone setting for the system? Sanjay (5 Replies)
Discussion started by: sanjay_g
5 Replies

9. UNIX for Dummies Questions & Answers

setting session time

Please lemme know how & where to set the session time for ftp connection in Wu-ftp . Regards Gambhi. (5 Replies)
Discussion started by: gambhi_s
5 Replies

10. UNIX for Dummies Questions & Answers

setting date and time

how do i set the system date and time? i know i have to be root to do it but i'm new to unix--really new--and some of this stuff seems really cryptic. thanks for any help.:confused: (2 Replies)
Discussion started by: singlefin
2 Replies

Featured Tech Videos