How to view datetime stamp for history command in Zsh shell
When I run the history command on my ubuntu server, I get output as follows:
history
...
25 cd ~
26 ls -a
27 vim /etc/gitconfig
28 vim ~/.gitconfig
I want to view the datetime of a particular user. However when I assume them:
su otheruser
export HISTTIMEFORMAT='%F %T '
history
...
25 cd ~
26 ls -a
27 vim /etc/gitconfig
28 vim ~/.gitconfig
It still doesn't show datetime. I am using zsh shell.
zsh command-history
add a comment |
When I run the history command on my ubuntu server, I get output as follows:
history
...
25 cd ~
26 ls -a
27 vim /etc/gitconfig
28 vim ~/.gitconfig
I want to view the datetime of a particular user. However when I assume them:
su otheruser
export HISTTIMEFORMAT='%F %T '
history
...
25 cd ~
26 ls -a
27 vim /etc/gitconfig
28 vim ~/.gitconfig
It still doesn't show datetime. I am using zsh shell.
zsh command-history
add a comment |
When I run the history command on my ubuntu server, I get output as follows:
history
...
25 cd ~
26 ls -a
27 vim /etc/gitconfig
28 vim ~/.gitconfig
I want to view the datetime of a particular user. However when I assume them:
su otheruser
export HISTTIMEFORMAT='%F %T '
history
...
25 cd ~
26 ls -a
27 vim /etc/gitconfig
28 vim ~/.gitconfig
It still doesn't show datetime. I am using zsh shell.
zsh command-history
When I run the history command on my ubuntu server, I get output as follows:
history
...
25 cd ~
26 ls -a
27 vim /etc/gitconfig
28 vim ~/.gitconfig
I want to view the datetime of a particular user. However when I assume them:
su otheruser
export HISTTIMEFORMAT='%F %T '
history
...
25 cd ~
26 ls -a
27 vim /etc/gitconfig
28 vim ~/.gitconfig
It still doesn't show datetime. I am using zsh shell.
zsh command-history
zsh command-history
edited Jan 8 at 15:24
Chris Stryczynski
559417
559417
asked Dec 2 '13 at 18:58
JohnMerlinoJohnMerlino
1,49682434
1,49682434
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
I believe the HISTTIMEFORMAT is for Bash shells. If you're using zsh
then you could use these switches to the history
command:
Examples
$ history -E
1 2.12.2013 14:19 history -E
$ history -i
1 2013-12-02 14:19 history -E
$ history -D
1 0:00 history -E
2 0:00 history -i
If you do a man zshoptions
or man zshbuiltins
you can find out more information about these switches as well as other info related to history
.
excerpt from zshbuiltins man page
Also when listing,
-d prints timestamps for each command
-f prints full time-date stamps in the US `MM/DD/YY hh:mm' format
-E prints full time-date stamps in the European `dd.mm.yyyy hh:mm' format
-i prints full time-date stamps in ISO8601 `yyyy-mm-dd hh:mm' format
-t fmt prints time and date stamps in the given format; fmt is formatted
with the strftime function with the zsh extensions described for
the %D{string} prompt format in the section EXPANSION OF PROMPT
SEQUENCES in zshmisc(1). The resulting formatted string must be no
more than 256 characters or will not be printed.
-D prints elapsed times; may be combined with one of the options above.
Debugging invocation
You can use the following 2 methods to debug zsh
when you invoke it.
Method #1
$ zsh -xv
Method #2
$ zsh
$ setopt XTRACE VERBOSE
In either case you should see something like this when it starts up:
$ zsh -xv
#
# /etc/zshenv is sourced on all invocations of the
# shell, unless the -f option is set. It should
# contain commands to set the command search path,
# plus other important environment variables.
# .zshenv should not contain commands that produce
# output or assume the shell is attached to a tty.
#
#
# /etc/zshrc is sourced in interactive shells. It
# should contain commands to set up aliases, functions,
# options, key bindings, etc.
#
## shell functions
...
...
unset -f pathmunge _src_etc_profile_d
+/etc/zshrc:49> unset -f pathmunge _src_etc_profile_d
# Created by newuser for 4.3.10
5
"event not found: -i " "event not found: -E". Do I need to load something in a config file before running these switches?
– JohnMerlino
Dec 2 '13 at 19:41
1
What version ofzsh
?zsh --version
. I just confirmed on Ubuntu 12.10 that the commands I gave you worked just fine.
– slm♦
Dec 2 '13 at 19:52
16
@JohnMerlino I had zsh 4.3.10 (x86_64-unknown-linux-gnu) on a server for which I wanted to view history with timestamps. After looking through thezshbuiltins
man page, I discovered that I needed to usefc
. What finally worked for me wasfc -li
. You can pass command numbers tofc
, too, sofc -li -100
lists the last 100 commands in your history.
– Thomas Upton
Jul 23 '14 at 13:11
18
I have to usehistory -E
, I use oh-my-zsh
– juanpastas
Sep 25 '14 at 22:30
1
It's a long-standing (6+ years) bug with oh-my-zsh, see this issue on github: github.com/robbyrussell/oh-my-zsh/issues/739
– rococo
Jun 24 '18 at 20:28
|
show 6 more comments
history -E
or history -i
or whatever DO NOT work for me.
zsh --version
shows that zsh 4.3.6 (x86_64-suse-linux-gnu)
.
Then fc -li 100
works! It shows the recent 100 commands with timestamp :)
Thanks, this worked for me as well, contrary to the top answer. My version is:zsh 5.1.1 (x86_64-ubuntu-linux-gnu)
. And while I'm here: do you know how to get the help of the commandfc
? Neitherman fc
norfc --help
work
– exhuma
Jun 13 '17 at 6:49
@exhuma why not google it :)
– Gab是好人
Jun 14 '17 at 8:57
@Gab是好人 do you have history aliased? if you are usingoh-my-zsh
the history command is add the-l
flag in one of the options. see github.com/robbyrussell/oh-my-zsh/blob/master/lib/…
– Mike D
Jun 19 '17 at 12:51
1
fc -lf
will show a full timestamp. Note that this works only on zsh, not on bash.
– dr01
Jul 27 '17 at 7:49
@exhuma In zsh, you can userun-help fc
.
– xuhdev
Oct 28 '17 at 20:37
|
show 1 more comment
If you are using oh-my-zsh
addon in zsh
, history -E
or history -i
wont work (because it's aliased to fc -l 1
).
As @juanpastas pointed out, try
history -E
or
history -i
or
fc -li 100
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
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: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
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/3.0/"u003ecc by-sa 3.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%2funix.stackexchange.com%2fquestions%2f103398%2fhow-to-view-datetime-stamp-for-history-command-in-zsh-shell%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
I believe the HISTTIMEFORMAT is for Bash shells. If you're using zsh
then you could use these switches to the history
command:
Examples
$ history -E
1 2.12.2013 14:19 history -E
$ history -i
1 2013-12-02 14:19 history -E
$ history -D
1 0:00 history -E
2 0:00 history -i
If you do a man zshoptions
or man zshbuiltins
you can find out more information about these switches as well as other info related to history
.
excerpt from zshbuiltins man page
Also when listing,
-d prints timestamps for each command
-f prints full time-date stamps in the US `MM/DD/YY hh:mm' format
-E prints full time-date stamps in the European `dd.mm.yyyy hh:mm' format
-i prints full time-date stamps in ISO8601 `yyyy-mm-dd hh:mm' format
-t fmt prints time and date stamps in the given format; fmt is formatted
with the strftime function with the zsh extensions described for
the %D{string} prompt format in the section EXPANSION OF PROMPT
SEQUENCES in zshmisc(1). The resulting formatted string must be no
more than 256 characters or will not be printed.
-D prints elapsed times; may be combined with one of the options above.
Debugging invocation
You can use the following 2 methods to debug zsh
when you invoke it.
Method #1
$ zsh -xv
Method #2
$ zsh
$ setopt XTRACE VERBOSE
In either case you should see something like this when it starts up:
$ zsh -xv
#
# /etc/zshenv is sourced on all invocations of the
# shell, unless the -f option is set. It should
# contain commands to set the command search path,
# plus other important environment variables.
# .zshenv should not contain commands that produce
# output or assume the shell is attached to a tty.
#
#
# /etc/zshrc is sourced in interactive shells. It
# should contain commands to set up aliases, functions,
# options, key bindings, etc.
#
## shell functions
...
...
unset -f pathmunge _src_etc_profile_d
+/etc/zshrc:49> unset -f pathmunge _src_etc_profile_d
# Created by newuser for 4.3.10
5
"event not found: -i " "event not found: -E". Do I need to load something in a config file before running these switches?
– JohnMerlino
Dec 2 '13 at 19:41
1
What version ofzsh
?zsh --version
. I just confirmed on Ubuntu 12.10 that the commands I gave you worked just fine.
– slm♦
Dec 2 '13 at 19:52
16
@JohnMerlino I had zsh 4.3.10 (x86_64-unknown-linux-gnu) on a server for which I wanted to view history with timestamps. After looking through thezshbuiltins
man page, I discovered that I needed to usefc
. What finally worked for me wasfc -li
. You can pass command numbers tofc
, too, sofc -li -100
lists the last 100 commands in your history.
– Thomas Upton
Jul 23 '14 at 13:11
18
I have to usehistory -E
, I use oh-my-zsh
– juanpastas
Sep 25 '14 at 22:30
1
It's a long-standing (6+ years) bug with oh-my-zsh, see this issue on github: github.com/robbyrussell/oh-my-zsh/issues/739
– rococo
Jun 24 '18 at 20:28
|
show 6 more comments
I believe the HISTTIMEFORMAT is for Bash shells. If you're using zsh
then you could use these switches to the history
command:
Examples
$ history -E
1 2.12.2013 14:19 history -E
$ history -i
1 2013-12-02 14:19 history -E
$ history -D
1 0:00 history -E
2 0:00 history -i
If you do a man zshoptions
or man zshbuiltins
you can find out more information about these switches as well as other info related to history
.
excerpt from zshbuiltins man page
Also when listing,
-d prints timestamps for each command
-f prints full time-date stamps in the US `MM/DD/YY hh:mm' format
-E prints full time-date stamps in the European `dd.mm.yyyy hh:mm' format
-i prints full time-date stamps in ISO8601 `yyyy-mm-dd hh:mm' format
-t fmt prints time and date stamps in the given format; fmt is formatted
with the strftime function with the zsh extensions described for
the %D{string} prompt format in the section EXPANSION OF PROMPT
SEQUENCES in zshmisc(1). The resulting formatted string must be no
more than 256 characters or will not be printed.
-D prints elapsed times; may be combined with one of the options above.
Debugging invocation
You can use the following 2 methods to debug zsh
when you invoke it.
Method #1
$ zsh -xv
Method #2
$ zsh
$ setopt XTRACE VERBOSE
In either case you should see something like this when it starts up:
$ zsh -xv
#
# /etc/zshenv is sourced on all invocations of the
# shell, unless the -f option is set. It should
# contain commands to set the command search path,
# plus other important environment variables.
# .zshenv should not contain commands that produce
# output or assume the shell is attached to a tty.
#
#
# /etc/zshrc is sourced in interactive shells. It
# should contain commands to set up aliases, functions,
# options, key bindings, etc.
#
## shell functions
...
...
unset -f pathmunge _src_etc_profile_d
+/etc/zshrc:49> unset -f pathmunge _src_etc_profile_d
# Created by newuser for 4.3.10
5
"event not found: -i " "event not found: -E". Do I need to load something in a config file before running these switches?
– JohnMerlino
Dec 2 '13 at 19:41
1
What version ofzsh
?zsh --version
. I just confirmed on Ubuntu 12.10 that the commands I gave you worked just fine.
– slm♦
Dec 2 '13 at 19:52
16
@JohnMerlino I had zsh 4.3.10 (x86_64-unknown-linux-gnu) on a server for which I wanted to view history with timestamps. After looking through thezshbuiltins
man page, I discovered that I needed to usefc
. What finally worked for me wasfc -li
. You can pass command numbers tofc
, too, sofc -li -100
lists the last 100 commands in your history.
– Thomas Upton
Jul 23 '14 at 13:11
18
I have to usehistory -E
, I use oh-my-zsh
– juanpastas
Sep 25 '14 at 22:30
1
It's a long-standing (6+ years) bug with oh-my-zsh, see this issue on github: github.com/robbyrussell/oh-my-zsh/issues/739
– rococo
Jun 24 '18 at 20:28
|
show 6 more comments
I believe the HISTTIMEFORMAT is for Bash shells. If you're using zsh
then you could use these switches to the history
command:
Examples
$ history -E
1 2.12.2013 14:19 history -E
$ history -i
1 2013-12-02 14:19 history -E
$ history -D
1 0:00 history -E
2 0:00 history -i
If you do a man zshoptions
or man zshbuiltins
you can find out more information about these switches as well as other info related to history
.
excerpt from zshbuiltins man page
Also when listing,
-d prints timestamps for each command
-f prints full time-date stamps in the US `MM/DD/YY hh:mm' format
-E prints full time-date stamps in the European `dd.mm.yyyy hh:mm' format
-i prints full time-date stamps in ISO8601 `yyyy-mm-dd hh:mm' format
-t fmt prints time and date stamps in the given format; fmt is formatted
with the strftime function with the zsh extensions described for
the %D{string} prompt format in the section EXPANSION OF PROMPT
SEQUENCES in zshmisc(1). The resulting formatted string must be no
more than 256 characters or will not be printed.
-D prints elapsed times; may be combined with one of the options above.
Debugging invocation
You can use the following 2 methods to debug zsh
when you invoke it.
Method #1
$ zsh -xv
Method #2
$ zsh
$ setopt XTRACE VERBOSE
In either case you should see something like this when it starts up:
$ zsh -xv
#
# /etc/zshenv is sourced on all invocations of the
# shell, unless the -f option is set. It should
# contain commands to set the command search path,
# plus other important environment variables.
# .zshenv should not contain commands that produce
# output or assume the shell is attached to a tty.
#
#
# /etc/zshrc is sourced in interactive shells. It
# should contain commands to set up aliases, functions,
# options, key bindings, etc.
#
## shell functions
...
...
unset -f pathmunge _src_etc_profile_d
+/etc/zshrc:49> unset -f pathmunge _src_etc_profile_d
# Created by newuser for 4.3.10
I believe the HISTTIMEFORMAT is for Bash shells. If you're using zsh
then you could use these switches to the history
command:
Examples
$ history -E
1 2.12.2013 14:19 history -E
$ history -i
1 2013-12-02 14:19 history -E
$ history -D
1 0:00 history -E
2 0:00 history -i
If you do a man zshoptions
or man zshbuiltins
you can find out more information about these switches as well as other info related to history
.
excerpt from zshbuiltins man page
Also when listing,
-d prints timestamps for each command
-f prints full time-date stamps in the US `MM/DD/YY hh:mm' format
-E prints full time-date stamps in the European `dd.mm.yyyy hh:mm' format
-i prints full time-date stamps in ISO8601 `yyyy-mm-dd hh:mm' format
-t fmt prints time and date stamps in the given format; fmt is formatted
with the strftime function with the zsh extensions described for
the %D{string} prompt format in the section EXPANSION OF PROMPT
SEQUENCES in zshmisc(1). The resulting formatted string must be no
more than 256 characters or will not be printed.
-D prints elapsed times; may be combined with one of the options above.
Debugging invocation
You can use the following 2 methods to debug zsh
when you invoke it.
Method #1
$ zsh -xv
Method #2
$ zsh
$ setopt XTRACE VERBOSE
In either case you should see something like this when it starts up:
$ zsh -xv
#
# /etc/zshenv is sourced on all invocations of the
# shell, unless the -f option is set. It should
# contain commands to set the command search path,
# plus other important environment variables.
# .zshenv should not contain commands that produce
# output or assume the shell is attached to a tty.
#
#
# /etc/zshrc is sourced in interactive shells. It
# should contain commands to set up aliases, functions,
# options, key bindings, etc.
#
## shell functions
...
...
unset -f pathmunge _src_etc_profile_d
+/etc/zshrc:49> unset -f pathmunge _src_etc_profile_d
# Created by newuser for 4.3.10
edited Dec 3 '13 at 0:24
answered Dec 2 '13 at 19:24
slm♦slm
248k66517678
248k66517678
5
"event not found: -i " "event not found: -E". Do I need to load something in a config file before running these switches?
– JohnMerlino
Dec 2 '13 at 19:41
1
What version ofzsh
?zsh --version
. I just confirmed on Ubuntu 12.10 that the commands I gave you worked just fine.
– slm♦
Dec 2 '13 at 19:52
16
@JohnMerlino I had zsh 4.3.10 (x86_64-unknown-linux-gnu) on a server for which I wanted to view history with timestamps. After looking through thezshbuiltins
man page, I discovered that I needed to usefc
. What finally worked for me wasfc -li
. You can pass command numbers tofc
, too, sofc -li -100
lists the last 100 commands in your history.
– Thomas Upton
Jul 23 '14 at 13:11
18
I have to usehistory -E
, I use oh-my-zsh
– juanpastas
Sep 25 '14 at 22:30
1
It's a long-standing (6+ years) bug with oh-my-zsh, see this issue on github: github.com/robbyrussell/oh-my-zsh/issues/739
– rococo
Jun 24 '18 at 20:28
|
show 6 more comments
5
"event not found: -i " "event not found: -E". Do I need to load something in a config file before running these switches?
– JohnMerlino
Dec 2 '13 at 19:41
1
What version ofzsh
?zsh --version
. I just confirmed on Ubuntu 12.10 that the commands I gave you worked just fine.
– slm♦
Dec 2 '13 at 19:52
16
@JohnMerlino I had zsh 4.3.10 (x86_64-unknown-linux-gnu) on a server for which I wanted to view history with timestamps. After looking through thezshbuiltins
man page, I discovered that I needed to usefc
. What finally worked for me wasfc -li
. You can pass command numbers tofc
, too, sofc -li -100
lists the last 100 commands in your history.
– Thomas Upton
Jul 23 '14 at 13:11
18
I have to usehistory -E
, I use oh-my-zsh
– juanpastas
Sep 25 '14 at 22:30
1
It's a long-standing (6+ years) bug with oh-my-zsh, see this issue on github: github.com/robbyrussell/oh-my-zsh/issues/739
– rococo
Jun 24 '18 at 20:28
5
5
"event not found: -i " "event not found: -E". Do I need to load something in a config file before running these switches?
– JohnMerlino
Dec 2 '13 at 19:41
"event not found: -i " "event not found: -E". Do I need to load something in a config file before running these switches?
– JohnMerlino
Dec 2 '13 at 19:41
1
1
What version of
zsh
? zsh --version
. I just confirmed on Ubuntu 12.10 that the commands I gave you worked just fine.– slm♦
Dec 2 '13 at 19:52
What version of
zsh
? zsh --version
. I just confirmed on Ubuntu 12.10 that the commands I gave you worked just fine.– slm♦
Dec 2 '13 at 19:52
16
16
@JohnMerlino I had zsh 4.3.10 (x86_64-unknown-linux-gnu) on a server for which I wanted to view history with timestamps. After looking through the
zshbuiltins
man page, I discovered that I needed to use fc
. What finally worked for me was fc -li
. You can pass command numbers to fc
, too, so fc -li -100
lists the last 100 commands in your history.– Thomas Upton
Jul 23 '14 at 13:11
@JohnMerlino I had zsh 4.3.10 (x86_64-unknown-linux-gnu) on a server for which I wanted to view history with timestamps. After looking through the
zshbuiltins
man page, I discovered that I needed to use fc
. What finally worked for me was fc -li
. You can pass command numbers to fc
, too, so fc -li -100
lists the last 100 commands in your history.– Thomas Upton
Jul 23 '14 at 13:11
18
18
I have to use
history -E
, I use oh-my-zsh– juanpastas
Sep 25 '14 at 22:30
I have to use
history -E
, I use oh-my-zsh– juanpastas
Sep 25 '14 at 22:30
1
1
It's a long-standing (6+ years) bug with oh-my-zsh, see this issue on github: github.com/robbyrussell/oh-my-zsh/issues/739
– rococo
Jun 24 '18 at 20:28
It's a long-standing (6+ years) bug with oh-my-zsh, see this issue on github: github.com/robbyrussell/oh-my-zsh/issues/739
– rococo
Jun 24 '18 at 20:28
|
show 6 more comments
history -E
or history -i
or whatever DO NOT work for me.
zsh --version
shows that zsh 4.3.6 (x86_64-suse-linux-gnu)
.
Then fc -li 100
works! It shows the recent 100 commands with timestamp :)
Thanks, this worked for me as well, contrary to the top answer. My version is:zsh 5.1.1 (x86_64-ubuntu-linux-gnu)
. And while I'm here: do you know how to get the help of the commandfc
? Neitherman fc
norfc --help
work
– exhuma
Jun 13 '17 at 6:49
@exhuma why not google it :)
– Gab是好人
Jun 14 '17 at 8:57
@Gab是好人 do you have history aliased? if you are usingoh-my-zsh
the history command is add the-l
flag in one of the options. see github.com/robbyrussell/oh-my-zsh/blob/master/lib/…
– Mike D
Jun 19 '17 at 12:51
1
fc -lf
will show a full timestamp. Note that this works only on zsh, not on bash.
– dr01
Jul 27 '17 at 7:49
@exhuma In zsh, you can userun-help fc
.
– xuhdev
Oct 28 '17 at 20:37
|
show 1 more comment
history -E
or history -i
or whatever DO NOT work for me.
zsh --version
shows that zsh 4.3.6 (x86_64-suse-linux-gnu)
.
Then fc -li 100
works! It shows the recent 100 commands with timestamp :)
Thanks, this worked for me as well, contrary to the top answer. My version is:zsh 5.1.1 (x86_64-ubuntu-linux-gnu)
. And while I'm here: do you know how to get the help of the commandfc
? Neitherman fc
norfc --help
work
– exhuma
Jun 13 '17 at 6:49
@exhuma why not google it :)
– Gab是好人
Jun 14 '17 at 8:57
@Gab是好人 do you have history aliased? if you are usingoh-my-zsh
the history command is add the-l
flag in one of the options. see github.com/robbyrussell/oh-my-zsh/blob/master/lib/…
– Mike D
Jun 19 '17 at 12:51
1
fc -lf
will show a full timestamp. Note that this works only on zsh, not on bash.
– dr01
Jul 27 '17 at 7:49
@exhuma In zsh, you can userun-help fc
.
– xuhdev
Oct 28 '17 at 20:37
|
show 1 more comment
history -E
or history -i
or whatever DO NOT work for me.
zsh --version
shows that zsh 4.3.6 (x86_64-suse-linux-gnu)
.
Then fc -li 100
works! It shows the recent 100 commands with timestamp :)
history -E
or history -i
or whatever DO NOT work for me.
zsh --version
shows that zsh 4.3.6 (x86_64-suse-linux-gnu)
.
Then fc -li 100
works! It shows the recent 100 commands with timestamp :)
edited Jan 8 '17 at 19:39
answered Dec 29 '16 at 10:08
Gab是好人Gab是好人
24827
24827
Thanks, this worked for me as well, contrary to the top answer. My version is:zsh 5.1.1 (x86_64-ubuntu-linux-gnu)
. And while I'm here: do you know how to get the help of the commandfc
? Neitherman fc
norfc --help
work
– exhuma
Jun 13 '17 at 6:49
@exhuma why not google it :)
– Gab是好人
Jun 14 '17 at 8:57
@Gab是好人 do you have history aliased? if you are usingoh-my-zsh
the history command is add the-l
flag in one of the options. see github.com/robbyrussell/oh-my-zsh/blob/master/lib/…
– Mike D
Jun 19 '17 at 12:51
1
fc -lf
will show a full timestamp. Note that this works only on zsh, not on bash.
– dr01
Jul 27 '17 at 7:49
@exhuma In zsh, you can userun-help fc
.
– xuhdev
Oct 28 '17 at 20:37
|
show 1 more comment
Thanks, this worked for me as well, contrary to the top answer. My version is:zsh 5.1.1 (x86_64-ubuntu-linux-gnu)
. And while I'm here: do you know how to get the help of the commandfc
? Neitherman fc
norfc --help
work
– exhuma
Jun 13 '17 at 6:49
@exhuma why not google it :)
– Gab是好人
Jun 14 '17 at 8:57
@Gab是好人 do you have history aliased? if you are usingoh-my-zsh
the history command is add the-l
flag in one of the options. see github.com/robbyrussell/oh-my-zsh/blob/master/lib/…
– Mike D
Jun 19 '17 at 12:51
1
fc -lf
will show a full timestamp. Note that this works only on zsh, not on bash.
– dr01
Jul 27 '17 at 7:49
@exhuma In zsh, you can userun-help fc
.
– xuhdev
Oct 28 '17 at 20:37
Thanks, this worked for me as well, contrary to the top answer. My version is:
zsh 5.1.1 (x86_64-ubuntu-linux-gnu)
. And while I'm here: do you know how to get the help of the command fc
? Neither man fc
nor fc --help
work– exhuma
Jun 13 '17 at 6:49
Thanks, this worked for me as well, contrary to the top answer. My version is:
zsh 5.1.1 (x86_64-ubuntu-linux-gnu)
. And while I'm here: do you know how to get the help of the command fc
? Neither man fc
nor fc --help
work– exhuma
Jun 13 '17 at 6:49
@exhuma why not google it :)
– Gab是好人
Jun 14 '17 at 8:57
@exhuma why not google it :)
– Gab是好人
Jun 14 '17 at 8:57
@Gab是好人 do you have history aliased? if you are using
oh-my-zsh
the history command is add the -l
flag in one of the options. see github.com/robbyrussell/oh-my-zsh/blob/master/lib/…– Mike D
Jun 19 '17 at 12:51
@Gab是好人 do you have history aliased? if you are using
oh-my-zsh
the history command is add the -l
flag in one of the options. see github.com/robbyrussell/oh-my-zsh/blob/master/lib/…– Mike D
Jun 19 '17 at 12:51
1
1
fc -lf
will show a full timestamp. Note that this works only on zsh, not on bash.– dr01
Jul 27 '17 at 7:49
fc -lf
will show a full timestamp. Note that this works only on zsh, not on bash.– dr01
Jul 27 '17 at 7:49
@exhuma In zsh, you can use
run-help fc
.– xuhdev
Oct 28 '17 at 20:37
@exhuma In zsh, you can use
run-help fc
.– xuhdev
Oct 28 '17 at 20:37
|
show 1 more comment
If you are using oh-my-zsh
addon in zsh
, history -E
or history -i
wont work (because it's aliased to fc -l 1
).
As @juanpastas pointed out, try
history -E
or
history -i
or
fc -li 100
add a comment |
If you are using oh-my-zsh
addon in zsh
, history -E
or history -i
wont work (because it's aliased to fc -l 1
).
As @juanpastas pointed out, try
history -E
or
history -i
or
fc -li 100
add a comment |
If you are using oh-my-zsh
addon in zsh
, history -E
or history -i
wont work (because it's aliased to fc -l 1
).
As @juanpastas pointed out, try
history -E
or
history -i
or
fc -li 100
If you are using oh-my-zsh
addon in zsh
, history -E
or history -i
wont work (because it's aliased to fc -l 1
).
As @juanpastas pointed out, try
history -E
or
history -i
or
fc -li 100
edited Sep 2 '18 at 19:31
Chris Stryczynski
559417
559417
answered Apr 7 '18 at 16:35
alpha_989alpha_989
1735
1735
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- 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%2funix.stackexchange.com%2fquestions%2f103398%2fhow-to-view-datetime-stamp-for-history-command-in-zsh-shell%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