LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How can I delete my 'nano' history? (https://www.linuxquestions.org/questions/linux-newbie-8/how-can-i-delete-my-nano-history-4175657463/)

linx9 07-16-2019 01:01 AM

How can I delete my 'nano' history?
 
I was surprised to see that when i went into nano and did 'ctl R' and then 'ctl T' that the names of old files from my home folder were still there in nano. I would like to delete this list for privacy measures.

If I go into terminal, "nano ~/.bash_history", it does NOT list those file names. It is only when I do ctl r and t do i see the list, but I don't know how to delete them; hitting delete does nothing and I don't see any commands to delete the entire 'file name'; the files are no longer in the home directory.

Cheers

eklavya 07-16-2019 01:38 AM

Can you see your searches in the file ~/.nano/search_history? You can delete these and try again.

If you want to stop making log of your nano history
Open the file /etc/nanorc and comment the line set historylog in this section
set historylog

linx9 07-16-2019 02:40 AM

Quote:

Originally Posted by eklavya (Post 6015438)
Can you see your searches in the file ~/.nano/search_history? You can delete these and try again.

If you want to stop making log of your nano history
Open the file /etc/nanorc and comment the line set historylog in this section
set historylog

Do what to "set history log"?

individual 07-16-2019 02:41 AM

Quote:

Originally Posted by linx9 (Post 6015446)
Do what to "set history log"?

Put a # in front of that line.

linx9 07-16-2019 03:07 AM

Quote:

Originally Posted by individual (Post 6015448)
Put a # in front of that line.

I did. But still need to clear nano history.

cheers

linx9 07-16-2019 03:10 AM

Quote:

Originally Posted by eklavya (Post 6015438)
Can you see your searches in the file ~/.nano/search_history? You can delete these and try again.

If you want to stop making log of your nano history
Open the file /etc/nanorc and comment the line set historylog in this section
set historylog

In a terminal, "no such file or directory": ~/.nano/search_history

eklavya 07-16-2019 03:24 AM

Quote:

Originally Posted by linx9 (Post 6015451)
In a terminal, "no such file or directory": ~/.nano/search_history

can you check file $HOME/.nano_history?

linx9 07-16-2019 05:00 AM

Quote:

Originally Posted by eklavya (Post 6015455)
can you check file $HOME/.nano_history?

no such file with and without a / before home/ HOME, etc

timl 07-16-2019 05:35 AM

Apologies if you have already tried this but in your home directory can you type
Quote:

[tim@eraserhead ~]$ ls -a
The "a" switch shows hidden files.

ttpp 07-16-2019 07:08 AM

Quote:

Originally Posted by timl (Post 6015481)
Apologies if you have already tried this but in your home directory can you type
The "a" switch shows hidden files.

Thanks. Yes, that does show the names of them, but once I get them there, how would I delete them?

"lock.filename.odt#"

michaelk 07-16-2019 07:47 AM

If I understand your problem. Invoking ^t will display files that do not exist from the command line or another file browser?

From the nano manual:
Quote:

When in the Read-File (^R) or Write-Out menu (^O), pressing ^T will invoke the file browser. Here, one can navigate directories in a graphical manner in order to find the desired file.
I guess I really have not delved into all the nano settings but are you sure you are looking in the correct directory? As far as I can tell ctrl-t it is just a file browser and displays the current contents of the selected directory.

nano will create backup files which have the suffix ~.

~/.nano_history is for saving and reading search/replace strings.

Take a look at your nanorc file(s).

https://www.nano-editor.org/dist/latest/nano.html

linx9 07-16-2019 09:58 PM

Quote:

Originally Posted by michaelk (Post 6015515)
If I understand your problem. Invoking ^t will display files that do not exist from the command line or another file browser?

From the nano manual:


I guess I really have not delved into all the nano settings but are you sure you are looking in the correct directory? As far as I can tell ctrl-t it is just a file browser and displays the current contents of the selected directory.

nano will create backup files which have the suffix ~.

~/.nano_history is for saving and reading search/replace strings.

Take a look at your nanorc file(s).

https://www.nano-editor.org/dist/latest/nano.html

Thanks. When I put a "#" before "set historylog", and then I "ctl O" to write it, when I go back into nano for the same directory, it tells me that the file or directory is currently being modified, do i want to continue. Seems that the file has not written the new command. And it is still saving the names of all new docs. What is not being done to finalize this command? "#set historylog..........ctl O" - yes, from "sudo"

linx9 07-16-2019 10:03 PM

Quote:

Originally Posted by michaelk (Post 6015515)
If I understand your problem. Invoking ^t will display files that do not exist from the command line or another file browser?

From the nano manual:


I guess I really have not delved into all the nano settings but are you sure you are looking in the correct directory? As far as I can tell ctrl-t it is just a file browser and displays the current contents of the selected directory.

nano will create backup files which have the suffix ~.

~/.nano_history is for saving and reading search/replace strings.

Take a look at your nanorc file(s).

https://www.nano-editor.org/dist/latest/nano.html

Thanks. Yes, ctl-t does seem to display the contents of the directory. I'm not sure what the correct directory is since I just want to delete all 'nano-history'. I can go into nano via "sudo nano" or "sudo nano /etc/ssh/sshd_config" and then to 'ctl R' and then 'ctl T' = get same list of all doc titles saved there.

Is nano just holding the titles of the docs or is it actually holding a copy of the files as well???

michaelk 07-16-2019 10:22 PM

nano is not holding anything. ^T is a built in file browser i.e. similar to any graphical application with a file open dialog box.

What history is saved depends on nano's configuration file i.e nanorc as described in the documentation.

linx9 07-16-2019 11:22 PM

Quote:

Originally Posted by michaelk (Post 6015719)
nano is not holding anything. ^T is a built in file browser i.e. similar to any graphical application with a file open dialog box.

What history is saved depends on nano's configuration file i.e nanorc as described in the documentation.

Thanks. Maybe to delete the file list there I could uninstall and then reinstall nano. DO you see a problem with that?


All times are GMT -5. The time now is 05:41 PM.