TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Getting better at Linux with mini-projects

1009 点作者 carltheperson超过 4 年前

38 条评论

geocrasher超过 4 年前
According to a post in the comments, the author is 18 years old which means that I&#x27;ve been using Linux longer than the author has been making use of the blood in his veins. But that does not mean that I didn&#x27;t learn something from his post!<p>While the technical accomplishments and understanding are commendable, I think that the main takeaway for me is the excellent approach to learning. Keeping it simple and taking an open-minded approach to learning (as exemplified by his attitude toward systemd) is an approach that more people could stand to take. So often we complicate things in our heads to the point where they seem unknowable and so we assume that they are too difficult and we don&#x27;t try. I have seen this in myself at times and I see it others as well.<p>I&#x27;ll be sharing this post at work so that the people who I work with who don&#x27;t really understand Linux so well can appreciate the approach that was taken and hopefully also glean something from the excellent write-up itself.
评论 #26008385 未加载
评论 #26004003 未加载
评论 #26003969 未加载
评论 #26003848 未加载
评论 #26005508 未加载
评论 #26008564 未加载
评论 #26008349 未加载
评论 #26011670 未加载
dakna超过 4 年前
&gt; The first thing I did was to read the entire Wikipedia page on UNIX. I also read this original paper written by Dennis Ritchie and Ken Thompson from 1974<p>We need more people like you. Kudos for having the attention span to do this. Enjoy your HN top spot, well deserved.
评论 #26004081 未加载
评论 #26004474 未加载
评论 #26006184 未加载
uyt超过 4 年前
Projects like these is exactly what university use for teaching too! You&#x27;re way ahead of the curve.<p>For example CMU also makes you write your own shell. The main focus is implementing job control like: jobs, fg, bg, and various signal handlers in order to understand how forking child processes work.<p>I see that your shell doesn&#x27;t handle much other than cd so this might be a nice next step if you want to continue working on it. (I can&#x27;t find a good public link for it but you can probably follow along using: <a href="http:&#x2F;&#x2F;www.cs.cmu.edu&#x2F;afs&#x2F;cs&#x2F;academic&#x2F;class&#x2F;15213-s02&#x2F;www&#x2F;applications&#x2F;labs&#x2F;lab5&#x2F;shlab.html#SPECIFICATIONS" rel="nofollow">http:&#x2F;&#x2F;www.cs.cmu.edu&#x2F;afs&#x2F;cs&#x2F;academic&#x2F;class&#x2F;15213-s02&#x2F;www&#x2F;ap...</a>)
评论 #26004342 未加载
mqus超过 4 年前
Another more Linuxy-Thing to try: build a pam (authentication&#x2F;authorization&#x2F;etc) module to embed your own secret or come up with a fun&#x2F;unique way to enter your password (e.g. you can not login unless you plugged your headphones in, etc :) )<p>This makes you very aware of the way login works in linux and teaches you how to compile your library as a shared object conforming to an interface. Of course, you should be aware that you just baked your own security mechanism, so use it that way and better avoid using it for anything sensitive :)
评论 #26010417 未加载
freedomben超过 4 年前
Kind of a shameless plug, but you mentioned wanting to get better at Awk. I had that same desire and created a small course based on what I learned. The course got great feedback. I&#x27;ve gotten a lot of nice emails from people thanking me for making Awk understandable to them for the first time. I love getting those kinds of messages!<p>There is a video presentation, and a set of &quot;challenges&quot; you can use to incrementally get more complex with awk, starting from super simple.<p>The challenges repo is on github here: <a href="https:&#x2F;&#x2F;github.com&#x2F;FreedomBen&#x2F;awk-hack-the-planet" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;FreedomBen&#x2F;awk-hack-the-planet</a><p>If you want to watch the videos, there are links in the github repo but for convenience:<p>Presentation video: <a href="https:&#x2F;&#x2F;youtu.be&#x2F;43BNFcOdBlY" rel="nofollow">https:&#x2F;&#x2F;youtu.be&#x2F;43BNFcOdBlY</a><p>My solutions to exercises video: <a href="https:&#x2F;&#x2F;youtu.be&#x2F;4UGLsRYDfo8" rel="nofollow">https:&#x2F;&#x2F;youtu.be&#x2F;4UGLsRYDfo8</a>
评论 #26007545 未加载
tyingq超过 4 年前
<i>&quot;Since this is just a reverse version of cat, I called the program recat.&quot;</i><p>Curious if you compared the end result with &quot;tac&quot;.<p>Source: <a href="https:&#x2F;&#x2F;github.com&#x2F;coreutils&#x2F;coreutils&#x2F;blob&#x2F;master&#x2F;src&#x2F;tac.c" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;coreutils&#x2F;coreutils&#x2F;blob&#x2F;master&#x2F;src&#x2F;tac.c</a><p>Walkthrough of how it works: <a href="http:&#x2F;&#x2F;www.maizure.org&#x2F;projects&#x2F;decoded-gnu-coreutils&#x2F;tac.html" rel="nofollow">http:&#x2F;&#x2F;www.maizure.org&#x2F;projects&#x2F;decoded-gnu-coreutils&#x2F;tac.ht...</a>
评论 #26003234 未加载
RMPR超过 4 年前
&gt; Can’t knock it till you try it, so here I am trying to learn Bash scripting.<p>For bash scripting I found Julia Evans&#x27; zine bite size bash very interesting. Even though I had been scripting for quite some time I found hidden gems in there.
code_scrapping超过 4 年前
Hi Carl,<p>purely judging from your profile picture it seems that you&#x27;re about half my age :) and I think it&#x27;s excellent that you&#x27;re doing a bunch of things - personal blog, linux, tutorial post... Just remember - most of the guys around here tend to do it for marketing reasons (i.e. we want to find a job and we&#x27;re advertising our capabilities), and those projects might not be the most interesting things out there.<p>Bottom line is - just because everybody else is doing it, might be because they have different motives than you, and I hope you&#x27;ll do&#x2F;build firstly what&#x27;s interesting and fun, and secondly what&#x27;s financially viable.<p>Good luck, have fun!
评论 #26003351 未加载
评论 #26003281 未加载
评论 #26010669 未加载
asicsp超过 4 年前
&gt;Awk and sed are more of the UNIX magic that I have always thought was really cool, though I never really understood what they were used for.<p>I was so put off by their syntax that I didn&#x27;t even bother to try to learn them when I was a newbie. If I had a time machine, I would certainly go back and tell myself to learn these tools and save plenty of time instead of always using vim&#x2F;perl for every text processing problem. I&#x27;ve now written my own books (<a href="https:&#x2F;&#x2F;github.com&#x2F;learnbyexample&#x2F;scripting_course#ebooks" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;learnbyexample&#x2F;scripting_course#ebooks</a>) - might help you.<p>For `bash`, I&#x27;d highly recommend these resources:<p>* <a href="https:&#x2F;&#x2F;mywiki.wooledge.org&#x2F;BashGuide" rel="nofollow">https:&#x2F;&#x2F;mywiki.wooledge.org&#x2F;BashGuide</a>, <a href="https:&#x2F;&#x2F;mywiki.wooledge.org&#x2F;BashFAQ" rel="nofollow">https:&#x2F;&#x2F;mywiki.wooledge.org&#x2F;BashFAQ</a>, <a href="https:&#x2F;&#x2F;mywiki.wooledge.org&#x2F;BashPitfalls" rel="nofollow">https:&#x2F;&#x2F;mywiki.wooledge.org&#x2F;BashPitfalls</a>, etc<p>* <a href="https:&#x2F;&#x2F;www.shellcheck.net&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.shellcheck.net&#x2F;</a><p>* <a href="https:&#x2F;&#x2F;devmanual.gentoo.org&#x2F;tools-reference&#x2F;bash&#x2F;index.html" rel="nofollow">https:&#x2F;&#x2F;devmanual.gentoo.org&#x2F;tools-reference&#x2F;bash&#x2F;index.html</a><p>Also, <a href="https:&#x2F;&#x2F;linuxjourney.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;linuxjourney.com&#x2F;</a> is nice for many topics.
评论 #26017528 未加载
fuball63超过 4 年前
I really like the idea of using games to teach command line concepts, like the author did with grep and find. There have been several other ones that have popped up about using vim [1] and navigating a filesystem via cd&#x2F;ls[2].<p>I&#x27;ve always wanted to make a unix sandbox environment, using FreeBSD jails provisioned from a webapp, that has little challenges and games to teach the basics of the command line all the way up to hosting a basic HTML website with Apache.<p>Is this something people would find useful? I&#x27;ve been thinking about implementations but I don&#x27;t want to jump too far into it without validation that this would be something people would find helpful and interesting.<p>[1] <a href="https:&#x2F;&#x2F;vim-adventures.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;vim-adventures.com&#x2F;</a> [2] <a href="https:&#x2F;&#x2F;gitlab.com&#x2F;slackermedia&#x2F;bashcrawl" rel="nofollow">https:&#x2F;&#x2F;gitlab.com&#x2F;slackermedia&#x2F;bashcrawl</a>
评论 #26006938 未加载
jlangemeier超过 4 年前
One of the biggest improvements I saw in my Linux usage&#x2F;admin was when I started trying to challenge myself to use the mouse as little as possible; it was absolutely eye-opening when I could navigate around my machine, do all of my everyday processes, and never really leave &quot;home row&quot;. It also made VM&#x27;ing into a windows server a total pain because it was fairly quickly back to &quot;clicky-clicky&quot; navigation and processing (although win+R, tabbing and arrow keys could get you by about 90% of the time).<p>Great article, and great approach to learning the inner workings of the standard Linux suite!
unixhero超过 4 年前
Getting better at the shell<p>Actually I recommend reading the entire man page for bash.<p>Edit:<p><a href="https:&#x2F;&#x2F;linux.die.net&#x2F;man&#x2F;1&#x2F;bash" rel="nofollow">https:&#x2F;&#x2F;linux.die.net&#x2F;man&#x2F;1&#x2F;bash</a>
评论 #26003664 未加载
jzer0cool超过 4 年前
When I took a programming class a student sitting next to me introduced me to Linux. I was like &quot;what is that?&quot; I honestly thought these kinds of machines were just in the movies. I loved how it boot in a black screen, text scrolling, and there was a penguin. Unlike today, there was no Ubuntu. I didn&#x27;t have wireless at home.<p>It took a while to get Disks burned to install. I had struggles moving back and forth between two machines across rooms to look up &quot;help&quot; documentation from the internet. When it was all installed, nothing worked. Network cards, sound, etc. When my network card worked, it felt like heaven. When my screen resolution was fixed (x11 settings), felt like heaven. Repeat.<p>He had asked, do you really want to learn how it works? I said, yes, let&#x27;s start there. I was very confused with all the Linux variants so he recommended one. Now I look back and unsure that is where I should have started. L.O.L.
评论 #26010686 未加载
bernardv超过 4 年前
Best post I’ve read today and nice to see so many positive comments here.<p>Nothing like building something useful to learn a new tool or technology.
Farfignoggen超过 4 年前
Interesting but can there be a project to get OpenCL over Vulkan so maybe there can be out of the Box&#x2F;ISO support for OpenCL for Linux on AMD&#x27;s Ryzen APUs for OpenCL compute without having to install the OpenCL parts from the AMD Linux Pro driver stack.<p>MESA appears to be All about OpenGL and Vulkan for Games but there&#x27;s not much attention paid to OpenCL and GPGPU compute for Things Like Blender 3D&#x27;s GPU Accelerated Cycles rendering, and other Applications like Dark Table, Gimp, etc. that need OpenCL for GPGPU&#x2F;Compute acceleration workloads!<p>There really needs to be a Primer for Linux and How that OpenCL is plumbed into the system and what files are used to get that all working on Both Integrated and Discrete GPU based laptops! So What&#x27;s the Linux equivalent of MS&#x27;s WDDM and how does the Linux Kernel get Graphics and the Graphics APIs and Drivers working properly for User Space Applications to make use of.
AdmiralAsshat超过 4 年前
I always thought about writing a GNU&#x2F;POSIX utility called &#x27;pp&#x27; (prepend), that would simply take an input file and insert it above the first line of a target file. So, essentially, if I have a CSV file without a header and want to quickly insert the header file, I would run:<p><pre><code> pp header.txt spreadsheet.csv </code></pre> And it would be the equivalent of:<p><pre><code> cat header.txt spreadsheet.csv &gt; temp mv temp spreadsheet.csv </code></pre> But also support all of the expected POSIX niceties, reading from stdin, etc.<p>But I never got around to it, and it&#x27;s been a few years since I had to use C at my day-job (which was never great to begin with), so it fell to the wayside.
评论 #26003819 未加载
评论 #26003547 未加载
评论 #26003515 未加载
Arrath超过 4 年前
As someone who&#x27;s only exposure to non-windows systems is 20 minutes with the raspberry pi I picked up the other week, I think this will be a great resource for me to follow along with as I familiarize myself with everything. Thanks!
评论 #26006003 未加载
__soter__超过 4 年前
This kinda mirrors advice I would give my younger sibling when he was struggling to pick up programming, even though that is the direction he wanted his career to go. He thought he needed to know everything and saw that as an impossible mountain to climb. My advice to him was to find a small problem he cared about in the world or at home and develop a solution. When it&#x27;s a problem you care about or want resolved, you are more invested and learning becomes fun. Then you can build on those skills with what ever you find to work on next.
jldugger超过 4 年前
&gt; That thing ended up being a program that reverses the contents of a text file. Since this is just a reverse version of cat, I called the program recat.<p>because `tac` was already taken ;)
florg超过 4 年前
A great book in the same vein is: Understanding UNIX&#x2F;Linux-Programming by Bruce Molay.[0]<p>It also delves into the basic tools and then writes them from scratch. I found it quite inspiring as to where to spend time while learning UNIX.<p>[0] <a href="https:&#x2F;&#x2F;www.amazon.com&#x2F;Understanding-UNIX-LINUX-Programming-Practice&#x2F;dp&#x2F;0130083968&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.amazon.com&#x2F;Understanding-UNIX-LINUX-Programming-...</a>
temp0826超过 4 年前
Surprised that Linux From Scratch hasn’t been mentioned. Probably the best soup-to-nuts walkthrough out there for learning deeply about Linux. And I do agree with others that this is commendable- I remember my struggles with getting into *nix vividly. Keeping a beginner’s mindset and staying humble will take you far.<p><a href="http:&#x2F;&#x2F;linuxfromscratch.org&#x2F;" rel="nofollow">http:&#x2F;&#x2F;linuxfromscratch.org&#x2F;</a>
rootsudo超过 4 年前
Welp, he&#x27;s done more than me. I kinda stopped writing C++ programs back a decade ago and Carl is making grep games and seashells.
FactCore超过 4 年前
I&#x27;ve been sniffing around for projects to do to improve my coding ability and understanding of different programs&#x2F;languages. Your article really motivated me to start some small projects of my own! I like the idea of not getting yourself down with giant projects and instead just making small applications of new technologies you want to learn.
评论 #26005995 未加载
acomjean超过 4 年前
neat. Great way to explore the systems.<p>For me out of university, it was a co-workers books (some of which I ended up buying) that help me understand the role of UNIX better (I used the alpha machines at university, but was thrown into HPUX&#x2F;Solaris at work..)<p>I think this was one: <a href="https:&#x2F;&#x2F;www.amazon.com&#x2F;Advanced-Programming-UNIX-Environment-3rd&#x2F;dp&#x2F;0321637739" rel="nofollow">https:&#x2F;&#x2F;www.amazon.com&#x2F;Advanced-Programming-UNIX-Environment...</a><p>Of course a little out of date now, but a lot of the general concepts are the same.<p>Unix Power Tools helped me a lot as well. <a href="https:&#x2F;&#x2F;www.oreilly.com&#x2F;library&#x2F;view&#x2F;unix-power-tools&#x2F;0596003307&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.oreilly.com&#x2F;library&#x2F;view&#x2F;unix-power-tools&#x2F;059600...</a><p>How did others learn this stuff?
musicale超过 4 年前
&gt; I settled on the name SeaShell, which I found way too funny.<p>not to be confused with the C shell, csh&#x2F;tcsh(1)
every超过 4 年前
One of my pastimes is randomly exploring the Unix Toolkit. It&#x27;s basically, &quot;What is this thing? What does it do? Do I have a use for it?&quot; And even if the answer is &quot;no&quot;, at least I now know it exists and where to find it should my needs change...
leephillips超过 4 年前
I’d like to echo some other comments and mention that this is the way to learn things like this. If I want to learn a new programming language, I write a program in it. I think the author’s Createservice script might be useful!
mitnk超过 4 年前
Another direction to learn Linux&#x2F;Unix is spending time to learn from decent books like TLPI.<p><a href="https:&#x2F;&#x2F;man7.org&#x2F;tlpi&#x2F;" rel="nofollow">https:&#x2F;&#x2F;man7.org&#x2F;tlpi&#x2F;</a>
mraza007超过 4 年前
What a great way to learn more about linux. really interesting article, I love how you implemented the programs in Golang.<p>I had a very similar idea of implementing the Linux programs in python back then.<p>Keep it up !!!
评论 #26005956 未加载
smlckz超过 4 年前
On 8. Processes - Stranger Danger: some improvements<p><pre><code> sudo ps -ef | awk -v user=$USER &#x27;$1 != user &amp;&amp; $1 != &quot;root&quot;&#x27;</code></pre>
trilinearnz超过 4 年前
Wholesome, and tangible results to boot. A great role model of &#x27;growth mindset&#x27; for other people who are interested in technology.
johnthescott超过 4 年前
welcome to the monkey house. the community behind unix has always been my favorite aspect.<p>many, many years ago i met dennis ritchie at the computer literacy bookstore in san jose. in the Q&amp;A he commented that when he realized a circuit board was essentially a small network, the entire design of unix came to him in a flash. unix is an i&#x2F;o multiplexer with light security.
potato24超过 4 年前
I guess what we all learned today is if you want to do something break it into its most simple components and do it.
systematical超过 4 年前
And here I am just trying to learn sed and awk THIS YEAR. Granted I have other stuff on my to-learn-list, but still.
jvanderbot超过 4 年前
What a great bundle of projects. Kudos.
imhoguy超过 4 年前
Another programming exercise: writing own userspace VFS (Virtual File System).
NexRebular超过 4 年前
What a fantastic idea!<p>Should utilize something similar in teaching FreeBSD and illumos too.
zelphirkalt超过 4 年前
Getting better at &quot;Linux&quot;