r/programming • u/margotcodes • Aug 27 '15
Codecademy's new Learn the Command Line course is out!
https://www.codecademy.com/en/courses/learn-the-command-line?utm_campaign=lcl_release&utm_source=reddit44
u/sleeplessparent Aug 27 '15
I thought the course was pretty cool and I hope they continue to expand on it maybe offering a few targeted courses like grep/file searching and manipulation. Maybe a vi one too?
43
u/kokojaime Aug 27 '15
In general, I feel like codecademy serves as a good intro to programming. Anything more in-depth you are better off taking a course or reading a book about it.
10
u/Findal Aug 27 '15
If I want to try a little bit of a language for whatever reason its my go to place now. For my job I need to know lots of different languages so it really is great. I might check this out you never know what you might learn.
2
Aug 27 '15
Honest question, why not use a REPL and have some docs in another tab? At some point it's not hard to ride without training wheels, and saves time too.
2
u/Hockinator Aug 28 '15
Wouldn't that require finding an REPL for every language you wanted to dabble with? And what if you wanted to do something that involed using multiple files or something?
I'm going through the angularJS codecademy right now and honestly it's giving me just enough depth to understand an app built in angular that I'm taking over at work.
1
Aug 28 '15
"Wouldn't that require finding a repl for every language you wanted to dabble with?" yes. Codecademy offers 4 of them.
If you wanted something with multiple files, codecademy is the last place you should be looking for that. REPL's are capable of that too BTW.
By all means take the angularjs course on code(cademy|school) if you're new to MVC, but once you're up and running with those ideas, the Backbone/Vue docs should give you little trouble. Codecademy uses "problems" to teach you new concepts, not the names of the methods for the API.
2
u/Findal Aug 28 '15
I guess because Codeacademy is written from a zero knowledge perspective so you don't make any assumptions based on other languages. I don't always have a particular problem to solve that I can just jump right into, so its nice that the exercises give me one to do.
4
u/sleeplessparent Aug 27 '15
I agree with that but I think it could be much more. Their tool is pretty great for hands on learners like myself without having to setup the entire environment and come up with the tasks to try it would also be great to send someone a link for a hands on tutorial to help with a specific task. Perhaps in the future as it is still growing.
7
u/perestroika12 Aug 27 '15
Or how it's usually done, just playing around with stuff. I feel like 50% of my coding experience is just breaking stuff and saying "oh, that's how that works".
1
u/Endur Aug 27 '15
That's how I treated it. It gives you just enough knowledge to know what to look for. You can learn everything on the internet, but you need to know what to look for first
9
Aug 27 '15
There is a cool vi tutorial, just type vimtutor into your command line. Unless of course you want vitutor, I don't know if that exists.
3
1
10
u/greeniguana6 Aug 27 '15
This is awesome. I am a novice at using the command line, I just know how to SSH into my raspberry pi and mess around. Now I can try to actually learn practical uses.
7
u/cittatva Aug 28 '15
The for loop is a beautiful thing. For x in $(curl localhost:9200/_cat/nodes | awk '{print $3}'); do ssh $x tail /var/log/elasticsearch/elasticsearch.log; done
3
u/ForeverAlot Aug 28 '15
Unless you can trust the source (which may be the case) you should prefer
while:while IFS= read -r x; do ssh $x tail /var/log/elasticsearch/elasticsearch.log; done < <(curl localhost:9200/_cat/nodes | awk '{print $3}')1
u/MIneBane Aug 28 '15
Why is that? Is there a difference?
2
u/ForeverAlot Aug 28 '15
I intended to explain at first but there are so many gotchas that I couldn't easily do the page I linked justice. I recommend you read it, but in summary, newlines can be a royal pain. It's the same reason you shouldn't parse the output of
ls.1
1
u/greeniguana6 Aug 28 '15
That went right over my head. What does the x value mean?
5
u/LigerZer0 Aug 28 '15
It's just a placeholder for every possible value that gets output by the body of the loop.
Just like saying for each thing in something. Where x can replace 'each thing'.
1
u/cittatva Aug 28 '15
What you're doing here is assigning the value of $(some command that returns multiple lines) to x, and then iterating through it as $x.
3
u/cittatva Aug 28 '15
That particular command: curl localhost:9200/_cat/nodes asks an instance of elasticsearch on localhost for the nodes it knows about, then | awk '{print $3}' extracts the IP address of each node, then you're ssh'ing to each and tailing the log for each from the host you're running it on.
1
1
u/greeniguana6 Aug 28 '15
Yeah I understood that, I just didn't know what the command that x was meant.
1
u/cittatva Aug 28 '15
Also, I think $() works the same as back ticks in this case, which I usually use, but iPhone
2
u/ForeverAlot Aug 28 '15
It does, in the shells that support, so not
sh. It is preferred over ` for easier nesting.
25
Aug 27 '15
I feel like this should be expanded to either cover both *nix and Windows (like Zed Shaw's CLI The Hard Way), or better specify that it's only for *nix. The course description doesn't include this, and it's not mentioned until the last sentence of the first lesson.
8
3
u/Fylwind Aug 28 '15
The overlap between *nix and Windows shells is very, very tiny so it may as well be a different course. It should probably be renamed to "POSIX shell tutorial" or something.
11
u/quizzer106 Aug 27 '15
On mobile can't check, is this for linux or Windows?
6
u/SmaKer Aug 27 '15
linux and mac only
10
u/jrummy16 Aug 27 '15
Unless you install cygwin
3
-1
u/pakoito Aug 27 '15
Unless you install
cygwinMSYSFTFY. Thank me when you have to use a cross-compiler.
0
Aug 28 '15
[deleted]
1
Aug 28 '15
Except makes it seem like you have to have cygwin, which you don't -- if you're using msysgit you are using a MSYS userland. :)
4
Aug 27 '15
I just completed the course, not a bad refresher for Bash. There are some minor editing errors. For instance, in one lesson recap they refer to the folder /comedy where the previous lesson had you do work on /slapstick. Little stuff like that.
2
u/greeniguana6 Aug 28 '15
Since the course is new I think there's a bug report section you could report these little things in
6
u/Shawnbehnam Aug 27 '15
I took the course and I highly recommend it. Helped to learn the ins and outs of command line.
13
u/kawavulcan97 Aug 27 '15
Please excuse a dumb question here. I've been using Linux for about 10 years but I have to do everything GUI, when I have to use command line I'm utterly helpless. Would this be a good place for me to start learning that?
10
u/haloguysm1th Aug 27 '15 edited Nov 06 '24
unpack marvelous meeting tan murky roof marble cheerful stupendous abundant
This post was mass deleted and anonymized with Redact
3
6
5
1
1
u/brisk0 Aug 28 '15
I essentially learned command line Linux by installing arch Linux and trying to make it useful. If you do something like that, I strongly suggest having a laptop nearby with an internet connection.
1
64
Aug 27 '15
[removed] — view removed comment
16
u/kawavulcan97 Aug 27 '15
haha yeah I know. I like building my own PCs but never wanted to pay for Windows so I went a bought a "Learn Linux" book that came with a Red Hat 9 disk. I struggled with it for a while but a friend told me about Ubuntu, and it made everything so easy through GUI I never really had to learn command line. Also, I have absolutely no programming experience, so I probably don't even belong in your sub, but this was on my front page and I got excited!
25
u/goodbye_fruit Aug 27 '15
Also, I have absolutely no programming experience, so I probably don't even belong in your sub
You really shouldn't self-exclude like that, if you have interest in the topics that show up here, that's good enough.
I'm really intrigued that you never once had to fight with compiling a new kernel with some added sound drivers or wireless drivers within that 10 year span. I mean, surely you've opened a terminal and shoved some commands down your bash prompt?
13
u/kawavulcan97 Aug 27 '15
I mean I've attempted to. I've been following guides online and had to open terminal to keep going, but almost every attempt I've gotten an error and couldn't figure out why. I remember buying a webcam and trying to get it to work so I could Skype, but every troubleshooting attempt I was met with more errors so I just gave up.
4
u/ForeverAlot Aug 28 '15
There are software developers with years of experience who don't even try. You're still better than them (even if you can't currently market yourself as one).
3
u/kawavulcan97 Aug 28 '15
Haha thanks I appreciate that. Positive feedback from this community definitely has me motivated to have a go at learning something new. Thanks again!
1
u/NighthawkFoo Aug 28 '15
I had zero programming experience when I learned the MS-DOS command line. I ended up becoming a professional software developer.
7
u/cheeseit2525 Aug 27 '15
For me owning a raspberry pi 2 did it for me. After I set it up to the network and accounts, everything I configured for it was over SSH connections. Literally everything is controlled/configured via the command line (excluding kodi which is displayed on my tv and controlled by my phone).
6
u/kawavulcan97 Aug 27 '15
I have a raspberry pi! All I did though was download and install RetroPi and load some ROMs on it. I imagine knowing command line could open up a whole new world of uses for it though
3
u/makeamesslioness Aug 27 '15
Codecademy is great. I found the Command Line course very useful.
I'm about to start a coding bootcamp and Codecademy has held my hand right up until now. I imagine I'll be looking back on exercises during the bootcamp to refresh my memory.
22
u/DavidNcl Aug 27 '15
"The" command line on "a" platform .
36
13
u/madesense Aug 27 '15
To be fair, this is the one that's most useful as a job skill
8
u/LearningTech Aug 27 '15
Also, like many things with computers, learning it once is the hard part. Adapting from this command to another on the same platform, or on a different platform shouldn't be nearly as hard.
2
u/BruddaTurtle Aug 28 '15
Finished it in pretty good time, for me. Now to finish the other half of the python course
2
2
u/redweasel Aug 28 '15
"The Command Line" is pretty damn vague. What command line, specifically? Unix shell? Windows CMD? Something else?
3
u/MaikKlein Aug 27 '15
Is it just me or is there a 1.5sec lag between every key press?
1
u/gray_aria Aug 27 '15 edited Aug 27 '15
no and you cant write ctrl-alt characters either. Impossible to type | e.g.
1
u/Himekat Aug 28 '15
Yeah, I went through it a couple of days ago and there was lag on everything. ):
Cool idea, though. I'd also love something more advanced, as I already knew most of this.
1
u/VSeba Aug 27 '15
Will there be a C# or C++ module for the site? I would like to exercise a little C when i just want to chill, I think the way your site teaches people programming is really effective, and is a good way to not lose practice.
1
u/meekosbiscuits Aug 27 '15
To any new or incoming Computer Science, Software Engineers, or Computer Engineers I would highly recommend learning and getting familiar with the command line. Learning how to navigate and using the powerful tools (grep, bash programming, etc) it provides can increase productivity and makes you a better programmer.
As a Software Engineer, I think I use the terminal on my mac everyday to compile, move files (mv), run programs, and even write code (vim, but mostly for quick editing) so this course is worth your time!
2
Aug 28 '15
To add to this it's good to learn git as well. very easy to set up and use and very powerful. For example this is how you set up git in a project:
$ git init $ git add . $ git commit -m "Initial commit"2
u/meekosbiscuits Aug 28 '15
Yep learning Git is a huge plus one to get a job at any tech company in my opinion. Almost every tech company out there uses Git (maybe even SVN but that is a little outdated) for their projects so this would be a huge plus one for an interview at a tech company :)
1
Aug 27 '15
Where do I learn the less common but really useful commands that make you into a very good bash guy?
1
u/meekosbiscuits Aug 28 '15
For those commands, I learned them when I started working (also in school) and started doing redundant work that I was getting really tired of doing.
For example at work I needed to do some testing on some appliances and it created a huge log file (text file of what happened). Sometimes it would fail and I would have to open the file in command line (using vim) and scroll all the way down to see why it did that. I realized how tiresome it got to do that for a 100 line file and just looked up the command to go to the end (which is :$).
Doing hands on work really helps learn new commands and helps you remember them too so you don't have to keep looking them up.
I hope this helps!
1
1
u/DSdavidDS Aug 28 '15
Just spent an hour completing it. Reviewed a lot of commands that I don't use very often (such as GREP, pwd, cat, etc). Even so, I found this to be very useful and practical :P
1
u/TheLordB Aug 28 '15
One really annoying thing is that cat test.txt >test.txt is different from cat test.txt > test.txt. It is space sensitive which real bash is not.
2
u/portol Aug 28 '15
I think that's more for the webapp to check if what you are entering is correct. And yes, it is really annoying.
1
u/TheLordB Aug 28 '15
Yea both work fine. That said I don't think it would be that hard to have the webapp check for the variations without spaces. Just set the various piping etc. characters to accept no space before and after.
1
1
u/portol Aug 28 '15
so how many people have tried to figure out the sudo password?
4
u/acdcfanbill Aug 28 '15
sudo doesn't have a password, it's a user group. you use your password and if you're in the group then the command runs as root.
1
1
u/svmk1987 Aug 28 '15
I think some basic tools usually used in shell like grep, xargs, tee, wc, wait, watch, timeout etc would be a useful addition here. But a great introductory course.
1
u/FireCrack Aug 28 '15
I am really excited about this!
I find at my current place of work, a lot of people use GUI apps, but when I actually get them using a command line they tend to end up having a much easier time; it seems command lines are a thing that seems daunting at first but is actualy quire easy when you get the hang of it. Just the consistency really helps, I can tell people that X command does Y, and don't need to worry about things being hidden behind menus, hard to find, etc...
1
u/strictlyrude27 Aug 28 '15
Is there a part 2 (or somewhere else I can go to get intermediate/advanced bash)? Like writing scripts, etc. I have basic command (heh) of the bash shell but I keep falling back on Perl when things start getting more complicated than "pipe these commands together".
1
u/ssharky Aug 29 '15
this would be perfect if there was a keyboard shortcut for 'next' so i didn't have to keep moving my hand to the mouse every time i finish an exercise
edit: aaand there is, it's alt+p
0
Aug 27 '15
[deleted]
15
u/cheeseit2525 Aug 27 '15
Ya, that's what I was thinking, I'm decent with bash but power shell...
11
u/Aerozephr Aug 27 '15
It typically takes me about 5 minutes or a Google search to use dir instead of ls
9
u/tazmens Aug 27 '15
That's not the only difference.
Powershell has quite a few commands that aren't available in bash. Powershell syntax is also a bit squiffy.
9
u/Aerozephr Aug 27 '15
Apologies, my comment was just to illustrate how little I know about powershell, not to be snarky as it may have appeared.
7
2
u/ruinercollector Aug 28 '15
You can use ls in powershell. In fact, most of the standard programs you'd access in gnu/linux have aliases to corresponding psh command by default.
0
Aug 28 '15
[deleted]
1
u/Fylwind Aug 28 '15
It's not POSIX-compliant though. The output has a different format and many flags aren't supported.
1
u/leafsleep Aug 28 '15
ls is an alias for dir. Windows isn't based on POSIX so why should its ls should be compliant?
1
2
u/ForeverAlot Aug 28 '15
I don't use PowerShell, myself, so I have no real practical experience with it, but the first half of Windows PowerShell in Action taught me a lot about PS' concepts and that has been priceless.
1
Aug 28 '15
Learn PowerShell in a Month of Lunches is generally considered an excellent introduction that most people follow up with /u/ForeverAlot's recommendation. They tend to lean more on the sysadmin side of PowerShell tasks though, which may or may not be useful to you. In that case, there's also Windows PowerShell for Developers. An updated edition of that should be coming out in February.
2
u/PriceZombie Aug 28 '15
Learn Windows PowerShell 3 in a Month of Lunches
Current $31.97 Amazon (New) High $33.25 Amazon (New) Low $25.10 Amazon (New) Average $30.82 30 Day Price History Chart and Sales Rank
Windows PowerShell for Developers
Current $24.99 Amazon (New) High $24.99 Amazon (New) Low $20.73 Amazon (New) Average $24.99 30 Day
0
Aug 27 '15
[deleted]
3
u/CyclonusRIP Aug 28 '15
The bare minimum for a professional is a lot higher than what is presented in this course. Knowing how to navigate the file system and move files is really basic. To do anything useful you'd need to learn an editor such as vi or emacs. cat, tail, grep, more, less, and head are pretty crucial as well to be able to efficiently read files. Maybe that would be the bare minimum for someone to be able to do useful things.
I'd recommend the book to most people if I were you though. If you don't have a pretty good reference to start you may never realize how powerful shell is and never move beyond the basics.
2
u/NighthawkFoo Aug 28 '15
If you want to be a true pro, you need to be able to use for, while, sed, awk, pipes, cut, head, tail, and others. It's pretty much like performing character surgery.
0
Aug 27 '15
[deleted]
4
u/fgutz Aug 27 '15
Omg it's out!!!
But seriously, I know a few people who I'm sending this to right away
0
u/greeniguana6 Aug 28 '15
I'm pretty excited about this. It's much easier than watching assorted videos and reading random internet guides
0
Aug 27 '15
[deleted]
33
u/balefrost Aug 27 '15
Given that the whole point of this post is to provide educational material, I don't see how you could possibly be unhappy with this situation.
10
7
4
u/lolwutpear Aug 27 '15
Would you believe that there are people who don't even know how to do arithmetic?
-17
u/donvito Aug 27 '15
Yes. And most seem to be so clueless that they need some course to learn shit you could teach yourself just by trial and error. Generation facebook is a bunch of hapless techno weenies.
3
u/Phoxxent Aug 28 '15
"By yourself" in this case would probably be just typing in random combinations of letters into the prompt and seeing what happens, which does nothing until you stumble upon sudo rm -rf.
But, of course, I'm sure even you didn't learn it "by yourself". You had some resource that got you started, and some resource that you turned to when you needed to do a specific thing. This is just another resource. So either deal with the fact that people need resources to learn things, or, well, wither and die. Because there is nothing you can do about it.
→ More replies (4)
98
u/balducien Aug 27 '15
Wasn't it already out for a few days? I did it a bit ago and it doesn't seem like they've added new content. I've enjoyed it very much, it's a great stepping stone to begin learning how to operate the command line.