cancel
Showing results for 
Search instead for 
Did you mean: 
jeesshnasree
Starfighter Starfighter
Starfighter
  • 1,067 Views

how to create folders more than 30 days in linux

Jump to solution

Hello All,

 

How to remove older than one month folders &  only current path only .

Please provide command for create folders more than 30 days for Learning & housekeep  practice purpose .

if possible any command then please provide .

I am waiting for your valuable information . 

 

 

Thanks & Regards,

Jeesshnasree

Labels (1)
15 Replies
ARoumiantsev
Flight Engineer
Flight Engineer
  • 662 Views

Hello.

Only would like to make a small remark:  in original task talking about creation "to create folder.., ", but both solution example suggest modification,   it is a big difference:

mkdir new ;  

ls -ld new                    drwxr-xr-x. 2 root root 4096 Aug 22 19:28 new

ls -lcd new                  drwxr-xr-x. 2 root root 4096 Aug 22 19:28 new

but after     touch -d '30 days' new

ls -ld new                    drwxr-xr-x. 2 root root 4096 Sep 21 2025 new

ls -ldc new                  drwxr-xr-x. 2 root root 4096 Aug 22 19:28 new

Please, be more accurate

0 Kudos
Chetan_Tiwary_
Community Manager
Community Manager
  • 652 Views

@ARoumiantsev I am not familiar with any option to "create" a folder with old time stamp other than creating a folder and altering the mtime/atime.

Do you know any method to achieve that ?

ARoumiantsev
Flight Engineer
Flight Engineer
  • 578 Views

I Do not know as well. I am doing remark to highlight that suggested solution solve other problem then original task

0 Kudos
Chetan_Tiwary_
Community Manager
Community Manager
  • 543 Views

@ARoumiantsev ok not an issue, I suppose the original post creator can clarify regarding their question. 

What I could comprehend from the original question was : How to create folder with timestamp more than 30 days ago.

Chetan_Tiwary__0-1755883112540.png

If the request was more clearer then I could have drafted a better response accordingly.

 

shashi01
Moderator
Moderator
  • 500 Views

@ARoumiantsev 

Thank you for pointing out the distinction

I intended to simulate directories that appear older than 30 days, mainly for learning and housekeeping practice (testing cleanup logic with find -mtime).

I appreciate your accuracy. It's a useful reminder, especially when discussing behavior in production environments.

0 Kudos
Blue_bird
Starfighter Starfighter
Starfighter
  • 154 Views

I know that how the files are created with specific time stamp:

touch -t YYMMDDHHMM fileName

I didn't think or even try with this for folder...something new for me...Thank you very much for sharing valuable information..! Nice post..with Nice answers..!

Thanks

 

0 Kudos
Join the discussion
You must log in to join this conversation.