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/)

scasey 07-17-2019 02:06 AM

Quote:

Originally Posted by linx9 (Post 6015731)
Thanks. Maybe to delete the file list there I could uninstall and then reinstall nano. DO you see a problem with that?

I'll give this a shot...

There is no "file list" to delete!
Ctrl-R is Read File
Ctrl-T is just showing you a listing of the files in the current directory -- so that you don't have to type a file name for the Read File (Ctrl-R) command.
That list has nothing to do with "history," or even with nano. It's simply a list of existing files.

You can see the same list by
Code:

ls -a
in that directory.

Go to an empty directory (you may have to mkdir one): Do
Code:

nano
^R
^T

There will be no "list" - only a reference to the parent directory.

There is no history!

linx9 07-17-2019 04:10 AM

Quote:

Originally Posted by scasey (Post 6015751)
I'll give this a shot...

There is no "file list" to delete!
Ctrl-R is Read File
Ctrl-T is just showing you a listing of the files in the current directory -- so that you don't have to type a file name for the Read File (Ctrl-R) command.
That list has nothing to do with "history," or even with nano. It's simply a list of existing files.

You can see the same list by
Code:

ls -a
in that directory.

Go to an empty directory (you may have to mkdir one): Do
Code:

nano
^R
^T

There will be no "list" - only a reference to the parent directory.

There is no history!

Thanks. But, it seems like a history because the files are no longer on the computer, but the list of former files are. Either way, I want to delete whatever 'lists' there are. Simply, I don't want a "list" of the names of the deleted/cut-pasted files/ documents/ pictures ANYWHERE on my computer.

The file names I want to delete from 'ls -a' either have 'lock' at the beginning of the file name or ".swp' at the end.

scasey 07-17-2019 08:40 AM

Quote:

Originally Posted by linx9 (Post 6015778)
Thanks. But, it seems like a history because the files are no longer on the computer, but the list of former files are. Either way, I want to delete whatever 'lists' there are. Simply, I don't want a "list" of the names of the deleted/cut-pasted files/ documents/ pictures ANYWHERE on my computer.

The file names I want to delete from 'ls -a' either have 'lock' at the beginning of the file name or ".swp' at the end.

There is not a way to see a list of files with ls (or nano) "that are no longer on the computer". Both things are showing you files that are on the computer.

Code:

ls -la
will show you who owns the files and when they were created. Are they perhaps backup copies of files you've deleted in the past? Backups made before you deleted the originals?

linx9 07-18-2019 04:27 AM

Quote:

Originally Posted by scasey (Post 6015845)
There is not a way to see a list of files with ls (or nano) "that are no longer on the computer". Both things are showing you files that are on the computer.

Code:

ls -la
will show you who owns the files and when they were created. Are they perhaps backup copies of files you've deleted in the past? Backups made before you deleted the originals?

Thanks. I did not make any backups, and no, the files listed are not on the computer, at least no where visible to me. Here is what ls -la shows:

~$ ls -la
total 548
drwxr-xr-x 20 pell pell 12288 Jul 17 12:17 .
drwxr-xr-x 4 root root 4096 Jan 28 2018 ..
-rw------- 1 pell pell 44 Jul 17 09:21 .bash_history
-rw-rw-r-- 1 pell pell 0 Jun 7 12:14 .bash-history
-rw-rw-r-- 1 pell pell 1024 Jul 16 02:07 ..bash_history.swp
-rw-r--r-- 1 pell pell 220 Jan 27 2018 .bash_logout
-rw-r--r-- 1 pell pell 3771 Jan 27 2018 .bashrc
drwxrwxr-x 9 pell pell 4096 Jul 18 00:34 .cache
drwxr-xr-x 25 pell pell 4096 Jul 17 12:17 .config
drwx------ 3 pell pell 4096 Jan 27 2018 .dbus
drwxrwxr-x 3 pell pell 4096 Jul 6 18:46 Desktop
drwx------ 2 pell pell 4096 Jul 18 00:59 Downloads
drwx------ 3 pell pell 4096 May 2 04:17 .gconf
drwx------ 3 pell pell 4096 Jul 4 02:10 .gnome
-rw-rw-r-- 1 pell pell 1024 Jul 16 01:50 .g.odt.swp
drwx------ 2 pell pell 4096 Jun 4 16:05 .gphoto
-rw-rw-r-- 1 pell pell 39 Jul 6 22:29 .gtk-bookmarks
-rw-rw-r-- 1 pell pell 1024 Jul 16 02:35 .g.txt.swp
drwx------ 2 pell pell 4096 Aug 31 2018 .gvfs
-rw-rw-r-- 1 pell pell 0 Jun 13 06:14 .history
-rw------- 1 pell pell 279426 Jul 17 12:17 .ICEauthority
drwx------ 3 pell pell 4096 Jan 13 2019 .kde
drwxrwxr-x 3 pell pell 4096 Jan 27 2018 .local
-rw-rw-r-- 1 pell pell 73 Dec 11 2018 .~lock.FILENAME copy.odt#
-rw-rw-r-- 1 pell pell 73 Jun 22 06:35 .~lock.NETSTAT -NALP ROOT modified.odt#
-rw-rw-r-- 1 pell pell 73 Jul 14 09:40 .~lock.NAMEFILE.odt#
-rw-rw-r-- 1 pell pell 73 Jun 2 10:40 .~lock.pub1.odt#
-rw-rw-r-- 1 pell pell 0 Jan 21 08:03 .~lock.NAME OF FILE 2020 copy.odt#
-rw-rw-r-- 1 pell pell 0 Jun 25 05:42 .~lock.NAME OF FILE.odt#
drwx------ 3 pell pell 4096 Nov 29 2018 .mozilla
-rw-rw-r-- 1 pell pell 1024 Jun 11 18:57 .NADXXX.odt.swp
drwxrwxr-x 2 pell pell 4096 Jun 11 18:56 .nano
-rw-rw-r-- 1 pell pell 1024 Jun 11 18:57 .newfile.swp
drwx------ 3 pell pell 4096 Jan 27 2018 .pki
-rw-r--r-- 1 pell pell 655 Jan 27 2018 .profile
dr-------- 3 root root 4096 Jul 13 11:06 .protonvpn-cli
drwx------ 2 pell pell 4096 Jun 20 09:57 .ssh
-rw-r--r-- 1 pell pell 0 Jan 27 2018 .sudo_as_admin_successful
drwxrwxr-x 3 pell pell 4096 Sep 11 2018 .thumbnails
drwx------ 5 pell pell 4096 Jul 14 12:09 .thunderbird
-rw------- 1 pell pell 664 Jul 12 06:13 .viminfo
-rw-r--r-- 1 root root 224 Jul 13 11:06 .wget-hsts
-rw-r--r-- 1 pell pell 0 Jan 27 2018 .Xauthority
-rw------- 1 pell pell 25179 Jul 18 01:04 .xsession-errors

scasey 07-18-2019 10:53 AM

Please use [code] tags when posting output, for readability.

The files that start with ~lock and end with .odt are (probably) lock files from OpenOffice. They are very small, and probably don't contain any data. You could cat them to see what in them:
Code:

cat  .~lock.FILENAME copy.odt#
but, given that they are hidden files, I'd just ignore them.
Guessing that this is the home directory of the user pell, yes?
Everything else in that list appears to be user-specific "system" files that should NOT be deleted.

Frankly, I don't see anything to worry about. Just be aware that the ^T command in nano shows you hidden files. There's a reason that files are created that way: So people don't accidentally remove them ;)

Look at what ls -l shows you. Almost nothing, right?

linx9 07-18-2019 11:52 PM

Quote:

Originally Posted by scasey (Post 6016305)
Please use [code] tags when posting output, for readability.

The files that start with ~lock and end with .odt are (probably) lock files from OpenOffice. They are very small, and probably don't contain any data. You could cat them to see what in them:
Code:

cat  .~lock.FILENAME copy.odt#
but, given that they are hidden files, I'd just ignore them.
Guessing that this is the home directory of the user pell, yes?
Everything else in that list appears to be user-specific "system" files that should NOT be deleted.

Frankly, I don't see anything to worry about. Just be aware that the ^T command in nano shows you hidden files. There's a reason that files are created that way: So people don't accidentally remove them ;)

Look at what ls -l shows you. Almost nothing, right?

Thanks - sorry about no code tags.

It's not what is 'in' them, it is simply the 'file names' that concerns me. Yes, home directory of user. For the posting, I changed the real file names.

I will look for info about deleting hidden files, but maybe you or someone knows how to delete hidden files, soley the office docs. Part of the reason I want to do this is so I can educate someone else as to how to clean up their system as the names of files are revealing, even without any content.

michaelk 07-19-2019 04:21 AM

The lock files indicate the file is open and should normally be deleted when you close the file or exit the program unless something crashes. You can safely delete the lock files using the rm command. Make sure you include the first . In the file name.

In addition the .swp files are vim back up files and can also be safely deleted if desired but are ok. Everything else should be left as is.

ttpp 07-19-2019 10:51 AM

Quote:

Originally Posted by michaelk (Post 6016583)
The lock files indicate the file is open and should normally be deleted when you close the file or exit the program unless something crashes. You can safely delete the lock files using the rm command. Make sure you include the first . In the file name.

In addition the .swp files are vim back up files and can also be safely deleted if desired but are ok. Everything else should be left as is.

Thanks. What exactly is the "rm" command?

scasey 07-19-2019 11:54 AM

Quote:

Originally Posted by ttpp (Post 6016662)
Thanks. What exactly is the "rm" command?

see
Code:

man rm

michaelk 07-19-2019 12:01 PM

Quote:

should normally be deleted when you close the file or exit the program unless something crashes.
Just for clarification the lock files should automatically be deleted by Libre or Open office which ever you use and not manually by the user.

linx9 07-20-2019 05:12 PM

Quote:

Originally Posted by scasey (Post 6016679)
see
Code:

man rm

Thanks.

linx9 07-20-2019 05:13 PM

Quote:

Originally Posted by michaelk (Post 6016684)
Just for clarification the lock files should automatically be deleted by Libre or Open office which ever you use and not manually by the user.

Thanks. I was able to remove the .swp files and any "non" locked-libre files, but the libre ones are still there.

michaelk 07-20-2019 05:22 PM

Was there any warning or error messages?

linx9 07-21-2019 09:54 AM

Quote:

Originally Posted by michaelk (Post 6017075)
Was there any warning or error messages?

Thanks. Said file doesn't exist.

JJJCR 07-21-2019 10:06 PM

Quote:

Originally Posted by linx9 (Post 6015778)
Thanks. But, it seems like a history because the files are no longer on the computer, but the list of former files are. Either way, I want to delete whatever 'lists' there are. Simply, I don't want a "list" of the names of the deleted/cut-pasted files/ documents/ pictures ANYWHERE on my computer.

The file names I want to delete from 'ls -a' either have 'lock' at the beginning of the file name or ".swp' at the end.

If you can post an image of what you mean, then I think it will be more clearer and easier for others to help.


All times are GMT -5. The time now is 01:30 AM.