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

Shaden's avatar

Forge Commands how To Clear Log File

Hi I like the new Commands feature in Forge, made life easier. I want to make rm *, command in the storage/logs directory. I don't want to test it, worried I might rm something else in root or other dir.

anyone can tell me the command to do that.

BTW, this should be one of the default commands listed.

Thanks

0 likes
3 replies
Wakanda's avatar

@shaden to remove a file in linux

unlink laravel.log
// or
rm laravel.log

NB: make sure you cd to the right directory eg

cd /home/forge/mysite.com/storage/logs

and then execute any of the above commands

Shaden's avatar

@wakanda Thank you, but I was talking about executing the command from the Forge new Commands Tool. using SSH is no problem.

Shaden's avatar
Shaden
OP
Best Answer
Level 4

the command in Forge Commands Utility is

cd storage/logs ; unlink laravel.log

Please or to participate in this conversation.