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;
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
add a comment
|
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
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
add a comment
|
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
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
14.04 grep history sort
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
add a comment
|
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
add a comment
|
1 Answer
1
active
oldest
votes
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
That command showed a lot of number
– kyo
Sep 25 at 21:09
@kyo : Can you tryhistory | sort -u -b -k2,2
?
– FedonKadifeli
Sep 27 at 19:52
that seems working fine.
– kyo
Sep 30 at 19:19
add a comment
|
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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
That command showed a lot of number
– kyo
Sep 25 at 21:09
@kyo : Can you tryhistory | sort -u -b -k2,2
?
– FedonKadifeli
Sep 27 at 19:52
that seems working fine.
– kyo
Sep 30 at 19:19
add a comment
|
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
That command showed a lot of number
– kyo
Sep 25 at 21:09
@kyo : Can you tryhistory | sort -u -b -k2,2
?
– FedonKadifeli
Sep 27 at 19:52
that seems working fine.
– kyo
Sep 30 at 19:19
add a comment
|
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
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
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 tryhistory | sort -u -b -k2,2
?
– FedonKadifeli
Sep 27 at 19:52
that seems working fine.
– kyo
Sep 30 at 19:19
add a comment
|
That command showed a lot of number
– kyo
Sep 25 at 21:09
@kyo : Can you tryhistory | 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
add a comment
|
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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