注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

笑遍世界@网易博客

明天还会在路上……

 
 
 

日志

 
 
关于我

Stay hungry, stay foolish. 工作用脑,生活用心! 走过山重水复,必然迎来柳暗花明! 受苦的人没有悲观的权利,远征的人没有流泪的资格。 Live each day as if we should die tomorrow.

网易考拉推荐
 
 

记录几个linux下的几个命令行  

2011-11-11 23:28:23|  分类: Linux技术 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

偶然看到某篇文章时,记录下了几个我现在不熟悉的,但很可能会用到的而且也比较帅气的命令行吧.
那篇文章在:http://blog.urfix.com/25-linux-commands/

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.

 

<space>command
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.

 

mount -t tmpfs tmpfs /mnt -o size=1024m
Mount a temporary ram partition
Makes a partition in ram which is useful if you need a temporary working space as read/write access is fast.
Be aware that anything saved in this partition will be gone after your computer is turned off.

 

ssh-copy-id user@host    #我应该会常用的
Copy ssh keys to user@host to enable password-less ssh logins.
To generate the keys use the command ssh-keygen

 

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 vim, emacs, nano, or whatever.

 

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.

 

cp filename{,.bak}            #我应该会常用的
quickly backup or copy a file with bash

 

:w !sudo tee %            #我应该会常用的
Save a file you edited in vim without the needed permissions
I often forget to sudo before editing a file I don’t have write permissions on. When you come to save that file and get the infamous “E212: Can’t open file for writing”, just issue that vim command in order to save the file without the need to save it to a temp file and then copy it back again.

 

python -m SimpleHTTPServer     #我应该会常用的
Serve current directory tree at http://$HOSTNAME:8000/

  评论这张
 
阅读(662)| 评论(0)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017