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
4 hours ago
Is it possible you already have an alias fortime='time -p'
that would explain the portable format?
– Jesse_b
4 hours ago
@Jesse_b no alias. I think it is using the bash keyword 'time' which apparently is identical to time -p
– Tyler Durden
4 hours ago
On my system the time builtin still has a-p
option to print portable.
– Jesse_b
3 hours ago
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 5 hours ago
Tyler DurdenTyler Durden
1,61042250
1,61042250
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
4 hours ago
Is it possible you already have an alias fortime='time -p'
that would explain the portable format?
– Jesse_b
4 hours ago
@Jesse_b no alias. I think it is using the bash keyword 'time' which apparently is identical to time -p
– Tyler Durden
4 hours ago
On my system the time builtin still has a-p
option to print portable.
– Jesse_b
3 hours ago
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
4 hours ago
Is it possible you already have an alias fortime='time -p'
that would explain the portable format?
– Jesse_b
4 hours ago
@Jesse_b no alias. I think it is using the bash keyword 'time' which apparently is identical to time -p
– Tyler Durden
4 hours ago
On my system the time builtin still has a-p
option to print portable.
– Jesse_b
3 hours ago
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
4 hours ago
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
4 hours ago
Is it possible you already have an alias for
time='time -p'
that would explain the portable format?– Jesse_b
4 hours ago
Is it possible you already have an alias for
time='time -p'
that would explain the portable format?– Jesse_b
4 hours ago
@Jesse_b no alias. I think it is using the bash keyword 'time' which apparently is identical to time -p
– Tyler Durden
4 hours ago
@Jesse_b no alias. I think it is using the bash keyword 'time' which apparently is identical to time -p
– Tyler Durden
4 hours ago
On my system the time builtin still has a
-p
option to print portable.– Jesse_b
3 hours ago
On my system the time builtin still has a
-p
option to print portable.– Jesse_b
3 hours ago
add a comment |
3 Answers
3
active
oldest
votes
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.
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 |
Use:
builtin type time
to see which version of time you're running.
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
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.
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.
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.
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.
answered 4 hours ago
Jesse_bJesse_b
12.4k23066
12.4k23066
add a comment |
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.
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 1 hour ago
Ed GrimmEd Grimm
2035
2035
add a comment |
add a comment |
Use:
builtin type time
to see which version of time you're running.
add a comment |
Use:
builtin type time
to see which version of time you're running.
add a comment |
Use:
builtin type time
to see which version of time you're running.
Use:
builtin type time
to see which version of time you're running.
answered 54 mins ago
Tom HaleTom Hale
6,74833694
6,74833694
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
4 hours ago
Is it possible you already have an alias for
time='time -p'
that would explain the portable format?– Jesse_b
4 hours ago
@Jesse_b no alias. I think it is using the bash keyword 'time' which apparently is identical to time -p
– Tyler Durden
4 hours ago
On my system the time builtin still has a
-p
option to print portable.– Jesse_b
3 hours ago