How Do I Remove a Path from a Variable in Linux?
Contents How Do I Remove a Path in Linux? If You Have Exported the Path from a Terminal Separate Each Dir in Your Path by Line Using Tr. Remove What You Don’t...
Contents
How do I remove a path in Linux?
If you have exported the path from a terminal
- separate each dir in your PATH by line using tr.
- remove what you don’t want (path matching “raj”) using grep -v , and.
- collapse back into a long “:” delimited string using paste .
Must Read
How do I delete a path variable?
Removing Directories from the PATH Variable
It’s easiest to simply open the GUI, copy the contents of the PATH variable (either the User Path or the System Path) to a text editor, and remove the entries you want to delete. Then paste the remaining text back into the Edit Path window, and save.