Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does .lesshst keep showing up in my ~

Tags:

dotfiles

I never use less, and have always used more. It is what I was introduced to, which is probably why I use more more instead of using less more. ( Sorry, that is going to sound a bit of a mess :) )

I just tried less and couldn't even quit out of it, until I realized it took a vi/vim style command. At least, I believe that is what happened.

By in ~ there is always a .lesshst file, which I rm all the time, as I would prefer to use more or nano for simple stuff and I can use TextMate for simple text editing, or Sublime or whatever else I am in the mood for.

I also just noticed ".jbapps-myusername" is in ~ now as well. This showed up 2 days ago, and I don't recall installing anything strange. Any idea what it is? I have never jailbroken my phone, and don't install hacks on my machine. Those things that do go into that grey area are getting played with in a VM, not on the core of the machine I am working on as my main computer.

$file .jbapps-haneda 
.jbapps-haneda: ASCII text, with no line terminators

The contents of the .jbapps-* file are "483^@" with no leading or trailing newlines, carriage returns etc.

Then there is my git issue. I have a .config directory, inside it is a "git" dir, which inside that is a file called "ignore", which as far as I can tell, is near identical to .gitignore_global. Did git create .config, or is this a convention that other apps use as well?

That brings me to my final issue, in ~ I have .gitignore_global, .gitconfig, and also .config/git/ignore

Seems a mess to me, I would love to mv .gitignore_global .gitconfig .config/git Is there a config somewhere that I can define these locations? It's all just a mess of dot files, it would be so much nicer if ~ simply had .config and all the dot files were in there. I can live with .ssh as it is a directory, so there is at least an effort to not litter my home dir. But raw dot files kind of get in my way. I know I can ls -l and not show the dot files, but I think seeing all your files all the time is a good way to learn what has been created that you might not be aware of.

Thank you.

Suggestions?

like image 556
Scott Avatar asked Oct 05 '14 01:10

Scott


3 Answers

FIlenames starting with . are (lightly) hidden files. They're often use by programs to record configuration or usage information. Sometimes that's recorded from the last time you used the program; that's the case with less and the .lesshist "history" file.

If you aren't sure which program created the file, a websearch will usually answer the question... so I'm leaving understanding the rest of those files as an Exercise For The Reader.

like image 98
keshlam Avatar answered Nov 07 '22 17:11

keshlam


You can disable the creation of the ~/.lesshst file by setting the LESSHISTFILE variable to -.

export LESSHISTFILE=-

You can also set the above to another valid file path to have the less command use that file instead. I like to do the following in my ~/.xprofile file:

export LESSHISTFILE="$XDG_STATE_HOME"/less/history

As for your git stuff, Git probably wasn't the program that created the ~/.config folder. That folder is part of the XDG Base Dirs specification, and git actually respects this specification. In short all you need to do is:

  • mv -T ~/.gitconfig $XDG_CONFIG_HOME/git/config
  • mv -T ~/.gitignore_global $XDG_CONFIG_HOME/git/ignore

Also see Arch Wiki for XDG Base Directory

like image 37
smac89 Avatar answered Nov 07 '22 15:11

smac89


A .lesshst file will be generated in one’s home directory if one uses the man command to view documentation; performs a search within such documentation by using the / key, typing a search term, and pressing the Enter key to begin a search; and subsequently exits the man command documentation using the q key.

Apparently, one can use the data in this file to perform a man command search using the last used search term the next time one uses the man command to view documentation. (This would be accomplished by pressing the search key combinations N or Shift+N after having generated a .lesshst file.) It's not clear to me what the benefit of storing search terms preceding the last is though.

like image 6
Patrick Dark Avatar answered Nov 07 '22 16:11

Patrick Dark