Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Gabotronix's avatar

Issue creating log files with nano and &&

Hi everybod, in my ubuntu VPS I'm trying to get three commands to run after each other using &&, what I do is create a folder and inside that folder I create two log files using nano, this however doesn't create the log files, only the mai folder, after running the bellow command it tells me file is not writtable and to save into buffer, so I just cancel the operation with no log files created... This are the commands:

sudo mkdir /var/log/peter.com && nano /var/log/peter.com/access.log && nano /var/log/peter.com/error.log
0 likes
1 reply
Tray2's avatar
Tray2
Best Answer
Level 73

Use touch to create the files.

sudo mkdir /var/log/peter.com && touch /var/log/peter.com/access.log && touch /var/log/peter.com/error.log

Please or to participate in this conversation.