Terminal and localhost
How come if I'm running a localhost in the terminal and click Cmd-K it clears everything as well as blocking the localhost and not giving any access to it?
Thanks, Dan
MacBook Pro 15″, macOS 12.4
How come if I'm running a localhost in the terminal and click Cmd-K it clears everything as well as blocking the localhost and not giving any access to it?
Thanks, Dan
MacBook Pro 15″, macOS 12.4
localhost is an IP name for the current host, using an IP address 127.0.0.1 within the 127/8 loopback block.
The macOS Terminal shortcuts are unrelated to the localhost name and the loopback block.
I’m guessing this question might be about exiting a session; to the default (and customizable) exit behavior of Terminal.
Can you describe what you mean by "running a localhost" or "blocking the localhost"?
yachv_1998 wrote:
I would have the localhost open on terminal and you will be able to see the address, and then I would click cmd k and when I click on the local host tab on the browser it wont open.
⌘ T opens a new tab in Terminal app.
All newly-opened tabs are local sessions (all are on localhost), unless something within the shell customizations on the local Mac issues an ssh command, or a telnet command if that’s been installed, or similar connection, and a connection is created from the Mac into some other server, or into some guest when a VM is installed, or similar.
The shell prompt you are likely seeing from the shell session is determined by your local customization, or by the default PS1 setting in bash or the default PROMPT setting in zsh, or whatever other shell you are using, when no local customization is configured. The default prompt string for some shells can pull in some data from the network setup, which is likely why you’re referencing localhost here.
yachv_1998 wrote:
thanks you, that makes sense! how can i access the local host file? because it has dissapeared...
There is no “local host” file, though there is /etc/hosts. All files on your Mac are on the local host.
Guessing at your goal: download BBEdit (basic functions are free), and use that to open and change the /etc/hosts file.
BBEdit allows access to the text file contents of /etc/hosts from the Mac graphical interface.
The /etc/hosts file is occasionally used for testing a website or such, as a lumpy way of naming the hosts on the local network, as a problematic means of ad blocking, a few other odd and unusual tasks, and for installing what can be malware and some other Really Sketchy things.
The format of the lines included in and added to that file are important. Follow the included doc.
I would have the localhost open on terminal and you will be able to see the address, and then I would click cmd k and when I click on the local host tab on the browser it wont open.
thanks you, that makes sense! how can i access the local host file? because it has dissapeared...
Thanks for the advice!
Terminal and localhost