Developer(s) | Carlo Wood, Daniel Papasian, Trane Francks |
---|---|
Stable release | |
Operating system | Unix, Unix-like, Microsoft Windows, FreeBSD, FreeDOS, AROS Research Operating System [2] |
Type | Command |
License | coreutils: GNU GPL v3, BusyBox: BSD, FreeDOS: GNU GPLv2, AROS: AROS Public License (APL) Version 1.1 (based on the MPL) [3] |
Website | GNU: gnu |
In computing, which
is a command for various operating systems used to identify the location of executables. The command is available in Unix and Unix-like systems, the AROS shell, [4] for FreeDOS [5] and for Microsoft Windows. [2] The functionality of the which command is similar to some implementations of the type command. POSIX specifies a command named command that also covers this functionality. [6]
The command takes one or more arguments; for each of these arguments, it prints the full path of the executable to stdout that would have been executed if this argument had been entered into the shell. It does this by searching for an executable or script in the directories listed in the environment variable PATH. The which command is part of most Unix-like computers. It is also part of the C Shell. [6]
A which command first appeared in 3BSD. [7]
Carlo Wood developed the GNU implementation used in most Linux-based operating systems. [8]
On FreeBSD, the which utility was originally written in Perl by Wolfram Schneider. The current version of which was rewritten by Daniel Papasian using the C programming language. [9]
Multics uses the command where
abbreviated as wh
.
The command is available as a separate package for Microsoft Windows as part of the GnuWin32 project [2] and the UnxUtils collection of native Win32 ports of common GNU Unix-like utilities. [10] Windows also includes the similar where.exe
command.
The same functionality is available in MS-DOS, but not Windows, as the built-in TRUENAME command.
In PowerShell, the functionality is provided by the Get-Command Cmdlet. [11]
The command is used to find and print the location of a specific program. [13]
Inputs:
uniq
is a utility command on Unix, Plan 9, Inferno, and Unix-like operating systems which, when fed a text file or standard input, outputs the text with adjacent identical lines collapsed to one, unique line of text.
In computing, ls
is a command to list computer files and directories in Unix and Unix-like operating systems. It is specified by POSIX and the Single UNIX Specification.
In Unix-like and some other operating systems, the pwd
command writes the full pathname of the current working directory to the standard output.
In the Unix operating system, shar is an archive format created with the Unix shar
utility. A shar file is a type of self-extracting archive, because it is a valid shell script, and executing it will recreate the files. To extract the files, only the standard Unix Bourne shell sh is usually required.
basename is a standard computer program on Unix and Unix-like operating systems. When basename is given a pathname, it will delete any prefix up to the last slash ('/'
) character and return the result. basename is described in the Single UNIX Specification and is primarily used in shell scripts.
uname is a computer program in Unix and Unix-like computer operating systems that prints the name, version and other details about the current machine and the operating system running on it.
The command chown, an abbreviation of change owner, is used on Unix and Unix-like operating systems to change the owner of file system files and directories. Unprivileged (regular) users who wish to change the group membership of a file that they own may use chgrp.
In computing, touch
is a command used to update the access date and/or modification date of a computer file or directory. It is included in Unix and Unix-like operating systems, TSC's FLEX, Digital Research/Novell DR DOS, the AROS shell, the Microware OS-9 shell, and ReactOS. The command is also available for FreeDOS and Microsoft Windows.
The Unix command su, which stands for 'substitute user', is used by a computer user to execute commands with the privileges of another user account. When executed it invokes a shell without changing the current working directory or the user environment.
join
is a command in Unix and Unix-like operating systems that merges the lines of two sorted text files based on the presence of a common field. It is similar to the join operator used in relational databases but operating on text files.
tr is a command in Unix, Plan 9, Inferno, and Unix-like operating systems. It is an abbreviation of translate or transliterate, indicating its operation of replacing or removing specific characters in its input data set.
wc
is a command in Unix, Plan 9, Inferno, and Unix-like operating systems. The program reads either standard input or a list of computer files and generates one or more of the following statistics: newline count, word count, and byte count. If a list of files is provided, both individual file and total statistics follow.
cksum
is a command in Unix and Unix-like operating systems that generates a checksum value for a file or stream of data. The cksum command reads each file given in its arguments, or standard input if no arguments are provided, and outputs the file's 32-bit cyclic redundancy check (CRC) checksum and byte count. The CRC output by cksum is different from the CRC-32 used in zip, PNG and zlib.
In computing, cmp
is a command-line utility on Unix and Unix-like operating systems that compares two files of any type and writes the results to the standard output. By default, cmp
is silent if the files are the same; if they differ, the byte and line number at which the first difference occurred is reported. The command is also available in the OS-9 shell.
rm
is a basic command on Unix and Unix-like operating systems used to remove objects such as computer files, directories and symbolic links from file systems and also special files such as device nodes, pipes and sockets, similar to the del
command in MS-DOS, OS/2, and Microsoft Windows. The command is also available in the EFI shell.
tail is a program available on Unix, Unix-like systems, FreeDOS and MSX-DOS used to display the tail end of a text file or piped data.
In computing, tee
is a command in command-line interpreters (shells) using standard streams which reads standard input and writes it to both standard output and one or more files, effectively duplicating its input. It is primarily used in conjunction with pipes and filters. The command is named after the T-splitter used in plumbing.
yes
is a command on Unix and Unix-like operating systems, which outputs an affirmative response, or a user-defined string of text, continuously until killed.
In computing, sleep is a command in Unix, Unix-like and other operating systems that suspends program execution for a specified time.
In computing, whoami is a command found on most Unix-like operating systems, Intel iRMX 86, every Microsoft Windows operating system since Windows Server 2003, and on ReactOS. It is a concatenation of the words "Who am I?" and prints the effective username of the current user when invoked.
which
for Windows from the GnuWin32 project