Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

which(1) [bsd man page]

WHICH(1)						      General Commands Manual							  WHICH(1)

NAME
which - locate a program file including aliases and paths (csh only) SYNOPSIS
which [ name ] ... DESCRIPTION
Which takes a list of names and looks for the files which would be executed had these names been given as commands. Each argument is expanded if it is aliased, and searched for along the user's path. Both aliases and path are taken from the user's .cshrc file. FILES
~/.cshrc source of aliases and path values DIAGNOSTICS
A diagnostic is given for names which are aliased to more than a single word, or if an executable file with the argument name was not found in the path. BUGS
Must be executed by a csh, since only csh's know about aliases. 3rd Berkeley Distribution April 29, 1985 WHICH(1)

Check Out this Related Man Page

which(1)						      General Commands Manual							  which(1)

NAME
which - locate a program file including aliases and paths SYNOPSIS
[name...] DESCRIPTION
For each name given, searches for the file that would be executed if name were given as a command, and displays the absolute path of that file. Each argument is expanded if it is aliased, and searched for along the user's path. Both aliases and path are determined by sourc- ing (executing) the user's file. DIAGNOSTICS
A diagnostic is given for names that are aliased to more than a single word, or if an executable file with the argument name was not found in the path. EXAMPLES
The command: specifies where the executable program of the sh(1) command is found. For example, the response might be: if the sh(1) being used is located in WARNINGS
reports aliases even when not invoked from csh. cannot find built-in commands (e.g., jobs). information may be incorrect because it is unaware of any path or alias changes that have occurred in the current shell session. AUTHOR
was developed by the University of California, Berkeley. FILES
source of aliases and path values which(1)
Man Page

14 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to find a date which is 7 days past when given current date

hii all. I have to get the date of the 7th day past from the current date. if i give the current date as sep 3 then i must get the date as 27th of august. can we get the values from the "cal" command. cal | awk '{print $2}' will this type of command work. actually my need is if today is... (17 Replies)
Discussion started by: ladtony
17 Replies

2. Shell Programming and Scripting

downsizing of strings which are returned by grep

hey every1, i am a very new shell programmer. what i am trying to do is to rename a music file using its metadata(using mminfo) the problem is, mminfo's output is very weird: my final filename should be "$artist - $title" however, when i use artist=` mminfo ~/Desktop/It\'s\ Not\ My\... (16 Replies)
Discussion started by: abhigyan91
16 Replies

3. What is on Your Mind?

Which OS you use for Desktop

I am on Solaris 10 cat /etc/release Solaris 10 10/09 s10x_u8wos_08a X86 Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms. Assembled 16 September 2009 (16 Replies)
Discussion started by: solaris_user
16 Replies

4. UNIX for Advanced & Expert Users

Which cut command is more efficient?

Hi, I've got a query regarding which of the following is more efficient & why - cat <filename>|cut -d'*' -f2- > <newfilename> or cut -d'*' -f2- <filename> > <newfilename> Thanks. (17 Replies)
Discussion started by: sumoka
17 Replies

5. Shell Programming and Scripting

Dont have a clue which program to use to process flying bat data

Hi, Im not a unix person but need to analyse some data. This is bat data (animals) from large roosts using data loggers. I think AWK is probably the best thing to use but dont really know so any help appreciated. (python, grep) whichever it is, I'll have to learn it! here is an example of... (27 Replies)
Discussion started by: cmp260
27 Replies

6. Solaris

How to check which type of storage is used in unix?

SunOS 5.10 Generic_142900-15 sun4v sparc SUNW,T5240 how can i check the storage type being used in unix solaris sparc system? please help me its urgnet.. thank you (22 Replies)
Discussion started by: aesgs
22 Replies

7. Shell Programming and Scripting

How to connect to FTP server which requires SSL authentication?

Hello, I tried searching through lot of threads for a solution but couldn't fetch the exact solution, so I am creating a new thread. I am trying to connect to a FTP server 1) using a simple FTP command, it gives the error : 534 Policy requires SSL. Login failed. 2) using SFTP... (19 Replies)
Discussion started by: amitshete
19 Replies

8. UNIX for Dummies Questions & Answers

Delete the file which crossed 2GB

Hi , I wants to create the bash script for deleting the specified 2gb file and wants to take the backup before doing that. please help me how to do the same,I use RHEL5 server (22 Replies)
Discussion started by: Rahulne25
22 Replies

9. UNIX for Dummies Questions & Answers

GREP function in ksh which ignores LINE Breaks

Hello I am using a grep command with two patterns in my KSH script. File has line breaks in it and both the patterns are in different lines. Here is the command grep -l 'RITE AID.*ST.820' natriter820u.20140914 Pattern1 - RITE AID Pattern2 - ST*820 I am not getting any results from... (24 Replies)
Discussion started by: Raghav Garg
24 Replies

10. Shell Programming and Scripting

Replace multiple positions in records which match crireria

I have a test file a.txt 001 123 456 789 002 This is just a 001 test data 003 file. I want to clear columns 5 and 6 if the first 3 characters are 001 using awk. I tried following but does not work. Any suggestions? awk 'BEGIN{OFS=FS=""} {if (substr($0,1,3)=="123") $5=" "; $6="... (20 Replies)
Discussion started by: Soham
20 Replies

11. Shell Programming and Scripting

Which shell can I use on Linux?

I have Linux x86_64 x86_64 x86_64 GNU/Linux I thought that Linux can use only bash shell however, when I wrote the code: #!/bin/sh NAME=`basename $0 .sh` Today=`date '+%Y%m%d'` TIMESTAMP=`date +%H:%M:%S` LOCAL_SERVER=`hostname` let countcla=0 countcla=`expr ${countcla} + 1` ... (18 Replies)
Discussion started by: digioleg54
18 Replies

12. Shell Programming and Scripting

Remove duplicate lines which has been repeated 4 times

Remove duplicate lines which has been repeated 4 times attached test.txt below command tried and not getting expect output. for i in `cat test.txt | uniq` do num=`cat test.txt | grep $i | wc -l` echo $i $num done test.txt ... (17 Replies)
Discussion started by: Kalia
17 Replies

13. What is on Your Mind?

Which category do you belong to?

Hello All, I was thinking to start this POLL, sometime back but couldn't get time so starting it today. So we all work either as an Admin or as a Developer or as a QA etc. So let's have a thread(POLL) where we could share our experiences(if it doesn't come anyone's privacy category) so that we... (17 Replies)
Discussion started by: RavinderSingh13
17 Replies

14. UNIX Desktop Questions & Answers

Which is your favourite desktop?

Most of the people think that they can not use Unix as desktop. By this poll we gone tell them that we not just use Unix as desktop but also love different display managers like GNOME, KDE etc..... (35 Replies)
Discussion started by: ynilesh
35 Replies