List unique result only on history commandHow can I delete the command line history from the dash?Return only line number, if pattern 'Exist' and 'Not Exist'. using 'grep' commandHow to delete chat history in skype for only one contact in Linuxhow do I remove the last 5 lines in bash history?Creating a complete and alphabetically sorted .txt file of bash historyCommand history seems to be missing the first 75 linesReplace source word with containing /(forward slash) to destination word in VI editor command window

How could pirates reasonably transport dinosaurs in captivity, some of them enormous, across oceans?

How do electric hot water heaters explode and what can be done to prevent that from happening?

What is latinum and where does it occur?

Why should I use an ~/extensions directory rather than the default ~/ext for new extensions?

What movie or fandom is this jewelry from?

Could you generate any positive number given only a few specific operators and operands?

Was playing with both hands ever allowed in chess?

Did the Windows 95 screensavers use hardware acceleration APIs?

When did Hebrew start replacing Yiddish?

Minimum number of ancilla qubits required to make a transformation unitary?

reload interface while keeping data?

Can I make leading exclamation points be ignored in the terminal? (I type them by instinct due to ipython)

Is it academically dishonest to submit the same project to two different classes in the same semester?

What is homebrew? Should I use it in normal games?

A single word for "not allowed to be changed" or "must be this way"

Can a German employer force mandatory overtime and forbid salary discussion?

Between while and do in shell script

How to pay less tax on a high salary?

Turning off Apple hardware checks on startup

Does being invisible grant advantage on stealth checks by RAW?

Is the use of ellipsis (...) dismissive or rude?

Why do cargo airplanes fly fewer cycles then airliners?

Intuitive explanation why some autonomous DEs go to infinity in finite time.

Is there any reason a person would voluntarily choose to have PMI?



List unique result only on history command


How can I delete the command line history from the dash?Return only line number, if pattern 'Exist' and 'Not Exist'. using 'grep' commandHow to delete chat history in skype for only one contact in Linuxhow do I remove the last 5 lines in bash history?Creating a complete and alphabetically sorted .txt file of bash historyCommand history seems to be missing the first 75 linesReplace source word with containing /(forward slash) to destination word in VI editor command window






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;









-1


















I ran this command



history | cut -c 8-



It listed all the history commands as expected without line numbers.



I'm wondering if there is a way to list only unique one.



I've tried



history | cut -c 8- | sort -u



doesn't seem to work.










share|improve this question

























  • Unique in what respect?

    – FedonKadifeli
    Sep 24 at 18:42











  • Trying to avoid seeing same commands in history. I’m trying to documents what I did for the pass months and see a lot of commands is confusing

    – kyo
    Sep 24 at 19:52

















-1


















I ran this command



history | cut -c 8-



It listed all the history commands as expected without line numbers.



I'm wondering if there is a way to list only unique one.



I've tried



history | cut -c 8- | sort -u



doesn't seem to work.










share|improve this question

























  • Unique in what respect?

    – FedonKadifeli
    Sep 24 at 18:42











  • Trying to avoid seeing same commands in history. I’m trying to documents what I did for the pass months and see a lot of commands is confusing

    – kyo
    Sep 24 at 19:52













-1













-1









-1








I ran this command



history | cut -c 8-



It listed all the history commands as expected without line numbers.



I'm wondering if there is a way to list only unique one.



I've tried



history | cut -c 8- | sort -u



doesn't seem to work.










share|improve this question














I ran this command



history | cut -c 8-



It listed all the history commands as expected without line numbers.



I'm wondering if there is a way to list only unique one.



I've tried



history | cut -c 8- | sort -u



doesn't seem to work.







14.04 grep history sort






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Sep 24 at 18:12









kyokyo

1351 silver badge10 bronze badges




1351 silver badge10 bronze badges















  • Unique in what respect?

    – FedonKadifeli
    Sep 24 at 18:42











  • Trying to avoid seeing same commands in history. I’m trying to documents what I did for the pass months and see a lot of commands is confusing

    – kyo
    Sep 24 at 19:52

















  • Unique in what respect?

    – FedonKadifeli
    Sep 24 at 18:42











  • Trying to avoid seeing same commands in history. I’m trying to documents what I did for the pass months and see a lot of commands is confusing

    – kyo
    Sep 24 at 19:52
















Unique in what respect?

– FedonKadifeli
Sep 24 at 18:42





Unique in what respect?

– FedonKadifeli
Sep 24 at 18:42













Trying to avoid seeing same commands in history. I’m trying to documents what I did for the pass months and see a lot of commands is confusing

– kyo
Sep 24 at 19:52





Trying to avoid seeing same commands in history. I’m trying to documents what I did for the pass months and see a lot of commands is confusing

– kyo
Sep 24 at 19:52










1 Answer
1






active

oldest

votes


















0



















To get the names of the commands only, you can use this:



history | cut -f4 -d | sort -u


Or for better results, you can use this:



history | sort -u -b -k2,2





share|improve this answer



























  • That command showed a lot of number

    – kyo
    Sep 25 at 21:09











  • @kyo : Can you try history | sort -u -b -k2,2 ?

    – FedonKadifeli
    Sep 27 at 19:52












  • that seems working fine.

    – kyo
    Sep 30 at 19:19












Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);














draft saved

draft discarded
















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1176397%2flist-unique-result-only-on-history-command%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown


























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0



















To get the names of the commands only, you can use this:



history | cut -f4 -d | sort -u


Or for better results, you can use this:



history | sort -u -b -k2,2





share|improve this answer



























  • That command showed a lot of number

    – kyo
    Sep 25 at 21:09











  • @kyo : Can you try history | sort -u -b -k2,2 ?

    – FedonKadifeli
    Sep 27 at 19:52












  • that seems working fine.

    – kyo
    Sep 30 at 19:19















0



















To get the names of the commands only, you can use this:



history | cut -f4 -d | sort -u


Or for better results, you can use this:



history | sort -u -b -k2,2





share|improve this answer



























  • That command showed a lot of number

    – kyo
    Sep 25 at 21:09











  • @kyo : Can you try history | sort -u -b -k2,2 ?

    – FedonKadifeli
    Sep 27 at 19:52












  • that seems working fine.

    – kyo
    Sep 30 at 19:19













0















0











0









To get the names of the commands only, you can use this:



history | cut -f4 -d | sort -u


Or for better results, you can use this:



history | sort -u -b -k2,2





share|improve this answer
















To get the names of the commands only, you can use this:



history | cut -f4 -d | sort -u


Or for better results, you can use this:



history | sort -u -b -k2,2






share|improve this answer















share|improve this answer




share|improve this answer








edited Sep 27 at 19:52

























answered Sep 24 at 18:50









FedonKadifeliFedonKadifeli

1,5201 gold badge7 silver badges24 bronze badges




1,5201 gold badge7 silver badges24 bronze badges















  • That command showed a lot of number

    – kyo
    Sep 25 at 21:09











  • @kyo : Can you try history | sort -u -b -k2,2 ?

    – FedonKadifeli
    Sep 27 at 19:52












  • that seems working fine.

    – kyo
    Sep 30 at 19:19

















  • That command showed a lot of number

    – kyo
    Sep 25 at 21:09











  • @kyo : Can you try history | sort -u -b -k2,2 ?

    – FedonKadifeli
    Sep 27 at 19:52












  • that seems working fine.

    – kyo
    Sep 30 at 19:19
















That command showed a lot of number

– kyo
Sep 25 at 21:09





That command showed a lot of number

– kyo
Sep 25 at 21:09













@kyo : Can you try history | sort -u -b -k2,2 ?

– FedonKadifeli
Sep 27 at 19:52






@kyo : Can you try history | sort -u -b -k2,2 ?

– FedonKadifeli
Sep 27 at 19:52














that seems working fine.

– kyo
Sep 30 at 19:19





that seems working fine.

– kyo
Sep 30 at 19:19


















draft saved

draft discarded















































Thanks for contributing an answer to Ask Ubuntu!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1176397%2flist-unique-result-only-on-history-command%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown









Popular posts from this blog

Tamil (spriik) Luke uk diar | Nawigatjuun

Align equal signs while including text over equalitiesAMS align: left aligned text/math plus multicolumn alignmentMultiple alignmentsAligning equations in multiple placesNumbering and aligning an equation with multiple columnsHow to align one equation with another multline equationUsing \ in environments inside the begintabularxNumber equations and preserving alignment of equal signsHow can I align equations to the left and to the right?Double equation alignment problem within align enviromentAligned within align: Why are they right-aligned?

Where does the image of a data connector as a sharp metal spike originate from?Where does the concept of infected people turning into zombies only after death originate from?Where does the motif of a reanimated human head originate?Where did the notion that Dragons could speak originate?Where does the archetypal image of the 'Grey' alien come from?Where did the suffix '-Man' originate?Where does the notion of being injured or killed by an illusion originate?Where did the term “sophont” originate?Where does the trope of magic spells being driven by advanced technology originate from?Where did the term “the living impaired” originate?