macos 如何导航到终端(mac)中的不同目录?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9547730/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to navigate to to different directories in the terminal (mac)?
提问by aurel
I have just installed sass and I am now tryring to access the sass file. For example:
我刚刚安装了 sass,我现在正在尝试访问 sass 文件。例如:
sass --watch ~/Desktop/sass/css/style.css:style.css
and the error is "no such file or directory" - So how can I do this?
错误是“没有这样的文件或目录” - 那么我该怎么做呢?
My mac version is 10.6.8
我的mac版本是10.6.8
回答by simont
To check that the file you're trying to open actually exists, you can change directories in terminal using cd
. To change to ~/Desktop/sass/css
: cd ~/Desktop/sass/css
. To see what files are in the directory: ls
.
要检查您尝试打开的文件是否确实存在,您可以使用cd
. 改为~/Desktop/sass/css
:cd ~/Desktop/sass/css
。要查看目录中的文件:ls
.
If you want information about either of those commands, use the man
page: man cd
or man ls
, for example.
如果您需要有关这些命令中的任何一个的信息,请使用man
page:man cd
或man ls
,例如。
Google for "basic unix command line commands" or similar; that will give you numerous examples of moving around, viewing files, etc in the command line.
谷歌搜索“基本的 unix 命令行命令”或类似命令;这将为您提供许多在命令行中移动、查看文件等的示例。
On Mac OS X, you can also use open
to open a finder window: open .
will open the current directory in finder. (open ~/Desktop/sass/css
will open the ~/Desktop/sass/css
).
在 Mac OS X 上,您还可以使用open
打开 finder 窗口:open .
将在 finder 中打开当前目录。(open ~/Desktop/sass/css
将打开~/Desktop/sass/css
)。