Results 1 to 2 of 2

Thread: Sorting the command history of a shell

  1. #1

    Sorting the command history of a shell

    Hi,

    How can I delete the same command in the command history and make the database show each command only once? Thanks...

  2. #2
    If all you care about is the commands and not the order they were typed in, you could do this:

    sort .bash_history | uniq

    Anything more complicated that preserves the sequence of events would require a shell script that weeds out those commands that have previously occured.

Similar Threads

  1. Getting rid of history in a terminal
    By tech291083 in forum Redhat / Fedora
    Replies: 4
    Last Post: 05-04-2009, 07:53 AM
  2. Sorting through the Linux lie: What it really can do
    By cloverm in forum General Chat
    Replies: 5
    Last Post: 07-01-2005, 05:46 PM
  3. History is okay.
    By Fatal Error in forum General Chat
    Replies: 0
    Last Post: 02-17-2005, 12:04 AM
  4. Sorting problems again
    By NeoStarO1 in forum BSD
    Replies: 2
    Last Post: 08-08-2002, 01:47 AM
  5. Bash script for sorting mp3's.
    By airhead in forum Programming
    Replies: 7
    Last Post: 02-24-2002, 07:09 PM

Bookmarks

Posting Permissions

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