943,592 Members | Top Members by Rank

Ad:
Mar 4th, 2009
0

Create a directory with current date

Expand Post »
Does anyone know of a simple command that could get the date and make a folder (mkdir) as its name?

say todays date

20090304

as the folder name.


I guess the first thing would be grep the date? Then run a mkdir command?

Any help is appreciated!

Thanks
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
egmik3 is offline Offline
34 posts
since Dec 2006
Mar 4th, 2009
0

Re: Create a directory with current date

Also need help on listing the cpu information with echo.

I have these commands I use now:

cat /etc/SuSE-release #Shows version and bit
df -h #Shows Memory +more
top #Shows Ram +more
less /proc/cpuinfo #Shows CPU +more

I am really just looking for these things listed so I know where to start on an upgrade:

CPU
Memory
RAM
OS version
Reputation Points: 10
Solved Threads: 0
Light Poster
egmik3 is offline Offline
34 posts
since Dec 2006
Mar 5th, 2009
0

Re: Create a directory with current date

Hey there,

This should work:

Quote ...
mkdir `date +%Y%m%d`
Best wishes,

Mike
Reputation Points: 102
Solved Threads: 47
Posting Whiz
eggi is offline Offline
399 posts
since Oct 2007

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Shell Scripting Forum Timeline: File doesn't update data
Next Thread in Shell Scripting Forum Timeline: Shell script to scan size of home directories and email when too big





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC