当前位置:首页 > 西部百科 > 正文内容

where与which区别(which和whereis的区别)

2023-04-07 06:18:04西部百科1

which和whereis的区别

Linux命令搜索命令whereis与which的区别

一 whereis

1、语法

whereis 命令名

搜索命令所在的路径以及帮助文档所在的位置

选项:

-b:只查找可执行文件

-m:只查找帮助文件

2、实战

[root@localhost ~]# whereis ls

ls:/usr/bin/ls /usr/share/man/man1/ls.1.gz/usr/share/man/man1p/ls.1p.gz

[root@localhost ~]# whoami

root

[root@localhost ~]# whatis

whatis what?

[root@localhost ~]# whatis ls

ls (1)- list directory contents

ls (1p)- list directory contents

[root@localhost ~]# whereis -b ls

ls:/usr/bin/ls

[root@localhost ~]# whereis -m ls

ls:/usr/share/man/man1/ls.1.gz/usr/share/man/man1p/ls.1p.gz

二 which

1、语法

which 命令名

搜索命令所在路径及别名

2、实战

[root@localhost ~]# which ls

alias ls='ls --color=auto'

/usr/bin/ls

[root@localhost ~]# which pwd

/usr/bin/pwd

[root@localhost ~]# whereis cd

cd:/usr/bin/cd /usr/share/man/man1/cd.1.gz/usr/share/man/man1p/cd.1p.gz

[root@localhost ~]# which cd

/usr/bin/cd

where和which

区别是用法不同,举例如下:

I don't know where she is now.

I don't know in which room she is now.

who can tell me where is my bike.

who can tell me in which park lot is my bike.

英语where和which区别

区别为:指代不同、用法不同、侧重点不同。

一、指代不同

1、in which:在其中。

2、where:在该情况下。

二、用法不同

1、in which:which用作关系代词,可引导限制性定语从句或非限制性定语从句,引导非限制性定语从句时which可以用整个主句作为其前行词,相当于and that,有时还可引导不定式短语从句。

2、where:where用作副词的基本意思是“什么地方,哪里”,可用作疑问副词,引导特殊疑问句。

三、侧重点不同

1、in which:是疑问代词。

2、where:是方位副词。

where 和which的区别

where是关系副词,在定语从句里表示在某地,作状语,表地点,有时候也能用介词加which来代替

The school where you study is the best in our city.

而which和that 是关系代词,在定语从句中是作主语或宾语,做宾语可以省略

The school that/which you visited last week is the best in our city.这里的关系代词做了visited的宾语可以省略。

当然即便是同为关系代词,which和that的用法依旧有区别,适用范围也不同……

where与which的区别用法

指代不同 1、in which:在其中。 2、where:在该情况下。

2.

用法不同 1、in which:which用作关系代词,可引导限制性定语从句或非限制性定语从句,引导非限制性定语从句时which可以用整个主句作为其前行词,相当于and that,有时还可引导不定式短语从句...

3.

侧重点不同 1、in which:是疑问代词。 2、where:是方位副词。

where和which的用法区别

这个问题,是定语从句中的关系词问题。

that 是关系代词的一个。

where 是关系副词,which 是关系代词,而where = 介词+which,这个介词有时候是in, 也就出现了in which.

当然,这个介词也有可能是on, to, by 等等,视情况而定。

which和where有什么区别

二者引导的定语从句不同。前者which可以引导各种定语从句,而where引导的只是表示地点的定语从句。例句the place where he said is Beijing.他说的地方是北京。

本网站文章仅供交流学习 ,不作为商用, 版权归属原作者,部分文章推送时未能及时与原作者取得联系,若来源标注错误或侵犯到您的权益烦请告知,我们将立即删除.

本文链接:https://www.xibujisuan.cn/98767253.html