1.应用场景

快速查找, 确认两者之间的区别, 帮助开发

2.学习/操作

不同点:

1.文件系统

Windows下不区分大小写,Linux区分

 

1.1 路径分隔符

一个路径,  在 Windows 中,斜线(/)和反斜线(\)都可以用作目录分隔符。在其它环境下是斜线(/)[即Linux/Unix]。

如在php code 中:

windows环境[均可]

$filePath = 'G:\\phpstudy_pro\WWW\study_test\test.txt';

$filePath = 'G://phpstudy_pro\WWW\study_test\test.txt';

 

linux环境:[只能如此]

$filePath = '/var/www/html/index.php';

 

 

1.2 查看目录[以及当前目录]

Windows:

dir

chdir

 

Linux:

ls 或者 ll

pwd

 

1.3 删除文件

window:

del 参数 需要删除的文件或者目录

 

Linux:

rm [options] name...  //删除一个文件或者目录。

统一使用:  //备注, 此删除, 没有提示, 直接删除与完毕. 至于误操作, 能否找回来, TBD 

rm -rf 目录/文件

 

1.4 打开指定路径的资源管理器

window:  cmd中输入 

start . //打开当前目录的资源管理器

start .. //打开上级目录

start  //重新打开当前相同的cmd窗口

start "你瞅啥?" //打开一个标题为'你瞅啥?'的cmd窗口

或者

explorer . //同理

explorer ..  /同理

explorer //相当于win+E  

 

 

 

...

 

相同点:

1.命令行下,均可以使用echo 输出

Linux[centOS7]:


 

Windows[win10]

 

 

 

 

后续补充

...

3.问题

TBD

4.参考

https://www.php/manual/zh/function.basename.php  //basename function

https://www.jianshu/p/bf3edeb68f73 //Windows小技巧 -- 命令行窗口打开指定目录的资源管理器

后续补充

...

更多推荐

Windows 与 Linux 异同