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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Ask HN: Tips/tricks for Linux workstations that everyone should know

2 点作者 endorphine大约 2 年前
Linux users, what are your favorite little hacks, convenience scripts or essential things that you managed to make work (and that are traditionally hard on Linux)?<p>Alternatively, what is a simple thing you have in your system that you think everyone should have?<p>I&#x27;m interested in potentially learning any essential stuff that I might be missing out. Could be related to usability, accessibility, security, battery life or anything else really.

2 条评论

ragingrobot大约 2 年前
I had tried to do it on logout, but .{bash,zsh}_logout turned out to be unreliable, so now I do it on logon:<p>1. Save your history!<p>Unless you have an insanely long history length set (and by default, you really won&#x27;t), that one off command you never think you&#x27;re going to need again? You&#x27;re going to need it. And all those commands you typed after it will push it out of history and it&#x27;s gone forever.<p>So, in your .{bash,zsh}rc, do something like<p><pre><code> cp .histfile histories&#x2F;$(date).histfile </code></pre> Name it however you like. There are ways to avoid duplication and saving excessive amounts, but I&#x27;ll leave that up to you.<p>2. tmux&#x2F;GNU screen<p>For some reason I can&#x27;t stand tabbed terminal windows, and use a multiplexer. Plus tmux&#x27;s scrolling is a little easier to use that a mousewheel.<p>3. zsh<p>If you chose zsh over bash, you get easier to use expansion tools, for example, the equivalent of basename in bash is<p><pre><code> ${FILE##*&#x2F;} </code></pre> in zsh<p><pre><code> ${FILE:t} </code></pre> Helpful in scripting and the like.
ofalkaed大约 2 年前
My linux setup has barely changed in 20 years and many of my configs are 20 years old now, fairly proud of that. Been using Slackware with ion&#x2F;notion wm and it frees me from having to relearn things every major release, stays out of the users way like a system should.<p>The most useful thing I have done in years is bind my Print Screen key to toggle touchpad on and off which is great for the modern massive touchpads that laptops have. I ended up doing it in a rather hackish way, I have not had a need to use Lua since ~ion3 days so had forgotten it, ended up just writing the script in bash and the lua script just executes the bash script. It works, I am happy even if I would be embarrassed to show it to anyone especially since it probably would have only taken 15 minutes to relearn enough lua to avoid the bash script.