LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Closing a file... (https://www.linuxquestions.org/questions/linux-newbie-8/closing-a-file-875874/)

kern68 04-19-2011 08:02 AM

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.

kilgoretrout 04-19-2011 08:14 AM

In gedit, just click on the somefile tab's "x" instead of the window bar "x".

kern68 04-19-2011 08:37 AM

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.

tredegar 04-19-2011 10:00 AM

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?

kern68 04-19-2011 07:37 PM

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

evo2 04-19-2011 09:54 PM

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.


All times are GMT -5. The time now is 04:21 AM.