ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Solved Linux History: Not clearing between -

    IT Discussion
    7
    24
    605
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • jmooreJ
      jmoore @gjacobse
      last edited by

      @gjacobse wouldn't the . be part of the filename though? So it would be "sudo vi /root/.bash_history"

      gjacobseG 1 Reply Last reply Reply Quote 0
      • gjacobseG
        gjacobse @jmoore
        last edited by

        @jmoore said in Linux History: Not clearing between -:

        @gjacobse wouldn't the . be part of the filename though? So it would be "sudo vi /root/.bash_history"

        Quite true indeed - so I missed i there,.. but didn't here: 190 sudo nano ~/.bash.history

        1 Reply Last reply Reply Quote 0
        • gjacobseG
          gjacobse
          last edited by

          This has been helpful - I've managed to edit the file, and after making a backup, and editing it down to clear out the garbage.

          scottalanmillerS 1 Reply Last reply Reply Quote 0
          • DustinB3403D
            DustinB3403
            last edited by DustinB3403

            You also could've run history -d linenumber to have removed things that were incorrect or frivolous.

            gjacobseG 1 Reply Last reply Reply Quote 0
            • scottalanmillerS
              scottalanmiller @gjacobse
              last edited by

              @gjacobse said in Linux History: Not clearing between -:

              History is a great tool to have - But it has gotten a bit long on the Ubuntu system I have running.

              A bit long would be like.... 100,000 lines?

              1 Reply Last reply Reply Quote 0
              • scottalanmillerS
                scottalanmiller @gjacobse
                last edited by

                @gjacobse said in Linux History: Not clearing between -:

                This has been helpful - I've managed to edit the file, and after making a backup, and editing it down to clear out the garbage.

                It's a history, clearing stuff out doesn't really make sense.

                DustinB3403D IRJI 2 Replies Last reply Reply Quote 1
                • gjacobseG
                  gjacobse @DustinB3403
                  last edited by

                  @DustinB3403 said in Linux History: Not clearing between -:

                  You also could've run history -d linenumber to have removed things that were incorrect or frivolous.

                  Done that also - didn't do anymore than history -c did.

                  1 Reply Last reply Reply Quote 0
                  • DustinB3403D
                    DustinB3403 @scottalanmiller
                    last edited by

                    @scottalanmiller said in Linux History: Not clearing between -:

                    @gjacobse said in Linux History: Not clearing between -:

                    This has been helpful - I've managed to edit the file, and after making a backup, and editing it down to clear out the garbage.

                    It's a history, clearing stuff out doesn't really make sense.

                    It does if he wants to document a process to getting something to work and only having valid commands visible.

                    If he had a typo or whatever else, leaving that in the history could cause issues later.

                    IRJI scottalanmillerS 2 Replies Last reply Reply Quote 1
                    • IRJI
                      IRJ @scottalanmiller
                      last edited by

                      @scottalanmiller said in Linux History: Not clearing between -:

                      @gjacobse said in Linux History: Not clearing between -:

                      This has been helpful - I've managed to edit the file, and after making a backup, and editing it down to clear out the garbage.

                      It's a history, clearing stuff out doesn't really make sense.

                      And could possibly be seen as malicious intent.

                      1 Reply Last reply Reply Quote 1
                      • IRJI
                        IRJ @DustinB3403
                        last edited by

                        @DustinB3403 said in Linux History: Not clearing between -:

                        @scottalanmiller said in Linux History: Not clearing between -:

                        @gjacobse said in Linux History: Not clearing between -:

                        This has been helpful - I've managed to edit the file, and after making a backup, and editing it down to clear out the garbage.

                        It's a history, clearing stuff out doesn't really make sense.

                        It does if he wants to document a process to getting something to work and only having valid commands visible.

                        If he had a typo or whatever else, leaving that in the history could cause issues later.

                        Still doesnt make sense, because if you know which line is incorrect, just dont copy that line. You still have to know which line is incorrect to delete 🤦

                        1 Reply Last reply Reply Quote 1
                        • scottalanmillerS
                          scottalanmiller @DustinB3403
                          last edited by

                          @DustinB3403 said in Linux History: Not clearing between -:

                          It does if he wants to document a process to getting something to work and only having valid commands visible.

                          History isn't documentation once it is edited.

                          IRJI 1 Reply Last reply Reply Quote 0
                          • IRJI
                            IRJ @scottalanmiller
                            last edited by

                            @scottalanmiller said in Linux History: Not clearing between -:

                            @DustinB3403 said in Linux History: Not clearing between -:

                            It does if he wants to document a process to getting something to work and only having valid commands visible.

                            History isn't documentation

                            I fixed it for you

                            1 Reply Last reply Reply Quote 1
                            • IRJI
                              IRJ
                              last edited by

                              Also, what if an incorrect command screws something up? Then you lose your ability to check history for troubleshooting. You should never be deleting any history.

                              stacksofplatesS 1 Reply Last reply Reply Quote 3
                              • stacksofplatesS
                                stacksofplates @IRJ
                                last edited by

                                @IRJ said in Linux History: Not clearing between -:

                                Also, what if an incorrect command screws something up? Then you lose your ability to check history for troubleshooting. You should never be deleting any history.

                                I use zsh with autocomplete so I rely on history pretty heavily

                                1 Reply Last reply Reply Quote 0
                                • 1
                                • 2
                                • 2 / 2
                                • First post
                                  Last post