time not accepting arguments
I installed time but when I use it, I am getting the portable format, not the default format. When installed I think it said GNU time 1.7 or 1.72.
Commands like
time --help
time --version
fail with the error "command not found". The TIME environment variable is unset. Why is time behaving like this?
arch-linux time
add a comment |
I installed time but when I use it, I am getting the portable format, not the default format. When installed I think it said GNU time 1.7 or 1.72.
Commands like
time --help
time --version
fail with the error "command not found". The TIME environment variable is unset. Why is time behaving like this?
arch-linux time
2
time
is a shell keyword, you probably have to point to the full path of the installed time to use it:/usr/bin/time --version
or maybe alias it.
– Jesse_b
Jan 27 at 23:42
Is it possible you already have an alias fortime='time -p'
that would explain the portable format?
– Jesse_b
Jan 28 at 0:05
@Jesse_b no alias. I think it is using the bash keyword 'time' which apparently is identical to time -p
– Tyler Durden
Jan 28 at 0:32
On my system the time builtin still has a-p
option to print portable.
– Jesse_b
Jan 28 at 0:46
add a comment |
I installed time but when I use it, I am getting the portable format, not the default format. When installed I think it said GNU time 1.7 or 1.72.
Commands like
time --help
time --version
fail with the error "command not found". The TIME environment variable is unset. Why is time behaving like this?
arch-linux time
I installed time but when I use it, I am getting the portable format, not the default format. When installed I think it said GNU time 1.7 or 1.72.
Commands like
time --help
time --version
fail with the error "command not found". The TIME environment variable is unset. Why is time behaving like this?
arch-linux time
arch-linux time
asked Jan 27 at 23:39
Tyler DurdenTyler Durden
1,63042350
1,63042350
2
time
is a shell keyword, you probably have to point to the full path of the installed time to use it:/usr/bin/time --version
or maybe alias it.
– Jesse_b
Jan 27 at 23:42
Is it possible you already have an alias fortime='time -p'
that would explain the portable format?
– Jesse_b
Jan 28 at 0:05
@Jesse_b no alias. I think it is using the bash keyword 'time' which apparently is identical to time -p
– Tyler Durden
Jan 28 at 0:32
On my system the time builtin still has a-p
option to print portable.
– Jesse_b
Jan 28 at 0:46
add a comment |
2
time
is a shell keyword, you probably have to point to the full path of the installed time to use it:/usr/bin/time --version
or maybe alias it.
– Jesse_b
Jan 27 at 23:42
Is it possible you already have an alias fortime='time -p'
that would explain the portable format?
– Jesse_b
Jan 28 at 0:05
@Jesse_b no alias. I think it is using the bash keyword 'time' which apparently is identical to time -p
– Tyler Durden
Jan 28 at 0:32
On my system the time builtin still has a-p
option to print portable.
– Jesse_b
Jan 28 at 0:46
2
2
time
is a shell keyword, you probably have to point to the full path of the installed time to use it: /usr/bin/time --version
or maybe alias it.– Jesse_b
Jan 27 at 23:42
time
is a shell keyword, you probably have to point to the full path of the installed time to use it: /usr/bin/time --version
or maybe alias it.– Jesse_b
Jan 27 at 23:42
Is it possible you already have an alias for
time='time -p'
that would explain the portable format?– Jesse_b
Jan 28 at 0:05
Is it possible you already have an alias for
time='time -p'
that would explain the portable format?– Jesse_b
Jan 28 at 0:05
@Jesse_b no alias. I think it is using the bash keyword 'time' which apparently is identical to time -p
– Tyler Durden
Jan 28 at 0:32
@Jesse_b no alias. I think it is using the bash keyword 'time' which apparently is identical to time -p
– Tyler Durden
Jan 28 at 0:32
On my system the time builtin still has a
-p
option to print portable.– Jesse_b
Jan 28 at 0:46
On my system the time builtin still has a
-p
option to print portable.– Jesse_b
Jan 28 at 0:46
add a comment |
3 Answers
3
active
oldest
votes
While Jesse_b is correct about how shells generally look up commands, there's an easier fix.
time --version
Bash, ksh, zsh, and I believe a few other common shells will treat a leading backslash on a command with no path as 'skip to looking into the PATH for this thing.'
Also, knowing what the time builtin is, we could also get around this by running
time time --version
After all, the reason for the command not found error rather than a no such option error is because the shell builtin just runs the command that follows and checks how long it took to run when it finishes... which is the same thing that /bin/time does.
If you're expecting time to take arguments... are you wanting to find out what time it is? Because that's the date
command.
add a comment |
When looking for a command the shell uses the following preference:
- aliases
- Parameter expansion, command substitution, arithmetic expansion, and quote removal before being assigned to the variable
- functions
- BUILTIN commands
- HASH table
- Search
PATH
So the time
keyword will be used with preference over the installed version of time
presumably found in your PATH
. You can overcome this with an alias, such as:
alias time=/usr/bin/time
(ensure the path is specific to whatever location you have installed time)
add a comment |
Use:
command builtin type time
to see which version of time
you're running.
This is the paranoid version - usually just type time
is sufficient, but the above will avoid situations where alias type=echo
.
To see all binary versions of time
in your $PATH
, use which -a time
.
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%2f497094%2ftime-not-accepting-arguments%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
While Jesse_b is correct about how shells generally look up commands, there's an easier fix.
time --version
Bash, ksh, zsh, and I believe a few other common shells will treat a leading backslash on a command with no path as 'skip to looking into the PATH for this thing.'
Also, knowing what the time builtin is, we could also get around this by running
time time --version
After all, the reason for the command not found error rather than a no such option error is because the shell builtin just runs the command that follows and checks how long it took to run when it finishes... which is the same thing that /bin/time does.
If you're expecting time to take arguments... are you wanting to find out what time it is? Because that's the date
command.
add a comment |
While Jesse_b is correct about how shells generally look up commands, there's an easier fix.
time --version
Bash, ksh, zsh, and I believe a few other common shells will treat a leading backslash on a command with no path as 'skip to looking into the PATH for this thing.'
Also, knowing what the time builtin is, we could also get around this by running
time time --version
After all, the reason for the command not found error rather than a no such option error is because the shell builtin just runs the command that follows and checks how long it took to run when it finishes... which is the same thing that /bin/time does.
If you're expecting time to take arguments... are you wanting to find out what time it is? Because that's the date
command.
add a comment |
While Jesse_b is correct about how shells generally look up commands, there's an easier fix.
time --version
Bash, ksh, zsh, and I believe a few other common shells will treat a leading backslash on a command with no path as 'skip to looking into the PATH for this thing.'
Also, knowing what the time builtin is, we could also get around this by running
time time --version
After all, the reason for the command not found error rather than a no such option error is because the shell builtin just runs the command that follows and checks how long it took to run when it finishes... which is the same thing that /bin/time does.
If you're expecting time to take arguments... are you wanting to find out what time it is? Because that's the date
command.
While Jesse_b is correct about how shells generally look up commands, there's an easier fix.
time --version
Bash, ksh, zsh, and I believe a few other common shells will treat a leading backslash on a command with no path as 'skip to looking into the PATH for this thing.'
Also, knowing what the time builtin is, we could also get around this by running
time time --version
After all, the reason for the command not found error rather than a no such option error is because the shell builtin just runs the command that follows and checks how long it took to run when it finishes... which is the same thing that /bin/time does.
If you're expecting time to take arguments... are you wanting to find out what time it is? Because that's the date
command.
answered Jan 28 at 3:18
Ed GrimmEd Grimm
3486
3486
add a comment |
add a comment |
When looking for a command the shell uses the following preference:
- aliases
- Parameter expansion, command substitution, arithmetic expansion, and quote removal before being assigned to the variable
- functions
- BUILTIN commands
- HASH table
- Search
PATH
So the time
keyword will be used with preference over the installed version of time
presumably found in your PATH
. You can overcome this with an alias, such as:
alias time=/usr/bin/time
(ensure the path is specific to whatever location you have installed time)
add a comment |
When looking for a command the shell uses the following preference:
- aliases
- Parameter expansion, command substitution, arithmetic expansion, and quote removal before being assigned to the variable
- functions
- BUILTIN commands
- HASH table
- Search
PATH
So the time
keyword will be used with preference over the installed version of time
presumably found in your PATH
. You can overcome this with an alias, such as:
alias time=/usr/bin/time
(ensure the path is specific to whatever location you have installed time)
add a comment |
When looking for a command the shell uses the following preference:
- aliases
- Parameter expansion, command substitution, arithmetic expansion, and quote removal before being assigned to the variable
- functions
- BUILTIN commands
- HASH table
- Search
PATH
So the time
keyword will be used with preference over the installed version of time
presumably found in your PATH
. You can overcome this with an alias, such as:
alias time=/usr/bin/time
(ensure the path is specific to whatever location you have installed time)
When looking for a command the shell uses the following preference:
- aliases
- Parameter expansion, command substitution, arithmetic expansion, and quote removal before being assigned to the variable
- functions
- BUILTIN commands
- HASH table
- Search
PATH
So the time
keyword will be used with preference over the installed version of time
presumably found in your PATH
. You can overcome this with an alias, such as:
alias time=/usr/bin/time
(ensure the path is specific to whatever location you have installed time)
edited Jan 28 at 15:04
answered Jan 27 at 23:49
Jesse_bJesse_b
12.8k23268
12.8k23268
add a comment |
add a comment |
Use:
command builtin type time
to see which version of time
you're running.
This is the paranoid version - usually just type time
is sufficient, but the above will avoid situations where alias type=echo
.
To see all binary versions of time
in your $PATH
, use which -a time
.
add a comment |
Use:
command builtin type time
to see which version of time
you're running.
This is the paranoid version - usually just type time
is sufficient, but the above will avoid situations where alias type=echo
.
To see all binary versions of time
in your $PATH
, use which -a time
.
add a comment |
Use:
command builtin type time
to see which version of time
you're running.
This is the paranoid version - usually just type time
is sufficient, but the above will avoid situations where alias type=echo
.
To see all binary versions of time
in your $PATH
, use which -a time
.
Use:
command builtin type time
to see which version of time
you're running.
This is the paranoid version - usually just type time
is sufficient, but the above will avoid situations where alias type=echo
.
To see all binary versions of time
in your $PATH
, use which -a time
.
edited Jan 29 at 9:12
answered Jan 28 at 3:45
Tom HaleTom Hale
7,04333797
7,04333797
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%2f497094%2ftime-not-accepting-arguments%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
2
time
is a shell keyword, you probably have to point to the full path of the installed time to use it:/usr/bin/time --version
or maybe alias it.– Jesse_b
Jan 27 at 23:42
Is it possible you already have an alias for
time='time -p'
that would explain the portable format?– Jesse_b
Jan 28 at 0:05
@Jesse_b no alias. I think it is using the bash keyword 'time' which apparently is identical to time -p
– Tyler Durden
Jan 28 at 0:32
On my system the time builtin still has a
-p
option to print portable.– Jesse_b
Jan 28 at 0:46