| Article: |
Learning the Terminal in Jaguar, Part 1 | |
| Subject: | Safari | |
| Date: | 2005-01-04 17:59:23 | |
| From: | yizzle123 | |
| Can I open safari with the terminal? Also can I read whats happening when I go to a website, from the terminal, in code? | ||
Showing messages 1 through 3 of 3.
-
Using terminal to "see" a web request
2005-06-07 14:24:23 xurizaemon [View]
-
Safari
2005-06-07 14:18:59 xurizaemon [View]
Yes. In Terminal, you can use the "open" command to open files, URLs, or applications.
## launches a specific application
## (maybe can give URL or file as argument?)
$ open /Applications/Safari.app
## goes to www.oreillynet.com
## in your preferred browser
$ open http://oreillynet.com/
## opens /Documents/MyFile.txt in your home dir
## using default text editor
$ open ~/Documents/MyFile.txt
## opens your Pictures folder in Finder
open ~/Pictures
Pretty easy, huh? Basically, the 'open' command simulates what you'd normally do with a double-click or CMD+O.
-
Safari
2005-02-10 11:39:18 endian [View]
open safari from terminal:open -a Safari
I don't know what you mean by your latter question. Look at something like tcpdump, or telnet to the web site on port 80telnet www.thesite.com 80



## opens telnet connection to webserver on port 80 (HTTP)
$ telnet webserver.com 80
## webserver prints connection open message here
HEAD /file.html HTTP/1.1
Host: webserver.com
## webserver prints headers returned from URL
## webserver.com/file.html
## or you can retrieve the file like so
GET /file.html HTTP/1.1
Host: webserver.com
## webserver prints the raw HTML (or other) file
## to your terminal
Using the HTTP Headers extension in Mozilla is easier though ;)