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. List of fixes included in Windows XP SP2
    By regix in forum Windows - General Topics
    Replies: 6
    Last Post: 01-03-2005, 11:44 PM
  2. Getting Firefox to run by editing firefox shell and editing moz_libdir
    By basho in forum Linux - Software, Applications & Programming
    Replies: 1
    Last Post: 03-28-2004, 04:57 AM
  3. SSH and restricted shell
    By elovkoff in forum Linux - General Topics
    Replies: 12
    Last Post: 04-02-2003, 03:40 PM
  4. Korn Shell Scripting
    By NeoStarO1 in forum Programming
    Replies: 11
    Last Post: 08-15-2002, 08:50 PM
  5. My Dos shell
    By kenshi in forum Linux - Software, Applications & Programming
    Replies: 24
    Last Post: 11-29-2001, 11:10 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
  •