Is there a way to know which package these commands belong to?
find is in findutils
tar in coreutils
cd? xargs? etc?
Some heuristic?
I must be missing something… I am writing a line of bash for a service, therefore I think I need the package info.
Thanks!
If you just want to know for yourself and not for programmatic reasons this is low tech but works well enough:
ls -l $(which find)
This will return you the store path with which you can infer the name.
2 Likes
really nice - any idea how to find cd
?
I thought cd
isn’t a program, but a command implemented in shells.
The cd command, also known as chdir (change directory), is a command-line shell command used to change the current working directory in various operating systems. It can be used in shell scripts and batch files.
The command has been implemented in operating systems such as Unix, DOS, IBM OS/2, MetaComCo TRIPOS, AmigaOS (where if a bare path is given, cd is implied), Microsoft Windows, ReactOS, and Linux. On MS-DOS, it is available in versions 2 and later. DR DOS 6.0 also includes an implementati...
1 Like
ahhh, i never knew! thanks for this
The type
builtin can discriminate between external commands and shell builtins/functions/aliases/etc. You can also use type -a <cmd>
to see all commands an invocation could resolve to.
1 Like
Sandro
June 24, 2022, 10:20am
8
command-not-found or nix-locate
1 Like