Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12
Hi, All! less doesn't save command history, i.e. file .lesshst isn't created. If I create it manually, nothing writes to it too. Permissions to home directory is drwxr-xr-x >env | ...
  1. #1
    Just Joined!
    Join Date
    Aug 2010
    Posts
    4

    less doesn't save command history

    Hi, All!
    less doesn't save command history, i.e. file .lesshst isn't created. If I create it manually, nothing writes to it too.

    Permissions to home directory is drwxr-xr-x

    >env | grep -i less
    LESSHISTSIZE=100
    PAGER=less
    LESS=-N -P%f
    LESSHISTFILE=$HOME/.lesshst

    Maybe somebody faced with such problem.
    OS AIX 5.3 -- I think linux users can have the same issue, hardly this issue depends on OS.

    Thanks in advance.

  2. #2
    Just Joined!
    Join Date
    Apr 2010
    Location
    Central Kansas
    Posts
    13
    do a cat .bash_history at command prompt

  3. #3
    Just Joined!
    Join Date
    Jun 2007
    Posts
    16
    Quote Originally Posted by d2e8k View Post
    Hi, All!
    less doesn't save command history, i.e. file .lesshst isn't created. If I create it manually, nothing writes to it too.

    Permissions to home directory is drwxr-xr-x

    >env | grep -i less
    LESSHISTSIZE=100
    PAGER=less
    LESS=-N -P%f
    LESSHISTFILE=$HOME/.lesshst

    Maybe somebody faced with such problem.
    OS AIX 5.3 -- I think linux users can have the same issue, hardly this issue depends on OS.

    Thanks in advance.
    is your intent?:
    >history |grep less (to find all less cmds executed or any cmd with string 'less' in it)

    or to execute your last "less" cmd

    >!less

  4. #4
    Just Joined!
    Join Date
    Apr 2010
    Location
    Central Kansas
    Posts
    13
    I did the cat .bash_history to show where the commands were stored.

  5. #5
    Linux Newbie unlimitedscolobb's Avatar
    Join Date
    Jan 2008
    Posts
    120
    Quote Originally Posted by d2e8k View Post
    >env | grep -i less
    LESSHISTSIZE=100
    PAGER=less
    LESS=-N -P%f
    LESSHISTFILE=$HOME/.lesshst
    On my system $LESSHISTFILE is empty. You might try to set this variable to nothing, too, because it points to the default location anyway.

    I don't know whether seeing $HOME in the value of $LESSHISTFILE is normal. I'd expect see the real path there. Is this is original value of this variable (set at the installation) or do you initialize it explicitly in some startup file?

  6. #6
    Linux Newbie unlimitedscolobb's Avatar
    Join Date
    Jan 2008
    Posts
    120
    Quote Originally Posted by MrDaler View Post
    do a cat .bash_history at command prompt
    .bash_history saves the commands one types in the bash shell, while .lesshst saves the commands and searches one types in less. This files are unrelated (in the current context).

  7. #7
    Just Joined!
    Join Date
    Apr 2010
    Location
    Central Kansas
    Posts
    13
    My mistake.

  8. #8
    Just Joined!
    Join Date
    Aug 2010
    Posts
    4
    Hello!
    After removing $LESSHISTFILE result persisted the same.
    >env | grep -i less
    PAGER=less
    LESS=-N -P%f

    "!less" is executed correctly. Commands to .bash_history are written correctly. But less commands(generally I need search commands) don't write to .lesshst.

  9. #9
    Linux Newbie unlimitedscolobb's Avatar
    Join Date
    Jan 2008
    Posts
    120
    Quote Originally Posted by d2e8k View Post
    After removing $LESSHISTFILE result persisted the same.
    >env | grep -i less
    PAGER=less
    LESS=-N -P%f
    Could you please do

    Code:
      $ echo $LESSHISTFILE
    Could it be that the value of this variable is overwritten in the local environment?

  10. #10
    Just Joined!
    Join Date
    Aug 2010
    Posts
    4
    >echo $LESSHISTFILE

    >

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...