OSX messed up PATH [duplicate] - macos

This question already has answers here:
restore PATH under Mac OS X [duplicate]
(2 answers)
Closed 7 years ago.
I was trying to make Sublime editor work from Terminal following this guide and by doing so I modified the .bash_profile file and apparently my PATH. While I was doing this I was positioned in some random folder in Terminal, it was /Users/apple/Desktop/RailsCode/readit/ and now if I want to run command open ~./bash_profile it says: The file /Users/apple/Desktop/RailsCode/readit/~./bash_profile does not exist. And it worked before, it seems to me I messed up my default PATH. How to resolve this?

Your command is not quite right:
open ~./bash_profile
^
should be:
open ~/.bash_profile
^

Related

how to open folder in GUI in windows command? [duplicate]

This question already has answers here:
How do I open an Explorer window in a given directory from cmd.exe?
(5 answers)
Closed 6 months ago.
I know that I can open a GUI(Graphical User Interface) folder in MacOS with the command "open .",
but how can I do this in windows?
Thank you!
Okay, I got it!
The answer is to write "start xxx"
PS. xxx is the name of the folder.

A beginner friendly approach for using touch in windows (using powershell) [duplicate]

This question already has answers here:
touch command not working, what should I use instead? [duplicate]
(2 answers)
How to create an empty log or text file with Powershell using date or timestamp?
(1 answer)
Is there a way to use the equivalent of touch in PowerShell to update timestamps of a file?
(2 answers)
Creating new file with touch command in PowerShell error message
(14 answers)
Closed 1 year ago.
Looking for a beginner friendly approach for using touch in windows
I saw this #stack and even tried googling a couple of times , but most of it seemed to create more confusion rather than solve my existing crisis.
Finally I ended up making my own function in powershell which worked similar to creating a file using touch in linux
Read with touch in Powershell using functions
Try creating the below function in powershell
function touch{ ni $args }
ni -> New-Item | if ni doesnt yeild an ans try New-Item instead
which works perfectly
Now you can try out touch as in the image below to create files
But does this mean that you would have to create a function every time you need to use?? Well, not at all my friendos
there is a better way around that. All you have to do is to add it to a powershell profile.
You open your powershell profile with the following command
notepad $profile
All you need to do now is to add the above function to this file and save it. Now close all the powershell that you have open and reopen them.This time the function gets loaded when powershell starts and it works globally which means any instance of powershell can use it now.
a better advanced implementation of touch can be found here thanks to #mklement0

Editing Integrated Terminal in VS Code

I am trying to edit the "current directory" while I am in my integrated terminal in VS Code.
I am running macOS Sierra 10.12.6. VS Code 1.21.1.
Within the integrated terminal, I was able to change the directory by directly editing the PS1 variable, (aka, PS1='\w \u'), but when I save it, it only saves to that specific instance of VS Code. If I open up a new VS Code window, it reverts back to the original PS1 variable.
I checked other Stack Overflow questions and answers, and people tend to advise editing the .bash_profile or another .bash file found in the root. I was not able to find this file in my root, or any other file that helped.
Does anybody know where I can directly edit the PS1 variable, or where VS Code loads the bash profile?
Also, please note I am not trying to edit my actual Terminal settings, only the one that is loaded for VS Code.
Thank you.
I went to my ~/etc directory, edited the .bashrc file via sudo nano .bashrc, and edited the PS1 variable in there.
That .bashrc file was being referenced for both my MacOS Terminal, and the integrated terminal for VS Code. So changing anything in there affected both of those terminals. I hope this information helps!

How to open atom from bash, running in windows 10?

I know the question has been asked before, but then closed together with a not so good answer. Time changes though, and I wonder today, if it is possible?
To launch Atom on a specific dir use the command;
atom dir_of_interest
First, get the file location of atom.exe in your computer. Then, add the following line at the end of your .bashrc file.
alias atom='/mnt/c/<FileLocation>/atom.exe'
Afterwards, run your files from WSL by typing
atom <filename>
Install VcXSrv. Follow these instructions
Install Atom in WSL shell following steps here
Run atom in a terminal to open it

Where is the extensions file for Chrome in OS X 10.7.5? [duplicate]

This question already has answers here:
How to locate Google Chrome extension dir
(2 answers)
Closed 10 years ago.
Everybody seems to find it in this address "~/Library/Application Support/Google/Chrome/Default/Extensions", however, for some reason I don't even have a "Google" folder in "Application Support". Anybody know of any other place where it might be or how to find it?
This is all part of my attempt to fix the problem Chrome 22 has with OS X that the extensions are not being loaded. More specifically, the GWT Developer plug-in.
Run find /Users/username/ -type d -name Google 2> /dev/null on Terminal application.
Take a look at https://stackoverflow.com/a/12872962/944634

Resources