LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 03-07-2010, 03:45 PM   #1
campanula
LQ Newbie
 
Registered: Feb 2010
Posts: 9
Blog Entries: 3

Rep: Reputation: 0
opening files in text editor from the terminal


I'm sure this is a really obvious answer, but...

using ubuntu 9.10

If I'm in a terminal window, and I open a file by typing eg :
sudo gedit /usr/share/mydms/index.php

it opens as a blank document... I know it has text in it though!

I've tried with other files and also with nano so it's not just a problem with a particular file (although I'm not ruling out a problem with me being thick...)

How do I view the current contents of the file so I can then edit it?

Many thanks,

Katie
 
Old 03-07-2010, 03:50 PM   #2
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 248Reputation: 248Reputation: 248
What does
ls -l /usr/share/mydms/index.php


give you ?
 
Old 03-08-2010, 08:09 AM   #3
campanula
LQ Newbie
 
Registered: Feb 2010
Posts: 9
Blog Entries: 3

Original Poster
Rep: Reputation: 0
-rw-r--r-- 1 root root 1135 2008-06-18 00:51 /usr/share/mydms/index.php

and it works today, so goodness knows what I did differently yesterday several times...

thanks,
Katie
 
Old 03-08-2010, 01:07 PM   #4
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,017

Rep: Reputation: 369Reputation: 369Reputation: 369Reputation: 369
Quote:
goodness knows what I did differently yesterday several times...
You can easily find out (if you are sufficiently interested) by typing history in a terminal.
It'll give you the last 500 or so commands you issued.
I expect you'll notice a spelling mistake in an earlier line that refers to /usr/share/mydms/index.php

An editor that is asked to open a file that does not exist (perhaps by virtue of a mis-type) will open an empty file, assuming that that is what you wanted (quite sensible default behaviour).
 
Old 03-08-2010, 03:51 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,351

Rep: Reputation: 1041Reputation: 1041Reputation: 1041Reputation: 1041Reputation: 1041Reputation: 1041Reputation: 1041Reputation: 1041
Which is why tab completion is so handy ...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Whats your favorite terminal text editor??? Necronomicom Linux - Software 8 12-16-2011 06:45 AM
text editor is not opening up: modified custom command vanna Linux - Newbie 2 03-10-2009 10:57 PM
Text editor capable of opening Images. ////// Programming 5 11-07-2006 10:37 AM
How do I open a text editor in a shell terminal? alex1986 Linux - Newbie 9 11-30-2005 03:52 PM
Opening text files Nicksan Linux - Software 6 06-29-2003 03:06 AM


All times are GMT -5. The time now is 08:22 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration