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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Time-saving tips for Linux

242 点作者 thenicepostr大约 14 年前

17 条评论

doctororange大约 14 年前
The learning curve of vim was pretty steep, but once over the hump you get some massive benefits. That said, I bet I'm only using 1% of the available commands.<p>Going back to Windows makes you really appreciate the speed of bash, vim and grep.
评论 #2362151 未加载
评论 #2362270 未加载
jrockway大约 14 年前
I don't think these tips are that great. Some random criticisms:<p>ifconfig is deprecated (use "ip" instead).<p>There is not much value in knowing vim if you know Emacs. If you want to edit something in your terminal, well, emacsclient -t to your Emacs session. Or use mg, which is a very fast and light Emacs workalike -- just enough for editing your /etc/apt/sources.list to get Emacs installed :)
评论 #2362534 未加载
评论 #2362425 未加载
评论 #2362892 未加载
评论 #2363376 未加载
评论 #2362262 未加载
评论 #2364284 未加载
评论 #2362228 未加载
评论 #2362639 未加载
评论 #2362796 未加载
评论 #2366815 未加载
there大约 14 年前
<i>Turn on sudo(8)'s "NOPASSWD" option for yourself (see sudoers(5)).</i><p>don't do that. if anything, lock it down even more by enabling tty_tickets.
评论 #2363121 未加载
评论 #2363696 未加载
ilcavero大约 14 年前
"Learn what the number inside something like ls(1) or perror(3) means." you got me there, I don't know what it means and now I'm curious and can't find it on google
评论 #2362367 未加载
评论 #2362366 未加载
评论 #2362907 未加载
endlessvoid94大约 14 年前
I found out about ack awhile back -- it's like grep on steroids.
评论 #2362342 未加载
评论 #2362897 未加载
评论 #2365391 未加载
travisglines大约 14 年前
When first stumbling my way around the shell, after learning about tab completion I discovered the magic wizardry that is command reverse/history lookup (cntrl-r start typing command ... see last command you entered that matches)
评论 #2365220 未加载
xelfer大约 14 年前
The 'learn bash, it's available everywhere' really bit me when I moved from being a Linux Sysadmin to an AIX Sysadmin. Only ksh is available in this case. It took quite a few months to get used to.
评论 #2363293 未加载
geoka9大约 14 年前
<i>If you are halfway through typing a command but change your mind, hit Ctrl-A, add a # at the beginning to make it a comment, and press enter. You can then return to it later via command history.</i><p>A faster way would be to hit Alt-# (does the same thing with just one key combo).
评论 #2363422 未加载
DerekH大约 14 年前
It's great seeing all of these commands and shortcuts, and seeing that you know a lot of them. These never cease to be useful.<p>Even though it seems simple to someone who knows Linux, you can always impress marketing/business people by flying through Linux with these helpful commands, shortcuts, and tips.
评论 #2362539 未加载
clvv大约 14 年前
Another trick that I don't see people mention(excuse me if somebody here already did) is the bash history completion:<p>\esc \tab<p>This will complete based on your history, argument wise. Very useful when tab completion itself doesn't satisfy you.
baha_man大约 14 年前
"In bash, use Ctrl-R to search through command history."<p>Or, add these lines to your .bashrc to use Ctrl-p and Ctrl-n:<p>bind "\C-p":history-search-backward<p>bind "\C-n":history-search-forward
评论 #2362201 未加载
评论 #2362231 未加载
munchhausen大约 14 年前
One thing that's definitely missing from that list is the "undo" feature of bash which is bound to Ctrl-/ by default. It reverts the last edit you did on the command line. (The keybinding invokes the undo action also in emacs.)
klochner大约 14 年前
quora appears broken at the moment . . . I was going to suggest:<p>in many shells (bash, tcsh, etc), !foo will execute the most recent command from your history that matches foo, for example:<p><pre><code> &#62; grep -lots -of -options /complicated_regex/ ./some/path/* | /pipe/filter # realize you are in the wrong directory &#62; cd /the/right/directory &#62; !g </code></pre> and similarly, !! is the most recent command, which comes in handy for "sudo !!"[1]<p>[1] <a href="http://xkcd.com/149/" rel="nofollow">http://xkcd.com/149/</a>
dreur大约 14 年前
One thing to say: <a href="http://cb.vu/unixtoolbox.xhtml" rel="nofollow">http://cb.vu/unixtoolbox.xhtml</a> It has everything I ever needed. When something is missing send patch.
known大约 14 年前
<a href="http://www.cyberciti.biz/faq/" rel="nofollow">http://www.cyberciti.biz/faq/</a> also have some good tips
bingaman大约 14 年前
Quick ssh and and start screen:<p><pre><code> function s() { ssh $1 -t screen -dRR }</code></pre>
jeberle大约 14 年前
It's odd that his 2nd tip is "Learn Vim" and then goes on to describe all the bash/readline keystrokes in Emacs mode.<p><pre><code> $ set -o vi</code></pre>
评论 #2362615 未加载
评论 #2362619 未加载
评论 #2362906 未加载