8 ms·
An Introduction to Unix (2014)
- Numberwang 12y agoCan people who have the relevant knowledge give their input on how good of a starting-point this is?
- dredmorbius 12y agoNot bad as these things go.
- zatkin 12y agoYou really should blend your intake from various sources. As someone who has worked with UNIX for a few years, I'll read through this site and probably end up learning something new. That's my experience with UNIX is that it's a constant learning process that goes on for many years.
- pjmlp 12y ago> That's my experience with UNIX is that it's a constant learning process that goes on for many years. Well, that is to be expected given the fragmentation in the UNIX world. One never knows how the specific UNIX is going to behave, which command line arguments are available besides the common ones and what sort of POSIX undefined behavior exist.
- SpaceInvader 12y agoIt's not bad, but consider it rather an linux guide, not unix.
- StudyAnimal 12y agoDid you read it? Their example Unix was OS X.
- McUsr 12y agoIt seems like a well written tutorial, not to worded, not to terse, and should be a good introduction, that gives a broad overview of Unix. -And not Unix on OsX, which saddens me, all the time the author has made it on a Mac. C'mon, just a short piece on the open command, please…. :)
- tambourine_man 12y agoSeems ok at a glance. If you want a classic though, check out Unix Power Tools at O'Reilly
- a3n 12y agoI have the hard copy and ebook, and it's great. I've been using some type of ∗nix OS since the late eighties, and I will never learn the whole thing. Unix Power Tools is one of the few door-stop sized books that are worth having. A few of the items are somewhat dated, but ∗nix today, at least what's covered in UPT, is mostly what ∗nix has always been. EDIT: changed ascii asterisk in front of all instances of nix to u+2217, the plain asterisk translates to large bodies of italicized text on HN. Which I knew.
- vram22 12y ago>If you want a classic though, check out Unix Power Tools at O'Reilly Yes, that's very good. If I was to compare it with my recommendation in this thread, of The UNIX Programming Environment (UPE), I'd say that the Power Tools book is like a cookbook, while the UPE book is like a tutorial (but a power tutorial :)
- vram22 12y agoHaven't read this fully, so not commenting on it (apart from my other comments in this thread), but can recommend this: 1. Get and read The UNIX Programming Environment by Kernighan and Pike. https://www.google.co.in/search?q=the+unix+programming+environment https://www.google.co.in/search?q=the+unix+programming+envir... A classic. Outdated [1] some, for modern Linuxes and BSDs, so: 2. Supplement it by reading Linux / BSD man pages and get a book or two on one of those OSes, or other Unix variant you are using, such as Mac OS X. [1] But you are unlikely to find another book that better conveys the Zen of UNIX, so to speak. The authors were early UNIX users and developers, and Rob Pike (now at Google) is one of the creators of the Go language.
- cogburnd02 12y ago"by Kernighan and Pike." [1] http://www.ugu.com/unixcards/Brian_Kernighan.jpg http://www.ugu.com/unixcards/Brian_Kernighan.jpg [2] http://www.ugu.com/unixcards/Rob_Pike.jpg http://www.ugu.com/unixcards/Rob_Pike.jpg
- vram22 12y agoThat's cool. I haven't visited UGU (UNIX Guru Universe) for quite a while. Great site it was back then. Will check it again.
- mturmon 12y agoUnix user for 30 years. I took a glance over it, and it seems pretty good, esp. as a starting point. Some people in the thread here are griping about some details (like terminology) but that's not what you care about most when learning. You will evolve your own style of command line usage from what you read and what you are able to remember. Even very skilled people will do things differently.
- majika 12y agoFor some reason, the author disallows people from viewing pages on his site without running scripts from his domain and from jquery.com. You can get around this by opening up your web inspector, and disabling the `hidden: true` rule on the top `container` element. Nothing on the page (or in related linked pages on his site) seems to require JavaScript.
- icantthinkofone 12y agoThe modern web is scriptable and the days of "no javascript" are over. If you turn off javascript, you are one of less than 2% of the web that does so but you know what you did and the consequences so you also know how to fix the problem.
- simi_ 12y agoMost of the stuff I read online can very well be plain markdown files. Most of the stuff I _do_ however can't work without JS. The fact that we're so reliant on JS indicates that the "modern" web stack is in dire need of a complete rethink. PS: Only slightly related, but I'm currently working on a SMTP replacement that focuses on speed, privacy, and ease of use. I believe that if more people would do this, at some point some new technologies will stick and we'd get rid of the (bad) 80s-90s stuff.
- inclemnet 12y ago> The modern web is scriptable and the days of "no javascript" are over. But why should we accept this? Why does it justify pages like this one, that don't need javascript but deliberately fail if you don't enable it?
- icantthinkofone 12y agoBecause the marketing guys want it and to write for fallbacks takes time. While this instance is not about marketing, my point is that turning javascript off makes you one of the few and I would have to determine if that 2% is worth the effort. Some companies won't target your browser if you have less than 5% market share. Even 10% market share. So imagine when I find out you are less than 2% market share (no js users). For my web dev company, we have about 10 clients. None of the visitors have ever had javascript turned off that I'm aware of over the last several years.
- deleted 12y ago[deleted]
- zokier 12y agoI just began reading this, and I don't like it that much. The random attacks against GUI seem unnecessary and distracting. But worse than that there seems to be quite a few factual errors, like: "Under the hood Windows, unlike Mac OS, is DOS- rather than unix-based" Last DOS based Windows was released like 15 years ago. At that time Macs had their own weird OS too. "A general point about unix commands: they're often robust." Unix commands, robust? You gotta be kidding me, they are great for quick ad-hoc hacks, but robust they are not. Just as an example here is how the common task of handling can fail: http://www.dwheeler.com/essays/filenames-in-shell.html http://www.dwheeler.com/essays/filenames-in-shell.html "For example, with ls you can use an arbitrary number of arguments and it obeys the regular expression (more about these later) convention that an asterisk matches anything" How this is an example of robustness? Besides globbing is not regular expressions. In regexp you'd use .* to match anything, not a bare * > However, a file in Microsoft Word's proprietary and unknown formatting is utterly unusable. While I'm no fan of Word, it is very much arguable that Word file format not anymore proprietary or unknown. > I used to use Smultron until I found, unforgivably, that the spacing of documents when you looked at them in the editor and on the terminal was different. Let me guess, tab width difference? Yeah, that is how tabs work and not really a fault in the editor.
- cssmoo 12y agoGreat points about robustness. For the first time ever I had to deal with xargs and find together last week. Bear in mind I've been using Unix for about 20 years now. Telling one command to null delimit stuff and another to parse the nulls is horrible. Especially seeing as this only came about because one directory happened to have a lot of files in it and the 11 year old script just went snap. I'm perhaps lucky I've never encountered this. The author needs to take a look at powershell. Surprisingly I wrote a job site scraper in it in about 10 lines of code. Html parsing, data access etc are right there at your finger tips. That and it'll quite happily move 23TiB/1780000 files in a single incantation without wincing once. Colour me impressed (as an old Unix die hard)
- tomsthumb 12y ago> For the first time ever I had to deal with xargs and find together last week. Bear in mind I've been using Unix for about 20 years now. I'm really curious about this. Do you have a very specific workflow that gets around that need or an alternative that would replace find + xargs? Is your job pretty niche? It just seems like I _need_ it a few times a week minimum, and I'm not really sure what would replace it off the top of my head. I do agree on powershell being quite slick. Sometimes finding what I want is a process, but so was unix in the beginning.
- hf 12y agoThe author tells me to 'Please enable Javascript!' I counter: 'Please enable HTML!' In all seriousness, it's text, images, links. There are no user accounts, no dynamically updated database of 'favourited' sections, no per-paragraph instant chat, the page is remarkably atrocity-free! Hence, this page seems very much un-Unix-y: Solve problems at the lowest level of complexity, what?
- asdfrob 12y agojust remove div#container visibility:hidden and it works. Why does it require JS when there's no need for it at all?
- lpeters 12y agoIt is obvious a lot of attention was put into creating this document. I particularly enjoyed the sections on awk and sed. I have seen many others attempt to explain these tools using many more words and circulate much more ambiguity. Bravo!
- nisa 12y agoI personally prefer https://nixsrv.com/llthw https://nixsrv.com/llthw - it's concise and the focus is on more on important details... I also enjoy the attitude and explanations on this site. It forces you to learn to learn and explore on your own - which is essential to learn Linux/Unix.
- mlangdon 12y agoFor those stuck with windows for some reason, note that Cygwin[1] is a not too painful way to get that *nix feeling. Note that things get a little weird if you start, e.g., running python from Cygwin. [1] http://www.cygwin.com http://www.cygwin.com
- a3n 12y agoHow does it get weird with python? I do this day in, day out. I installed cygwin's python. When I'm in cygwin that's the python that runs, and when I'm in Windows it's my Windows python that runs. Virtually all the scripts I write run without problems in either environment, because it's python. Scripts that other people wrote for Windows run fine in cygwin. There are occasions where I have to account for differences in the OS, but mostly never.
- kasabali 12y agoI'll give an anectode from just last night. I wanted to fetch some online video, so I went ahead and downloaded youtube-dl-*.tar.gz, extracted it, and then tried to run it, all inside a cygwin session. For some reason, it did nothing. I ran file on the script and it claimed it was a data file. I run less on it and damn, it's a binary file. I was definitely surprised but didn't want to waste more time on it after fiddling for 10 minutes, I run the native Windows Python on the exact same file and it just worked. I didn't look back so I don't know what was the main reason but I can say there are some problems.
- a3n 12y ago2424 pip install youtube-dl 2425 which youtube-dl 2426 youtube-dl --help 2427 youtube-dl https://www.youtube.com/watch?v=WS-JcaPFzp4 [youtube] WS-JcaPFzp4: Downloading webpage [youtube] WS-JcaPFzp4: Extracting video information [youtube] WS-JcaPFzp4: Downloading DASH manifest [download] Destination: The Renaissance and the cuckoo clock-WS-JcaPFzp4.mp4 [download] 100% of 7.98MiB in 00:02 2428 python --version 2429 which python 2430 history |tail This worked fine for me. It installed, help was available, I downloaded the video and watched it. I suspect one of two things, although it could be something else. You might be using the windows installation of python, rather than the cygwin installation. In most cases that works fine, but cygwin's python is compiled to expect a cygwin/unix-like environment, and windows python is compiled to expect windows. Sometimes weirdness ensues, and it's better to use cygwin's python in cygwin. My other suspicion is that the installation of youtube-dl didn't happen correctly. Notice above that I used pip, which is offered in the installation instructions. If you've installed pip that's usually your best/first option. Their first instructions involve downloading the gz (as you did). I did that with wget in python, then noticed the installation is an extraction and a chmod; I'm usually more comfortable trying pip in that circmstance. I've placed my email in my profile if you want to chat about this. I'll leave it there until I remember to remove it. Edit: you can run the python shell, and it will summarize python's construction: $ python Python 2.7.8 (default, Jul 28 2014, 01:34:03) [GCC 4.8.3] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> From a windows cmd.exe shell: python Python 2.7.6 |Anaconda 2.1.0 (64-bit)| (default, Nov 11 2013, 10:49:15) [MSC v.1500 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>>
- danso 12y agoIt's funny to come across this just now...for the past quarter, I've been teaching a basic programming class that focuses on the command-line...the most complicated thing we cover is sed (here's a list of tools we use: http://www.compciv.org/unix-tools/ http://www.compciv.org/unix-tools/) and the homework I've assigned generally involves scraping and data-munging, such as writing a batch job to scrape the USAJobs.gov API (http://www.compciv.org/curriculum/ http://www.compciv.org/curriculum/)... I agree with the OP that conceptually, the command-line is the best place to start learning programming...the idea that a tool should be kept simple, but that it should be easy to connect things together, and that it's up to the human operator, not the computer, to do this work...this is very powerful, and something I wish I had learned early on as a programmer. The way that Unix tries to think of everything as text is also a powerful concept, because for most beginners, they think of file formats as being "magical" and immutable, they don't have the concept that at the core of it, everything is just binary (everything being "just text" is a nice middelground from OS magic and trying to read binary) However, the beauty of this philosophy is hard for non-programmers to appreciate or take advantage of. Moreover, things that I love as a programmer, such as silence-by-default and sparse error messages...are massive stumbling blocks for beginners. While I've done enough programming to appreciate silence, it's another thing to be a beginner who has never edited code in a text-editor to deal with "silence"...perhaps the biggest obstacle is the high difficulty in debugging. I can generally pinpoint any error in seconds...but this is only after years of general programming. The way that Bash continues on when an undeclared variable is referenced (via a typo) has led to hours of frustration for my students. I think next year when I teach the class, if I do Unix again, I'm going to commit the first two weeks to muscle memory and flashcard-like memorization...it's too difficult to get the higher-level concepts of programming while you're stumbling around with recognizing variables. On the other hand, I think I may not try to teach Unix again, and will just stick to Python. One of my goals of teaching Unix was to avoid complexity and especially, things like OOP...I think Python can be carefully taught to fit that route...though I'll miss the ability in Bash to do such real-world tasks as curl, parse, and analyze a webpage in just two lines. Edit: There was also a practical reason for doing things in Unix...all my students have different kind of laptops and OSes...and Stanford's shared computing runs on Ubuntu. So they did all their assignments on the shared computing cluster. That led to another issue of not being able to easily edit script files, in the way that you can do with Sublime Text on your own OS.
- phren0logy 12y agoTaking a glance at this, it seems very unlikley to unseat my favorite intro book: http://linuxcommand.org/tlcl.php http://linuxcommand.org/tlcl.php I consistently recommend The Linux Command Line by William Schotts. It's available in print through New Starch, or on the web. It's very clearly written, and practical.
- vram22 12y agoYes, that book is good. I had reviewed it for O'Reilly, a while ago, here: http://shop.oreilly.com/product/9781593273897.do http://shop.oreilly.com/product/9781593273897.do 2nd review from the top (currently), reviewer id is vasudevram.
- platz 12y agohttp://blog.sanctum.geek.nz/ http://blog.sanctum.geek.nz/ has some of the clearest yet most nuanced Unix tutorials I've ever seen
- vram22 12y agoError here: >(2) it's the most natural port of entry into all other programming languages; Unix is not a language, but an OS.
- morenoh149 12y agoVery related. I was about to write a js to shell script compiler when I came across https://github.com/BYVoid/Batsh https://github.com/BYVoid/Batsh it takes C/java-style code and spits out a bash script. The shell script will run on windows osx and *nix.
- vram22 12y agoRelated: for people who want to write their own Unix commands [1], not just use them :) -- an article I wrote for IBM developerWorks: http://jugad2.blogspot.in/2014/09/my-ibm-developerworks-article.html http://jugad2.blogspot.in/2014/09/my-ibm-developerworks-arti... And this post shows a practical use of that utility: Print selected text pages to PDF with Python, selpg and xtopdf on Linux: http://jugad2.blogspot.in/2014/10/print-selected-text-pages-to-pdf-with.html http://jugad2.blogspot.in/2014/10/print-selected-text-pages-... [1] In C, but the guidelines shown are also applicable to writing Unix commands in other languages like Python and Ruby.