简体   繁体   English

在 jupyter notebook 中使用 bash 'ls' 命令?

[英]Use bash ´ls´ command in jupyter notebook?

I just want to type the same bash command in jupyter which I also use in the bash terminal.我只想在 jupyter 中键入相同的 bash 命令,我也在 bash 终端中使用它。

I find the content of a folder in bash using this command and get the following output:我使用此命令在 bash 中找到文件夹的内容并获得以下输出:

>>> ls data/bulldozers/ Train.csv

However when I use the same command in a jupyter notebook:但是,当我在 jupyter 笔记本中使用相同的命令时:

>>> PATH = "data/bulldozers/"
    !ls {PATH}

    ls: data/bulldozers/: No such file or directory

What is the issue here?这里有什么问题?

解决该问题的方法是将包含我需要在笔记本目录中找到的文件的文件夹。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM