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 04-19-2011, 09:02 AM   #1
kern68
Member
 
Registered: Jun 2010
Distribution: Ubuntu, CentOS
Posts: 31

Rep: Reputation: 0
Closing a file...


If a file is opened from the comman prompt with something like:

gedit somefile &

Is there a way to close somefile while leaving the instance of gedit still open?

My idea is that sometimes I will have more than one file open in gedit. I run a script daily that updates to a log file. The log file is then opened and viewed with gedit.

Thanks for any help or suggestions.
 
Old 04-19-2011, 09:14 AM   #2
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,474

Rep: Reputation: 189Reputation: 189
In gedit, just click on the somefile tab's "x" instead of the window bar "x".
 
Old 04-19-2011, 09:37 AM   #3
kern68
Member
 
Registered: Jun 2010
Distribution: Ubuntu, CentOS
Posts: 31

Original Poster
Rep: Reputation: 0
I needed to be a bit more specific.

From the command prompt, how can I close one file that is opened in gedit, while leaving other files opened with gedit.

Hope this clears things up a bit.
 
Old 04-19-2011, 11:00 AM   #4
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,085

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
kilgoretrout gave you the answer.

You need to look closely at your gedit window when it has a file open.

On the line below "Open" "Save" etc there is a little tab with the name of your file. Try opening another file - it'll have a little tab as well.
On those tabs is an X Clicking it closes the file not gedit.

Edit: If you want to do this from the command line (close one tabbed file in gedit, leaving the others open) I do not think you can do this, but why would you want to?

Last edited by tredegar; 04-19-2011 at 11:07 AM.
 
Old 04-19-2011, 08:37 PM   #5
kern68
Member
 
Registered: Jun 2010
Distribution: Ubuntu, CentOS
Posts: 31

Original Poster
Rep: Reputation: 0
There has been several instances where I will have sevaral files opened in gedit.

My logic is to do the following from the command prompt:
1-Close logfile that was opened with gedit, while keeping other files opened
2-Run script to update the logfile
3-Reopen logfile using gedit

I am only interested with the changes to the logfile. Could there be an easier way the do this, may be using a different file viewer? I am open to suggestions.

Thank you for any help or input.
GeoK
 
Old 04-19-2011, 10:54 PM   #6
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
Hi,

gedit is for editing files, you seem to just want to view them. Additionally you want to watch the file as it updates. For this purpose "tail -f" would probably be a good choice:

Code:
tail -f somefile
Use Ctrl-C in the terminal when you want to stop looking at the file.

Evo2.
 
1 members found this post helpful.
  


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
What does closing an file descriptor mean? rainman1985_2010 Programming 2 03-13-2011 01:56 PM
FIle browser keeps reopening after closing it immortaltechnique Ubuntu 2 06-19-2010 02:56 AM
Evince closing when I open a particular file ThinkFree Linux - Software 2 08-16-2009 02:11 AM
Where is the bottleneck in file opening and closing dman65 Programming 13 03-05-2009 08:58 AM
Closing file descriptors nikin Linux - Newbie 2 06-05-2008 05:16 AM


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

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration