Using Terminal and vi

Joined
Nov 15, 2009
Messages
5
Reaction score
0
Points
1
Location
california
Your Mac's Specs
iMac G5
If anyone could assist I would greatly appreciate it...

I am taking a class at community college, "UNIX using Linux" and using Terminal in order to run my scripts. I created a .html file in vi and was instructed to open the file in a web browser to see the web page. However, I cannot find the file I created in order to open it in a web browser.

Where should I be looking for the file?

Thanks
 
Joined
Mar 17, 2008
Messages
6,879
Reaction score
191
Points
63
Location
Tucson, AZ
Your Mac's Specs
Way... way too many specs to list.
where did you save it? If you didn't change directories it's very likely in your home directory which would be /Users/<username>

But, I can't believe they've got you doing vi without introducing you to the pwd command. Open terminal, do a ls, and if you see the file, do pwd. If not... do..

find / -name <filename>
 
OP
T
Joined
Nov 15, 2009
Messages
5
Reaction score
0
Points
1
Location
california
Your Mac's Specs
iMac G5
Well...they did teach pwd in the beginning of the book, but apparently I'm not retaining all the commands and how all this goes together...lol.

Anywho...I connected to the school's server and did ls and I can see the file in the home directory, but I guess I'm still confused as to how to open it in a web browser...sorry...

Thank you for the quick response :)
 
Joined
Mar 17, 2008
Messages
6,879
Reaction score
191
Points
63
Location
Tucson, AZ
Your Mac's Specs
Way... way too many specs to list.
OhhhHH is this on your schools account? If so is there a public_html directory in your home directory? If there is, mv the file to that, chmod 755 the file and you should be able to access it.. typically via something like

http://your.schools.domain/~yourusername

Since you can use vi on your mac.. I was confused as to where you were talking about
 
OP
T
Joined
Nov 15, 2009
Messages
5
Reaction score
0
Points
1
Location
california
Your Mac's Specs
iMac G5
You ROCK!!!! Thank you sooooo much!!!
 
Joined
Jan 27, 2009
Messages
531
Reaction score
4
Points
18
Location
New York, NY
Your Mac's Specs
17" MacBook Pro, 2.5 GHz Intel Core 2 Duo Processor, 2 GB 667 MHz DDR2 SDRAM, not unibody
And by the way what exactly does the "ls" command do?
 

cwa107


Retired Staff
Joined
Dec 20, 2006
Messages
27,042
Reaction score
812
Points
113
Location
Lake Mary, Florida
Your Mac's Specs
14" MacBook Pro M1 Pro, 16GB RAM, 1TB SSD
And by the way what exactly does the "ls" command do?

It shows the directory contents. Similar to the 'dir' command in DOS.

Anytime you want to find out what a UNIX command does, type 'man <command>'. In this case, you'd type:

Code:
man ls

And you'd get:

Code:
LS(1)                     BSD General Commands Manual                    LS(1)

NAME
     ls -- list directory contents

SYNOPSIS
     ls [-ABCFGHLOPRSTUW@abcdefghiklmnopqrstuwx1] [file ...]

DESCRIPTION
     For each operand that names a file of a type other than directory, ls
     displays its name as well as any requested, associated information.  For
     each operand that names a file of type directory, ls displays the names
     of files contained within that directory, as well as any requested, asso-
     ciated information.

     If no operands are given, the contents of the current directory are dis-
     played.  If more than one operand is given, non-directory operands are
     displayed first; directory and non-directory operands are sorted sepa-
     rately and in lexicographical order.

     The following options are available:

...and if you hit the space bar, it will go on to list all of the arguments.
 
Joined
Mar 17, 2008
Messages
6,879
Reaction score
191
Points
63
Location
Tucson, AZ
Your Mac's Specs
Way... way too many specs to list.
or the arrow keys, since man uses 'less' to display the file contents
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top