Create a directory with previous date | Unix Linux Forums | Shell Programming and Scripting

  Unix/Linux Go Back    


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

Create a directory with previous date

Shell Programming and Scripting


Tags
create a directory with previous date

Closed Linux or Unix Question    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 07-12-2013
krupasindhu18 krupasindhu18 is offline
Registered User
 
Join Date: Sep 2011
Last Activity: 24 September 2014, 9:29 AM EDT
Location: Chennai,India
Posts: 76
Thanks: 13
Thanked 1 Time in 1 Post
Create a directory with previous date

Hi All,
can any body tell me how to create a new directory with previous time stamp in HP-UX?.

e.g i am creating a file like
Code:
touch -t 07022013 kkk
-rw-r-----   1 feeds      sys              0 Jul  2 20:13 kkk

same how can i create a directory?
please help me.

Thanks & Regards,
Krupa

Last edited by radoulov; 07-12-2013 at 07:19 AM..
Sponsored Links
    #2  
Old Unix and Linux 07-12-2013
hicksd8 hicksd8 is offline Forum Advisor  
Registered User
 
Join Date: Feb 2012
Last Activity: 30 March 2015, 4:18 PM EDT
Location: Cornwall, UK
Posts: 908
Thanks: 59
Thanked 187 Times in 164 Posts
I'm not a HP-UX expert but talking generic Unix, the 'touch' command works on either a file or a directory.

Have you tried.............

Create new directory

Code:
 
mkdir <dirname>

Set timestamp of this directory

Code:
 
touch <opt> <timestamp> <dirname>

Sponsored Links
    #3  
Old Unix and Linux 07-12-2013
krupasindhu18 krupasindhu18 is offline
Registered User
 
Join Date: Sep 2011
Last Activity: 24 September 2014, 9:29 AM EDT
Location: Chennai,India
Posts: 76
Thanks: 13
Thanked 1 Time in 1 Post
Create a directory with previous date

Hi,

can you please give me an example?

Thanks & Regards,
Krupa
    #4  
Old Unix and Linux 07-12-2013
siddharthjindal siddharthjindal is offline
Registered User
 
Join Date: Jul 2010
Last Activity: 12 July 2013, 7:23 AM EDT
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts

Code:
mkdir abc
touch -t 02072013 abc


Last edited by radoulov; 07-12-2013 at 07:19 AM..
Sponsored Links
    #5  
Old Unix and Linux 07-12-2013
krupasindhu18 krupasindhu18 is offline
Registered User
 
Join Date: Sep 2011
Last Activity: 24 September 2014, 9:29 AM EDT
Location: Chennai,India
Posts: 76
Thanks: 13
Thanked 1 Time in 1 Post
Create a directory with previous date

Thanks a lot i have tried as per your instruction ... it worked... Unix or Linux Image
Thanks Again
Sponsored Links
Closed Linux or Unix Question

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Unix or Linux Image More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Create a directory named as the current date FeNiCrC_Neil Shell Programming and Scripting 3 09-25-2010 03:36 PM
Create a directory using current date aric87 UNIX for Dummies Questions & Answers 3 02-23-2010 05:06 AM
want to create directory with the previous date sridhusha Shell Programming and Scripting 7 11-19-2007 04:44 AM
Directory create date Bab00shka UNIX for Dummies Questions & Answers 2 06-29-2005 10:42 AM
create directory named current date flowrats UNIX for Dummies Questions & Answers 2 07-30-2002 11:26 PM



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