View Single Post
Old 11-14-2017, 12:43 AM  
Barry-xlovecam
It's 42
 
Industry Role:
Join Date: Jun 2010
Location: Global
Posts: 18,083
you got me thinking about this

Code:
barry@paragon-DS-7:~/temporary/dairy$ mkdir -p $(date +"%Y/%m/%d")/posts
barry@paragon-DS-7:~/temporary/dairy$ mkdir -p $(date +"%Y/%m/%d")/coding
barry@paragon-DS-7:~/temporary/dairy$ mkdir -p $(date +"%Y/%m/%d")/phonecalls
barry@paragon-DS-7:~/temporary/dairy$ mkdir -p $(date +"%Y/%m/%d")/appointments
barry@paragon-DS-7:~/temporary/dairy/2017/11$  cd /home/barry/temporary/dairy/2017/11/14
barry@paragon-DS-7:~/temporary/dairy/2017/11/14$ ls -1F
appointments/
coding/
phonecalls/
posts/

barry@paragon-DS-7:~/temporary/dairy/2017/11/14$
A daily work directory -- LINUX

** here is a better version
Code:
 mkdir -p $(date +"%Y/%m/%d")/appointments &&  touch $_/appointments.txt
this makes

/home/barry/temporary/dairy/2017/11/14/appointments/appointments.txt

Then to find something
Code:
barry@paragon-DS-7:~/temporary/dairy/2017$ grep -rni 'smith'
11/14/appointments/appointments.txt:1:John Smith 10:00 am
barry@paragon-DS-7:~/temporary/dairy/2017$
Linux Bash Scripting: How to create directories for each day of the current month ~ Shell Programming

this is interesting using calc could be tweaked ... this makes a directory structure for the whole month.
Barry-xlovecam is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote