New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Operating System General OS operation information and support

Using Terminal and vi


Post Reply New Thread Subscribe

 
Thread Tools
tolunay

 
Member Since: Nov 15, 2009
Location: california
Posts: 5
tolunay is on a distinguished road
Mac Specs: iMac G5

tolunay is offline
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
QUOTE Thanks
Dysfunction

 
Dysfunction's Avatar
 
Member Since: Mar 17, 2008
Location: Tucson, AZ
Posts: 6,638
Dysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant future
Mac Specs: 2008 and 2011 15" mbps, late 11 iMac, iPhone 4s, and too many ipods and other stuff

Dysfunction is offline
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>

mike
This machine kills fascists
Got # ? phear the command line!
QUOTE Thanks
tolunay

 
Member Since: Nov 15, 2009
Location: california
Posts: 5
tolunay is on a distinguished road
Mac Specs: iMac G5

tolunay is offline
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
QUOTE Thanks
Dysfunction

 
Dysfunction's Avatar
 
Member Since: Mar 17, 2008
Location: Tucson, AZ
Posts: 6,638
Dysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant future
Mac Specs: 2008 and 2011 15" mbps, late 11 iMac, iPhone 4s, and too many ipods and other stuff

Dysfunction is offline
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

mike
This machine kills fascists
Got # ? phear the command line!
QUOTE Thanks
tolunay

 
Member Since: Nov 15, 2009
Location: california
Posts: 5
tolunay is on a distinguished road
Mac Specs: iMac G5

tolunay is offline
You ROCK!!!! Thank you sooooo much!!!
QUOTE Thanks
leopard-user1

 
leopard-user1's Avatar
 
Member Since: Jan 27, 2009
Location: New York, NY
Posts: 531
leopard-user1 will become famous soon enough
Mac Specs: 17" MacBook Pro, 2.5 GHz Intel Core 2 Duo Processor, 2 GB 667 MHz DDR2 SDRAM, not unibody

leopard-user1 is offline
And by the way what exactly does the "ls" command do?


(from scienceteecher.com)
17" MacBook Pro, OSX 10.6.2 Snow Leopard
QUOTE Thanks
cwa107

 
cwa107's Avatar
 
Member Since: Dec 20, 2006
Location: Middletown, Pennsylvania
Posts: 26,494
cwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond repute
Mac Specs: 15" MBP, Core i7/2GHz, 8GB RAM, 480GB Crucial M500 SSD

cwa107 is offline
Quote:
Originally Posted by leopard-user1 View Post
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.

Liquid and computers don't mix. It might seem simple, but we see an incredible amount of people post here about spills. Keep drinks and other liquids away from your expensive electronics!
QUOTE Thanks
Dysfunction

 
Dysfunction's Avatar
 
Member Since: Mar 17, 2008
Location: Tucson, AZ
Posts: 6,638
Dysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant future
Mac Specs: 2008 and 2011 15" mbps, late 11 iMac, iPhone 4s, and too many ipods and other stuff

Dysfunction is offline
or the arrow keys, since man uses 'less' to display the file contents

mike
This machine kills fascists
Got # ? phear the command line!
QUOTE Thanks

Post Reply New Thread Subscribe


« Leopard woes | restoreing time machine »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

All times are GMT -4. The time now is 06:12 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?