I messed up when installing Cisco Packet Tracer for Linux and it some how changed a few bash files. After a few hours of looking around and changing my PATH, when I open a new Terminal window I get a message of every PATH that I've had (I think).

Last login: Wed Apr 10 14:38:52 on ttys000
PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/usr/local/share/dotnet:/opt/X11/bin:~/.dotnet/tools:/Applications/Server.app/Contents/ServerRoot/usr/bin:/Applications/Server.app/Contents/ServerRoot/usr/sbin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Applications/Wireshark.app/Contents/MacOS:/Applications/Xamarin Workbooks.app/Contents/SharedSupport/path-bin"; export PATH;

I have tried to reset my PATH without any luck. The same message appears. It is as if it executes it at every new session.

Which file am I suppose to change to make it work? EDIT: when I run as suggested: grep PATH ~/.bash_profile ~/.bash_login

I get: enter image description here

  • 2
    Edit your post with the results of this command- grep PATH ~/.bash_profile ~/.bash_login ~/.profile ~/.bashrc /etc/motd
    – fd0
    Commented Apr 10, 2019 at 14:25
  • 1
    Better to copy terminal output into the question as text not an image So we can use text tools and copy it
    – mmmmmm
    Commented Apr 11, 2019 at 16:41

1 Answer 1


Method #1, inspection of files

Depending on how the software installed it likely would've one or more of these files:

  • /etc/profile
  • /etc/bashrc
  • ~/.bash_profile

Given it's a Linux scripted installer running on macOS it will likely have created some additional files which are typically not present on macOS but can augment the behavior of Bash when they're encountered.

  • ~/.bashrc
  • /etc/profile.d/*

I'd take care to go through all these locations' files and inspect them for any residual cruft from the Linux installer.

Method #2, searching

Since you have some hints from that $PATH output you could search for files that contain bits from that string. For example:

$ grep -r '/Applications/Xamarin Workbooks.app' /etc ~

And then make note of any files that are returned. These would be the files that require repair.

  • when I run without sudo I get premission denied but with sudo it finds: /etc/paths.d/workbooks:/Applications/Xamarin Workbooks.app/Contents/SharedSupport/path-bin What does that tell you? Commented Apr 11, 2019 at 11:53
  • @MaxLengdell - you'll want to look through more of the entries in that PATH= line to get a better sense of how many files and which locations are in play for this. I'd also look for PATH= as well using that same grep -r ... method and report back. Based on what you've shown it worked in at least shedding light on where to focus the digging. That /etc/path.d doesn't strike me as a Linux directory so I think that may be OK on macOS.
    – slm
    Commented Apr 11, 2019 at 12:18
  • 1
    I don't think the /etc/bashrc and ~/.bashrc files will be relevant. MacOS runs login shells by default, so those aren't read. See this question, I don't know if you're familiar with that site?
    – terdon
    Commented Apr 24, 2019 at 12:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .