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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 08:56:16  来源:igfitidea点击:

How to navigate to to different directories in the terminal (mac)?

macosterminal

提问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/csscd ~/Desktop/sass/css。要查看目录中的文件:ls.

If you want information about either of those commands, use the manpage: man cdor man ls, for example.

如果您需要有关这些命令中的任何一个的信息,请使用manpage:man cdman 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 opento open a finder window: open .will open the current directory in finder. (open ~/Desktop/sass/csswill open the ~/Desktop/sass/css).

在 Mac OS X 上,您还可以使用open打开 finder 窗口:open .将在 finder 中打开当前目录。(open ~/Desktop/sass/css将打开~/Desktop/sass/css)。