没有合适的资源?快使用搜索试试~ 我知道了~
The Command Line Crash Course--- PowerShell速成教程
5星 · 超过95%的资源 需积分: 10 23 下载量 147 浏览量
2014-06-06
13:50:05
上传
评论 2
收藏 384KB PDF 举报
温馨提示
试读
71页
The Command Line Crash Course--- PowerShell速成教程,国外网站上收集整理,方便阅读
资源推荐
资源详情
资源评论
The Command Line Crash Course
Table Of Contents
Preface
Introduction: Shut Up And Shell
The Setup
Paths, Folders, Directories (pwd)
What's Your Computer's Name? (hostname)
Make A Directory (mkdir)
Change Directory (cd)
List Directory (ls)
Remove Directory (rmdir)
Moving Around (pushd, popd)
Making Empty Files (Touch, New-Item)
Copy A File (cp)
Moving A File (mv)
View A File (less, MORE)
Stream A File (cat)
Removing A File (rm)
Pipes And Redirection
Wildcard Matching
Finding Files (find, DIR -R)
Looking Inside Files (grep, select-string)
Getting Command Help (man, HELP)
Finding Help (apropos, HELP)
What's In Your Environment (env, echo, Env:)
Changing Environment Variables (export, Env:)
Exiting Your Terminal (exit)
Next Steps
Frequently Asked Questions
How long does this course take?
About 1 or 2 days depending on how much time you put in.
What kind of computer do I need?
Either a Windows computer with PowerShell, a Mac OSX computer, or a Linux computer.
Preface
I wrote this book really quickly as a way to bootstrap students for my other books. Many students don't
know how to use the basics of the command line interface, and it was getting in the way of their learning.
This book is designed to be something they can complete in about a day to a week and then get enough skill
at the command line to graduate to other books.
This book isn't a book about master wizardry system administration. It's just a quick introduction to get
newbies going.
Introduction: Shut Up And Shell
This book is a crash course in using the command line to make your computer perform tasks. As a
crash course, it's not as detailed or extensive as my other books. It is simply designed to get you
barely capable enough to start using your computer like a real programmer does. When you're
done with this book, you will be able to give most of the basic commands that every shell user
touches every day. You'll understand the basics of directories and a few other concepts.
The only piece of advice I am going to give you is this:
Shut up and type all of this in.
Sorry to be mean, but that's what you have to do. If you have an irrational fear of the command
line, the only way to conquer an irrational fear is to just shut up and fight through it.
You are not going to destroy your computer. You are not going to be thrown into some jail at the
bottom of Microsoft's Redmond campus. Your friends won't laugh at you for being a nerd. Simply
ignore any stupid weird reasons you have for fearing the command line.
Why? Because if you want to learn to code, then you must learn this. Programming languages are
advanced ways to control your computer with language. The command line is the baby little
brother of programming languages. Learning the command line teaches you to control the
computer using language. Once you get past that, you can then move on to writing code and
feeling like you actually own the hunk of metal you just bought.
How To Use This Book
The best way to use this book is to do the following:
Get yourself a small paper notebook and a pen.
Start at the beginning of the book and do each exercise exactly as you're told.
When you read something that doesn't make sense or that you don't understand,
write it
down in your notebook
. Leave a little space so you can write an answer.
After you finish an exercise, go back through your notebook and review the questions you
have. Try to answer them by searching online and asking friends who might know the answer.
Email me at help@learncodethehardway.org and I'll help you too.
Just keep going through this process of doing an exercise, writing down questions you have, then
going back through and answering the questions you can. By the time you're done, you'll actually
know a lot more than you think about using the command line.
You Will Be Memorizing Things
I'm warning you ahead of time that I'm going to make you memorize things right away. This is the
quickest way to get you capable at something, but for some people memorization is painful. Just
fight through it and do it anyway. Memorization is an important skill in learning things, so you
should get over your fear of it.
Here's how you memorize things:
Tell yourself you
will
do it. Don't try to find tricks or easy ways out of it, just sit down and
do it.
Write what you want to memorize on some index cards. Put one half of what you need to
learn on one side, then another half on the other side.
Every day for about 15-30 minutes, drill yourself on the index cards, trying to recall each
one. Put any cards you don't get right into a different pile, just drill those cards until you get
bored, then try the whole deck and see if you improve.
Before you go to bed, drill just the cards you got wrong for about 5 minutes, then go to
sleep.
There's other techniques, like you can write what you need to learn on a sheet of paper, laminate it,
then stick it to the wall of your shower. While you're bathing drill the knowledge without looking,
and when you get stuck glance at it to refresh your memory.
If you do this every day, you should be able to memorize most things I tell you to memorize in
about a week to a month. Once you do, nearly everything else becomes easier and intuitive, which
is the purpose of memorization. It's not to teach you abstract concepts, but rather to ingrain the
basics so that they are intuitive and you don't have to think about them. Once you've memorized
these basics they stop being speed bumps preventing you from learning more advanced abstract
concepts.
License
I (Zed A. Shaw) own the copyright on this book. You are free to give it to anyone you want, as long
as you don't modify it and you don't make any money from the distribution of the book.
Thanks
Thanks to Lauren Buchsbaum for editing this book and providing me with feedback. Also thanks to
the many students who read the book and provided feedback.
The Setup
In this book you will be instructed to do three things:
Do some things in your shell (command line, Terminal, PowerShell).
Learn about what you just did.
Do more on your own.
For this first exercise you'll be expected to get your Terminal open and working so that you can do
the rest of the book.
Do This
Get your terminal, shell, PowerShell working so you can access it quickly and know that it works.
Mac OSX
For Mac OSX you'll need to do this:
Hold down COMMAND and hit the spacebar.
In the top right the blue "search bar" will pop up.
Type: terminal
Click on the Terminal application that looks kind of like a black box.
This will open Terminal.
You can now go to your Dock and CTRL-click to pull up the menu, then
select Options->Keep In Dock.
Now you have your Terminal open and it's in your Dock so you can get to it.
Linux
I'm assuming that if you have Linux then you already know how to get at your terminal. Look
through the menu for your window manager for anything named "Shell" or "Terminal".
Windows
On Windows we're going to use PowerShell. People used to work with a program called cmd.exe,
but it's not nearly as usable as PowerShell. If you have Windows 7 or later, do this:
Click Start.
In "Search programs and files" type: powershell
Hit Enter.
If you don't have Windows 7, you should
seriously
consider upgrading. If you still insist on not
upgrading then you can try installing
ithttp://www.microsoft.com/en-us/download/details.aspx?id=7217 . You are on your own, though,
since I don't have Windows XP, but hopefully the PowerShell experience is the same.
You Learned This
You learned how to get your terminal open so you can do the rest of this book.
Note
If you have that really smart friend who already knows Linux, ignore them when they tell you to use
something other than bash. I'm teaching you bash. That's it. They will claim that zsh will give you
30 more IQ points and win you millions in the stock market. Ignore them. Your goal is to get
capable enough and at this level it doesn't matter which shell you use.
The next warning is stay off IRC or other places where "hackers" hang out. They think it's funny to
hand you commands that can destroy your computer. The command rm -rf / is a classic that
you
must never type
. Just avoid them. If you need help, make sure you get it from someone you
trust and not from random idiots on the internet.
Do More
This exercise has a large "do more" part. The other exercises are not as involved as this one, but I'm
having you prime your brain for the rest of the book by doing some memorization. Just trust me,
this will make things silky smooth later on.
Windows
If you're using Windows then here's your list of commands:
pwd
剩余70页未读,继续阅读
资源评论
- wenbocat0072014-10-25和网页上内容一致,是从网页版拷贝的。
- nimahaoren2015-03-16和网页的一样。
- tudidatiancai2014-12-30神作,适合我等小白
- 半美人2019-07-24值得,是文字版的pdf
yongjiang22
- 粉丝: 1
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功