linux命令排行榜

1. sudo!!

Run the last command as root.
Useful when you forget to use sudo for a command. "!!" grabs the last run command.

一些变种:`!!`

Use result of the last command
\$ which python
/usr/bin/python
\$ ll `!!`
lrwxrwxrwx 1 root root 9 2010-11-08 22:01 /usr/bin/python -> python2.6


2. python -m SimpleHTTPServer

Serve current directory tree at http://$HOSTNAME:8000/

在python3中需要使用:python -m http.server


3. cd -

change to the previous working directory


4 ^foo^bar

Runs previous command but replacing
Really useful for when you have a typo in a previous command. Also, arguments default to empty so if you accidentally run:
echo "no typozs"
you can correct it with
^z


5. mtr google.com

mtr, better than traceroute and ping combined
mtr combines the functionality of the traceroute and ping programs in a single network diagnostic tool.
As mtr starts, it investigates the network connection between the host mtr runs on and HOSTNAME. by sending packets with purposly low TTLs. It continues to send packets with low TTL, noting the response time of the intervening routers. This allows mtr to print the response percentage and response times of the internet route to HOSTNAME. A sudden increase in packetloss or response time is often an indication of a bad (or simply over‐loaded) link.


6. ctrl+x+e

Rapidly invoke an editor to write a long, complex, or tricky command
Next time you are using your shell, try typing ctrl-x e (that is holding control key press x and then e). The shell will take what you've written on the command line thus far and paste it into the editor specified by $EDITOR. Then you can edit at leisure using all the powerful macros and commands of vi, emacs, nano, or whatever.


7. <space>comand

Execute a command without saving it in the history
Prepending one or more spaces to your command won't be saved in history.
Useful for pr0n or passwords on the commandline.
Tested on BASH.


8. > file.txt

Empty a file
For when you want to flush all content from a file without removing it (hat-tip to Marc Kilgus).


9. reset

Salvage a borked terminal
If you bork your terminal by sending binary data to STDOUT or similar, you can get your terminal back using this command rather than killing and restarting the session. Note that you often won't be able to see the characters as you type them.


10. <Esc> + .

Place the argument of the most recent command on the shell
When typing out long arguments, such as:
cp file.txt /var/www/wp-content/uploads/2009/03/
You can put that argument on your command line by holding down the ALT key and pressing the period '.' or by pressing <ESC> then the period '.'. For example:
cd 'ALT+.'
would put '/var/www/wp-content/uploads/2009/03/ as my argument. Keeping pressing 'ALT+.' to cycle through arguments of your commands starting from most recent to oldest. This can save a ton of typing.


11. mount | column -t

currently mounted filesystems in nice layout
Particularly useful if you're mounting different drives, using the following command will allow you to see all the filesystems currently mounted on your computer and their respective specs with the added benefit of nice formatting.


12 echo "ls -l" | at midnight

Execute a command at a given time
This is an alternative to cron which allows a one-off task to be scheduled for a certain time.

其他一些用法:

mrttlemonde, your command is not exactly right with the quotes, i.e. it should be something like:
echo "ls -l >/dev/pts/3"  | at 23:59
or we could also direct to a file:
echo "ls -lah >/foo/bar/ls.txt"  | at 07:00


13 netstat -tlnp

Lists all listening ports together with the PID of the associated process
The PID will only be printed if you're holding a root equivalent ID.


14 !!:gs/foo/bar

Runs previous command replacing foo by bar every time that foo appears
Very useful for rerunning a long command changing some arguments globally.
As opposed to ^foo^bar, which only replaces the first occurrence of foo, this one changes every occurrence.


15. ssh user@host cat /path/to/remotefile | diff /path/to/localfile -

Compare a remote file with a local file
Useful for checking if there are differences between local and remote files.


16  wget --random-wait -r -p -e robots=off -U mozilla http://example.com

Download an entire website

-r 表示递归下载

-l 最大递归深度(0表示无限制,最大下载,默认是5)
-p parameter tells wget to include all files, including images.
-e robots=off you don't want wget to obey by the robots.txt file
-U mozilla as your browsers identity.
--random-wait to let wget chose a random number of seconds to wait, avoid get into black list.
Other Useful wget Parameters:
--limit-rate=20k limits the rate at which it downloads files.
-b continues wget after logging out.
-o $HOME/wget_log.txt logs the output

-k  --convert-links
After the download is complete, convert the links in the document to make them suitable for local viewing. This affects not only the visible hyperlinks, but any part of the document that links to external content,
such as embedded images, links to style sheets, hyperlinks to non-HTML content, etc.

-p is not necessary if you're using -r
-K will keep copies of original files before modifying links with -k
-N for timestamps: useful for refreshing a mirror, only downloading new stuff


17. ctrl + l

clean the terminal screen


http://www.commandlinefu.com/commands/browse/sort-by-votes/25


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: Linux 控制台打字游戏是一种可以在 Linux 操作系统的终端窗口中进行的文字游戏。游戏的目标是测试玩家的打字速度和准确性。在游戏开始时,玩家会看到一个屏幕上出现一系列的单词或短语。玩家需要快速准确地在键盘上输入这些单词或短语。如果输入正确,游戏会记录得分并随机生成新的单词或短语。如果输入错误,玩家将失去积分或时间。 Linux 控制台打字游戏可以提高玩家的打字技巧和速度。通过不断地练习,玩家可以逐渐提高自己的打字速度和准确性。这对于经常使用计算机工作的人来说尤为重要,因为提高打字速度可以提高工作效率和生产力。此外,这种游戏也可以帮助玩家更好地熟悉 Linux 操作系统的终端界面和命令行操作。 Linux 控制台打字游戏通常提供不同的游戏模式和难度级别,以满足不同玩家的需求。在高级模式中,游戏可能会增加单词或短语的长度和复杂性,以更大程度地挑战玩家的技能。一些游戏还提供排行榜或挑战模式,让玩家与其他玩家竞争,增加游戏的乐趣和挑战性。 总而言之,Linux 控制台打字游戏是一个有趣且有益的方式来提高打字速度和准确性,并熟悉 Linux 操作系统。无论是企业员工还是普通用户,都可以通过这种游戏提高他们的计算机技能,并在日常工作中更加高效和便捷。 ### 回答2: Linux 控制台打字游戏是一种基于命令行操作系统的打字游戏。它的目的是帮助用户提高 Linux 系统中命令的熟练程度和键盘输入速度。 在游戏中,玩家需要通过键盘输入相应的命令来完成各种任务和挑战。游戏通常会提供一系列的任务,如找出特定文件、运行特定程序、查找特定命令等等。玩家需要准确地输入相应的命令,并在规定的时间内完成任务。游戏会根据玩家的准确性和速度给予相应的分数或反馈。 Linux 控制台打字游戏不仅可以提高玩家的打字速度和准确性,还可以加深对 Linux 系统命令的了解和应用。通过游戏,玩家可以掌握更多的命令和技巧,更加熟练地操作 Linux 系统。此外,这种游戏还可以增强玩家对命令行界面的适应能力,使得在实际使用中更加得心应手。 对于初学者来说,Linux 控制台打字游戏是一个很好的学习工具。通过游戏的方式学习命令,不仅能够提高学习者的兴趣和积极性,还可以加深对命令的记忆和理解。而对于有经验的玩家来说,这种游戏能够提供一种娱乐的方式,同时也可以保持和提高他们的技能水平。 总的来说,Linux 控制台打字游戏是一种有趣而又实用的游戏形式。通过参与这种游戏,玩家可以提高自己的命令掌握能力和键盘输入速度,同时也能够加深对 Linux 系统的了解和应用。无论是初学者还是有经验的用户,都能够从这种游戏中获得乐趣和益处。 ### 回答3: Linux控制台打字游戏是一种在Linux系统的命令行界面中进行的游戏。这种游戏通过输入正确的指令或者文字来控制游戏人物或角色完成任务或者取得胜利。 Linux控制台打字游戏通常具有以下特点: 1. 基于命令行界面:与传统的图形界面游戏不同,这类游戏完全在Linux命令行终端中进行,需要玩家使用键盘输入命令或文字操作。 2. 强调反应速度和正确输入:由于游戏以时间和输入的准确性为基础,控制台打字游戏通常要求玩家快速准确地输入命令或文字,以便在游戏中取得进展或击败敌人。 3. 类型多样:在控制台打字游戏中,可以有各种类型的游戏,如打字射击、文字冒险等。玩家可以通过输入指令来控制游戏人物,完成各种任务,甚至是与其他玩家对战。 控制台打字游戏可以提高玩家的命令行操作能力和反应速度,同时也增加了人们使用Linux系统的趣味性。它还可以促进玩家学习和熟练掌握Linux系统中常用的命令和操作方式,提高对Linux命令行界面的熟悉度。 总的来说,Linux控制台打字游戏是一种在Linux系统中进行的命令行游戏,它通过输入正确的指令来控制游戏角色完成任务或取得胜利。这类游戏能够提高玩家的命令行操作能力,同时也增加了使用Linux系统的趣味性和学习的动力。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值