AGID
Posts: 36
Joined: Tue Mar 17, 2020 1:02 pm

emptying or deleting large restart.txt file from root

Fri Mar 27, 2020 2:21 pm

Hello everyone,

I was wondering if there is a way to delete or empty restart.txt in root because it takes so much space. is it possible?

Thanks alot

pcmanbob
Posts: 9298
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: emptying or deleting large restart.txt file from root

Fri Mar 27, 2020 2:46 pm

Deleting files in Linux is done using rm at the command line.

So to delete a file in the current directory you would use rm file_1.txt

to delete a file in another directory you would use rm /path/to/the/file/file_1.txt

if the file is own by another user such as root you will need to use sudo in front of the rm command

so to delete your file sudo rm /restart.txt


https://www.howtogeek.com/409115/how-to ... -terminal/
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

AGID
Posts: 36
Joined: Tue Mar 17, 2020 1:02 pm

Re: emptying or deleting large restart.txt file from root

Fri Mar 27, 2020 4:10 pm

Thanks for your fast reply but i tried sudo rm restart.txt but it didn't delete it.

jahboater
Posts: 5680
Joined: Wed Feb 04, 2015 6:38 pm
Location: West Dorset

Re: emptying or deleting large restart.txt file from root

Fri Mar 27, 2020 4:15 pm

AGID wrote:
Fri Mar 27, 2020 4:10 pm
Thanks for your fast reply but i tried sudo rm restart.txt but it didn't delete it.
Is restart.txt in your current directory?
Pi4 8GB running PIOS64

User avatar
DougieLawson
Posts: 38883
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: emptying or deleting large restart.txt file from root

Fri Mar 27, 2020 4:42 pm

jahboater wrote:
Fri Mar 27, 2020 4:15 pm
AGID wrote:
Fri Mar 27, 2020 4:10 pm
Thanks for your fast reply but i tried sudo rm restart.txt but it didn't delete it.
Is restart.txt in your current directory?
Has your SDCard failed to a read-only status?
What happens if you run touch /home/pi/test.file; sudo reboot then after the reboot is complete run cat /home/pi/test.file?
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

pcmanbob
Posts: 9298
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: emptying or deleting large restart.txt file from root

Fri Mar 27, 2020 5:53 pm

AGID wrote:
Fri Mar 27, 2020 4:10 pm
Thanks for your fast reply but i tried sudo rm restart.txt but it didn't delete it.
You said the file was in root assuming that is the root directory and you are in the default /home/pi directory you need to add the path.

So as I posted before try sudo rm /restart.txt

Adding the / this time, failing that please post the exact path to the file you want to delete.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

AGID
Posts: 36
Joined: Tue Mar 17, 2020 1:02 pm

Re: emptying or deleting large restart.txt file from root

Fri Mar 27, 2020 7:40 pm

It was problem with file explorer so i had to reload it and it worked. Thanks for all the help.

Return to “Raspberry Pi OS”