How to Reset Zsh Environment Variables on a MacBook Terminal

힘센캥거루
2025년 10월 23일(수정됨)
1
46
How to Reset Zsh Environment Variables on a MacBook Terminal-1

While using a MacBook or Mac Mini, I accidentally misconfigured the environment variables, and commands like nano, vi, vim, open stopped working.

I thought I had to reinstall everything, but a quick search showed that creating a new .zshrc and adding basic settings would fix it.

First, it's a good idea to backup existing environment variables in case you need them later.

The command mv changes the location or name of a file.

mv ~/.zshrc ~/.zshrc_backup
mv ~/.zprofile ~/.zprofile_backup

Then, enter the following command:

touch ~/.zshrc
echo "export PATH=$PATH" > ~/.zshrc
source ~/.zshrc

touch is a command used to create or update a file.

echo "content" > {filename} adds the content to the specified file. source runs a file in the terminal and is used with ~/.zshrc to modify and apply environment variables.

By entering these commands in the terminal, the terminal will be reset.

However, please note that all previously set environment variables will also be reset.

관련 글

30대 후반 남성의 마운자로 5mg 후기
30대 후반 남성의 마운자로 5mg 후기
나는 키 174cm, 몸무게 87kg의 BMI 지수가 28인 비만이다.예전에는 과체중에서 그쳤는데, 최근 들어 살이 급격하게 늘어나면서 비만에 접어들게 되었다.나이가 30대 후반으로 접어들면서, 기존에 갖고 있던 비중격 만곡으로 인한 코골이가 심해졌다.거기에 더불어 살...
Fixing a Broken LEXON MINA – Full Repair of Internal FFC Cable, Contacts, etc.
Fixing a Broken LEXON MINA – Full Repair of Internal FFC Cable, Contacts, etc.
Weekend evening.I was doing the dishes when my second child suddenly came over going “da, da” while holding something in both hands.It was the LEXON M...
Review of Removing a Wart from My 4‑Year‑Old’s Toe
Review of Removing a Wart from My 4‑Year‑Old’s Toe
One day after giving my child a bath, I was looking at their feet and noticed something dark at the tip of a toe.At first it looked like a corn on the...
Responding to Expired Domain Abuse – When Someone Misuses My Old Domain
Responding to Expired Domain Abuse – When Someone Misuses My Old Domain
My old blog used to be fecu.tistory.com on Tistory.But after deciding to create a Next.js blog, I deleted all the posts on Tistory and even deleted th...
How to Buy an FLX Damper – Fixing a Built-in Closet Damper, Repairing a Closet Door That Slams
How to Buy an FLX Damper – Fixing a Built-in Closet Damper, Repairing a Closet Door That Slams
One day, the door of the built-in closet in the master bedroom started closing with a loud thud.At first I thought we could just close it gently and d...
Sanggye Paik Hospital ER Review – Criteria for Stitches, Dressing Method, and Healing Time for Stitched Wounds
Sanggye Paik Hospital ER Review – Criteria for Stitches, Dressing Method, and Healing Time for Stitched Wounds
I accidentally slipped while picking up a razor I dropped on the bathroom floor.As I struggled to regain my balance, I kicked the edge of the bathtub...

댓글을 불러오는 중...