snippetbashTip
command — Force the shell to execute the program and ignore any functions, builtins, and aliases with the same
Viewed 0 times
theshellcommandexecuteforcecli
Problem
How to use the
command command: Force the shell to execute the program and ignore any functions, builtins, and aliases with the same name. More information: <https://www.gnu.org/software/bash/manual/bash.html#index-command>.Solution
command — Force the shell to execute the program and ignore any functions, builtins, and aliases with the same name. More information: <https://www.gnu.org/software/bash/manual/bash.html#index-command>.Execute the
ls program literally, even if an ls alias exists:command lsFind and execute a command using a default
$PATH (/bin:/usr/bin:/sbin:/usr/sbin:/etc:/usr/etc) that guarantees to find all standard utilities:command -p {{command_name}}Display the path to the executable or the alias definition of a specific command:
command -v {{command_name}}Code Snippets
Execute the `ls` program literally, even if an `ls` alias exists
command lsFind and execute a command using a default `$PATH` (`/bin:/usr/bin:/sbin:/usr/sbin:/etc:/usr/etc`) that guarantees to find all standard utilities
command -p {{command_name}}Display the path to the executable or the alias definition of a specific command
command -v {{command_name}}Context
tldr-pages: common/command
Revisions (0)
No revisions yet.