匠人学院 JR Academy学AI来匠人
匠人学院 JR Academy学AI来匠人

Follow Us

linkedinfacebooktwitterinstagramweiboyoutubebilibilitiktokxigua

We Accept

/image/layout/pay-paypal.png/image/layout/pay-visa.png/image/layout/pay-master-card.png/image/layout/pay-airwallex.png/image/layout/pay-alipay.png
EN

关于公司

关于我们元宇宙课堂新闻资讯匠人工作成为导师匠人导师联系我们匠人商店J3.Club

匠人资源

工作内推匠人活动1对1私教行业白皮书线上学习平台面试中心分享面试经验Internship会员中心

AI 工具

AI 工具箱考证匠 Cert Master求职匠 Job Hunter牛小匠 UniMate AI

AI 学习方向

全部学习方向AI EngineerContext EngineeringVibe CodingPrompt MasterAI BuilderAI 产品经理Python 入门

AI 应用提效

AI 办公提效AI 数据分析AI 财务AI 内容创作AI 视觉创作前端开发Hermes AgentOpenClaw 本地智能体

大学资源

墨尔本大学昆士兰大学新南威尔士大学悉尼大学莫那什大学阿德莱德大学RMITQUTUTS

少儿 AI 教育

Airbotix 少儿 AI 编程澳洲家长实用资料库NAPLAN 成绩单怎么看My School 学校数据指南悉尼私校学费 2026少儿编程课程与训练营

移民服务

澳洲移民技术移民189/190/491雇主担保482/186/494投资移民188/888英国移民美国移民加拿大移民

企业合作

P3职业孵化器Enterprise (EN)企业培训实习合作招聘合作申请合作

求职代理

岗位代投职位监控LinkedIn代运营LinkedIn人脉代加了解P3项目

匠人支持

FAQsTerms & ConditionsPrivacy PolicyCancellation & Refund PolicySite map

Top Categories

Web全栈班DevOps项目班数据工程全栈班数据分析项目班编程入门班Business Analyst实习算法集训营

求职就业

BA和产品经理实习数据科学实习数据分析实习Marketing实习简历修改面试指导导师指导VIP

地址

Level 10b, 144 Edward Street, Brisbane CBD(Headquarter)
Level 2, 171 La Trobe St, Melbourne VIC 3000
四川省成都市武侯区桂溪街道天府大道中段500号D5东方希望天祥广场B座45A13号
Business Hub, 155 Waymouth St, Adelaide SA 5000

联系方式

hello@jiangren.com.au0421-672-555

Disclaimer

footer-disclaimerfooter-disclaimer

JR Academy acknowledges Traditional Owners of Country throughout Australia and recognises the continuing connection to lands, waters and communities. We pay our respect to Aboriginal and Torres Strait Islander cultures; and to Elders past and present. Aboriginal and Torres Strait Islander peoples should be aware that this website may contain images or names of people who have since passed away.

匠人学院网站上的所有内容,包括课程材料、徽标和匠人学院网站上提供的信息,均受澳大利亚政府知识产权法的保护。严禁未经授权使用、销售、分发、复制或修改。违规行为可能会导致法律诉讼。通过访问我们的网站,您同意尊重我们的知识产权。JR Academy Pty Ltd 保留所有权利,包括专利、商标和版权。任何侵权行为都将受到法律追究。查看用户协议

© 2017-2026 JR Academy Pty Ltd. All rights reserved.

ABN 26621887572

首页/资源中心/文章详情
JR Academy · Blog职业洞察

Introduction to the Mac OS X Command Line

Introduction to the Mac OS X Command Line. How to use Command line in MacOS, including how to open the command line, Anatomy of the Console, Running a Command, and so on.

发布日期2018-11-22
阅读时长5 分钟
作者Wang Yanbo

快速导航

  • How to open the command line.
  • Anatomy of the Console
  • Running a Command.
  • Where Are You?
  • Get Some Help, man!

Introduction to the Mac OS X Command Line

This is a command line tutorial primarily conducted in in the OS X command line. Because of OSX’s unix heritage, much of the info here is also useful in other unix inspired systems, like the Linux command line.

The command line can be a scary place when you first encounter it. When you read some instructions that tell you to open up a terminal window and type some cryptic words and phrases, it can seem like you’ve been sucked into the matrix, expected to decrypt an endless stream of indecipherable characters.

Fear not, it’s really not that difficult to use. In fact, when you see an experienced user looking at a terminal that is scrolling line after line of text faster than you can even read it, they aren’t really reading it either. For the most part they may be scanning for some key words, but mostly they are just waiting for it to stop.

 

How to open the command line.

Before you can use it, you need to be able to find it.

So what we need to do is open the terminal. On OS X, open your Applications folder, then open the Utilities folder. Open the Terminal application. You may want to add this to your dock. I like to launch terminal by using Spotlight search in OS X, searching for “terminal”

Introduction to the Mac OS X Command Line

Anatomy of the Console

First let’s clarify a few terms.

Console: This is the system as a whole. This is both the command line as well as the output from previous commands.

Command Line: This is the actual line in a console where you type your command.

Prompt: This is the beginning of the command line. It usually provides some contextual information like who you are, where you are and other useful info. It typically ends in a $ . After the prompt is where you will be typing commands.

Terminal: This is the actual interface to the console. The program we use to interact with the console is actually a “terminal emulator”, providing us the experience of typing into an old school terminal from the convenience of our modern graphical operating system.

Running a Command.

Nearly all commands follow a common pattern with 3 main parts. The program, the options, and the arguments. Let’s see an example.

$ ls -l ~

Introduction to the Mac OS X Command Line

Type the code above. Do not type the leading $. This is a common convention used is denote what follows is a command to be run. Once you have typed it out, hit enter to run it, and see what happens.

The program is the verb. It describes what you want to do. In our example ls is the program.  ls is short for list, meaning, I want to see a list of files somewhere on my computer.

Options are like the adverb. They usually modify the way the program will run. In our example -l is an option. It’s short for “long”. Without this option, the list will be simply the filenames. When we modify the command with -l, it will display to us the files along with more detailed information. Options are just that: Optional. Any command should have some default behavior when called without options. Each command has it’s own options. Most often the order of the options do not matter, but occasionally they may.

The arguments are what’s left. In our case the ~ .These are the objects of our sentence. They describe what we want our command to act on. In our example the ~ is a shorthand name for a special folder on your computer: your home folder. So we are saying we want to list all of our files in our home folder. Some programs may not need arguments. For instance, without arguments, ls will list the files in the directory you are currently in. More on that later. Again, each program has different arguments, and the order of the arguments typically matter.

Where Are You?

In the console, you are always working in a directory, or folder, on your computer. We call this your working directory. You can see where you are using pwd(short for print working directory)

$ pwd

Introduction to the Mac OS X Command Line

This command will print out your current location. You can change your directory with cd (short for change directory). If you pass it an argument, it will change your to that location, if it exists. Without an argument, it will take you to your home directory (~).

$ cd Documents

You’ll notice that I just passed it a directory named Documents, because I was in my home directory, that contains a directory called Documents. This is relative path, because I specified my destination relative to my current directory. I can provide an absolute path by providing the full path beginning with the /, or starting with my home directory (~) such as:

$ cd /Users/jim/Documents

or

$ cd ~/Documents

If you want to navigate “up”, that is to the directory that contains your current directory, you can use the special name ..which you can even use separated by slashes to navigate several levels up.

From my Documents directory, this command will take me up to my home directory.

$ cd ..

Get Some Help, man!

Even when you learn what commands you can use, there is still a lot of power in each command or program. There are often dozens of available options, and depending on your arguments, your command could behave in several different ways.

Fortunately, most commands have a manual. To read, use the man command. Pass the name of the command you want to learn about as it’s only argument. For instance to learn more about ls, run

$ man ls

Introduction to the Mac OS X Command Line

The manual can be scrolled with the arrow keys or space bar. Pressing q will quit.

Want to know more about man? Run man man

Some more commands.

There are a ton of different commands you can use, but only a couple dozen will get you pretty effective in the command line.

We learned about ls, pwd, cd, and man.

Try using the man command to learn about these commands

  • mkdir Make a new directory
  • touch Make a new empty file
  • cp Copy a file
  • mv Move a file
  • rm Remove a file or directory (learn about the -r option)
  • less Show the contents of a file in a scrolling buffer

 

 

 

linuxWeb development
作者Wang Yanbo
一键分享或复制链接
Wang Yanbo
Reviewer: Wang Yanbo

Founder of JR Academy

查看该作者的更多文章 →
← 上一篇IT技术移民如何高效凑分, 一位凑分者的自述下一篇 →澳洲IT招聘第93期|Full Stack Developer, Front-end Developer等高薪职位向你招手!

相关文章推荐

12月/December,高配导师手把手教你完整Web全栈(前端+后端)开发! 还有搭配实习可选!再也不怕毕业找不到工作了!

2018-11-27

Web开发入门Wordpress培训班,让你在上学的同时还能有兼职机会,获得了经验也赚足了学费。

2018-11-27

2018,匠人课程安排 | 从学业到就业

2018-11-26

IT零基础到就业入职:12月,IT匠人成就你的IT梦

2018-11-25

BNE活动 | WEB开发项目展示,现场Local嘉宾点评code,来看一看找到工作的code长啥样

2018-11-25

澳洲Offer加速器 -- 匠人实习计划开启:项目实习与岗位实习,让你获得宝贵的local经验

2018-11-23
查看全部文章 →
JR Academy
全球华人学习 AI 第一站
✓15000+ 学员
✓50+ 课程
✓AI 驱动学习平台
训练营免费资源AI学习职业辅导
精选推荐
AI 职业影响地图
测测你的职业风险等级,查看转型路径与学习方向
热门工具
AI & 数据训练营
系统化课程 + 真实项目实战,快速提升竞争力
热门课程
1v1 就业辅导
资深导师一对一指导,简历优化 + 面试准备
就业保障
企业内训定制
AI 技能培训方案,助力团队升级
企业服务
热门标签
Vibe CodingAI 编程CursorClaude求职攻略Prompt前端开发后端开发
订阅更新

获取最新 AI 学习资源、技术教程和求职攻略,直接送达邮箱。

我们尊重您的隐私,不会发送垃圾邮件