Hello guys I made a really dumb mistake by adding a python script in .bashrc. I wanted to make this script autostart and followed a tutorial, where it said i should add it to .bashrc. Later on i read that you shouldn t do that. The script is a while Method so it wont stop.

Now my problem is that everytime i start the terminal the script opens and i can t type stuff into it to remove it.
Does somebody know how i can remove the script out of the .bashrc ?

1 Answer 1


You COULD fix this by modifying the SD Card on a Linux system.

You can do this on the Pi itself by rebooting to a root shell and can repair most such problems on the Pi.

1. Append `init=/bin/sh` at the end of `cmdline.txt` and reboot.
2. After booting you will be at the prompt in a root shell.
3. Your root file system is mounted as readonly now, so remount it as
read/write `mount -n -o remount,rw /`

You should then be able to edit .bashrc.

  • Just to clarify, the .bashrc you want will be at /home/pi/.bashrc and not ~/.bashrc as you're logged in as root. Commented Jan 28, 2019 at 10:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.