`
marb
  • 浏览: 409953 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

linux 命令行汇总

 
阅读更多
sudo !!
2009-01-26 10:26:48
User: root
957
Up
Down

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

Comments (33) | Add to favourites | Report as malicious | Submit alternative | Report as a duplicate
python -m SimpleHTTPServer
2009-02-05 11:57:43
User: pixelbeat
Functions: python
698
Up
Down
 
Comments (24) | Add to favourites | Report as malicious | Submit alternative | Report as a duplicate
cd -
2009-02-04 22:41:21
User: systemj
Functions: cd
572
Up
Down
 
Comments (15) | Add to favourites | Report as malicious | Submit alternative | Report as a duplicate
^foo^bar
2009-01-26 13:25:37
User: root
434
Up
Down

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
Comments (8) | Add to favourites | Report as malicious | Submit alternative | Report as a duplicate
mtr google.com
2009-02-21 07:53:32
User: fryfrog
427
Up
Down

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.

Show sample output | Comments (13) | Add to favourites | Report as malicious | Submit alternative | Report as a duplicate
ctrl-x e
2009-03-11 09:26:05
User: fool
384
Up
Down

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.

Show sample output | Comments (14) | Add to favourites | Report as malicious | Submit alternative | Report as a duplicate
<space>command
2009-03-17 16:25:29
User: eaZy
339
Up
Down

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.

Show sample output | Comments (13) | Add to favourites | Report as malicious | Submit alternative | Report as a duplicate
reset
2009-01-28 22:22:01
User: root
Functions: reset
251
Up
Down

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.

Show sample output | Comments (11) | Add to favourites | Report as malicious | Submit alternative | Report as a duplicate
'ALT+.' or '<ESC> .'
2009-03-20 11:36:04
User: atoponce
247
Up
Down

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.

Comments (12) | Add to favourites | Report as malicious | Submit alternative | Report as a duplicate
mount | column -t
2009-03-20 14:18:56
User: thechile
Functions: column mount
231
Up
Down

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.

Show sample output | Comments (6) | Add to favourites | Report as malicious | Submit alternative | Report as a duplicate
echo "ls -l" | at midnight
2009-01-25 21:07:42
User: root
Functions: at echo
207
Up
Down

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

Comments (11) | Add to favourites | Report as malicious | Submit alternative | Report as a duplicate
dig +short txt <keyword>.wp.dg.cx
2009-07-31 16:08:59
User: drizzt
Functions: dig
204
Up
Down

Query Wikipedia by issuing a DNS query for a TXT record. The TXT record will also include a short URL to the complete corresponding Wikipedia entry.You can also write a little shell script like:

$ cat wikisole.sh

 

#!/bin/sh

 

dig +short txt ${1}.wp.dg.cx

and run it like

./wikisole.sh unix

were your first option ($1) will be used as search term.

Show sample output | Comments (28) | Add to favourites | Report as malicious | Submit alternative | Report as a duplicate
ssh -N -L2001:localhost:80 somemachine
2009-02-05 09:13:23
Functions: ssh
195
Up
Down

now you can acces the website by going to http://localhost:2001/

Comments (8) | Add to favourites | Report as malicious | Submit alternative | Report as a duplicate
man ascii
2009-03-31 10:29:20
User: ntheother
Functions: man
183
Up
Down
 
Comments (2) | Add to favourites | Report as malicious | Submit alternative | Report as a duplicate
curl ifconfig.me
2010-04-21 13:10:33
User: aajjk
176
Up
Down

curl ifconfig.me/ip -> IP Adress

curl ifconfig.me/host -> Remote Host

curl ifconfig.me/ua ->User Agent

curl ifconfig.me/port -> Port

thonks to http://ifconfig.me/

Comments (2) | Add to favourites | Report as malicious | Submit alternative | Report as a duplicate
!!:gs/foo/bar
2009-02-11 10:20:15
User: Tronks
175
Up
Down

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.

Comments (6) | Add to favourites | Report as malicious | Submit alternative | Report as a duplicate
dd if=/dev/dsp | ssh -c arcfour -C username@host dd of=/dev/dsp
2009-02-08 10:10:00
User: morpheus
Functions: dd ssh
170
Up
Down

This will output the sound from your microphone port to the ssh target computer's speaker port. The sound quality is very bad, so you will hear a lot of hissing.

Comments (18) | Add to favourites | Report as malicious | Submit alternative | Report as a duplicate
mount -t tmpfs tmpfs /mnt -o size=1024m
2009-02-06 00:33:08
User: ajrobinson
Functions: mount
165
Up
Down

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.

Comments (8) | Add to favourites | Report as malicious | Submit alternative | Report as a duplicate
sshfs name@server:/path/to/folder /path/to/mount/point
2009-02-05 20:17:41
User: ihasn
162
Up
Down

Install SSHFS from http://fuse.sourceforge.net/sshfs.html

Will allow you to mount a folder security over a network.

Show sample output | Comments (6) | Add to favourites | Report as malicious | Submit alternative | Report as a duplicate
curl -u user:pass -d status="Tweeting from the shell" http://twitter.com/statuses/update.xml
2009-02-05 18:33:23
User: adamm9
156
Up
Down
 
Comments (20) | Add to favourites | Report as malicious | Submit alternative | Report as a duplicate
wget --random-wait -r -p -e robots=off -U mozilla http://www.example.com
2009-02-17 22:53:07
User: starchox
Functions: wget
144
Up
Down

-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

Comments (5) | Add to favourites | Report as malicious | Submit alternative | Report as a duplicate
ssh user@host cat /path/to/remotefile | diff /path/to/localfile -
2009-02-04 11:33:19
User: root
Functions: cat diff ssh
143
Up
Down

Useful for checking if there are differences between local and remote files.

Comments (0) | Add to favourites | Report as malicious | Submit alternative | Report as a duplicate
ctrl-l
2009-03-18 17:38:49
User: mrttlemonde
132
Up
Down
 
Comments (8) | Add to favourites | Report as malicious | Submit alternative | Report as a duplicate
(cd /tmp && ls)
2009-01-27 00:41:04
User: root
131
Up
Down
 
Comments (14) | Add to favourites | Report as malicious | Submit alternative | Report as a duplicate
2010-07-23 03:33:46
127
Up
Down

Example :

vim /etc/fstab

## damn

<ctrl+u> sudo <ctrl+y>

## like a boss.

Example 2 :

sudo vim /root/bin/

##uh... autocomplete doesn't work...

<ctrl+u> sudo ls /root/bin

##ah! that's the name of the file!

<ctrl+y> sudo vim /root/bin/ ##resume here! Thanks readline!
Comments (6) | Add to favourites | Report as malicious | Submit alternative | Report as a duplicate
分享到:
评论

相关推荐

    十五个常用Linux命令行总汇

    十五个常用Linux命令行总汇 众多Linux管理员在使用Linux的时候会经常使用到很多Linux命令行,其中有绝大部分不是经常使用到的。在本文中主要为大家总结了经常使用的十五个最常用Linux命令行,希望对刚刚接触Linux...

    Linux认证:十五个常用Linux命令行总汇.pdf

    Linux认证:十五个常用Linux命令行总汇.pdf

    常见的linux命令行大全汇总

    资源里有将近一百多个平时使用Linux常见的命令行,有命令行的使用方法和相应命令行执行后的结果

    Linux指令命令行汇总大全包括指令说明

    最近都在和Linux打交道,我觉得Linux相比麻烦的地方就是都要用命令来控制,命令比较短小但直接和系统交流,灵活性很高。我将我了解到的命令列举一下,仅供大家参考:Linux指令汇总大全,包括指令说明。

    Linux命令行与shell脚本编程大全案例.zip

    linux命令汇总

    Linux系统管理工具包系列汇总 Linux系统管理员必看

    存在各种用于简化不同过程的关键实用工具、命令行链和脚本。其中一些工具来自于操作系统,而大部分的诀窍则来源于长期的经验积累和减轻系统管理员工作压力的要求。本系列文章主要专注于最大限度地利用各种Linux环境...

    Linux常用命令汇总手册.zip

    主要汇总了Linux的常用的命令,很全,可以成为你学习Linux的得力手册,记不住命令行的可以下载,保证可用。

    Linux中find命令的用法汇总

    如果你想在linux系统的命令行中变得特别高效,那么 find 是你必须掌握的命令之一。 find 命令的基本语法如下: $ find [path] [option] [expression] 一、基本用法 1. 列出当前目录和子目录下的所有文件 这个命令...

    linux-notes:面向中国程序员Linux快速入门笔记本

    Linux命令行及bash相关的笔记坑挖好了, 开始填:)这是我的笔记梳理, 删掉旧版本, 重新梳理中.....doing当前进度: 20%基于系统: centos 6.5参考书目鸟哥Linux私房菜Linux与Unix Shell编程指南Linux Shell脚本攻略概要...

    Linux实用的命令技巧汇总分析.docx

    Linux是一种常用的操作系统,它提供了许多强大的命令行工具,如何掌握这些命令对于Linux的使用者来说非常重要。下面是一些实用的命令技巧汇总分析,帮助您更好地掌握Linux命令。 ## 1.使用man命令查看命令帮助文档 ...

    shell脚本编程学习笔记汇总

    该文档是本人阅读《linux命令行大全》对最后第四章节的shell脚本编程的学习笔记总结。可以在只看次笔记的情况下完全掌握shell编程

    你可能会用到的16个Linux命令

    我们每天都会频繁使用Linux命令行,虽然网上关于其使用技巧的资料多种多样,但很多朋友应该并没有进行过实际尝试。因此,今天的文章将对此进行汇总,希望能为大家带来一点帮助。 1. 将输出结果显示为表 有时候,当...

    linux快捷键、cygwin快捷键、快捷方式(全)

    cygwin下linux快捷键汇总: Ctrl + a 切换到命令行开始 Ctrl + b 左移一个字符 Ctrl + c 终止命令(终止当前进程) Ctrl + d 退出shell,login(退出当前终端)/删除后一个字符 . .

    redhat linux教材20课程学习文档

    16.2.2 通过命令行管理打印机 16.2.3 通过web界面管理打印机 16.3 使用CUPS打印 16.3.1 打印文件 16.3.2 选择打印机 16.3.3 标准打印选项 第十七章 基本网络配置与管理 17.1 网络环境概述 17.1.1 使用ADSL连接 ...

    linux系统上传下载命令rz和sz的教程

    (一)安装方法汇总 1、安装方法(推荐) yum install lrzsz -y 2、在安装Linux系统时选中“DialupNetworking Support”组包 3、安装系统联网启动后执行yum直接安装组包 yum groupinstall Dialup Networking ...

    Linux Shell中的特殊符号和含义简明总结(包含了绝大部份)

    主要介绍了Linux Shell中的特殊符号和含义简明总结,本文汇总了包含了绝大部份的Shell特殊符号,对每一个符号的作用做了总结,需要的朋友可以参考下

    matlab宋体代码-controls-group-cookbook:控制组生存指南

    《快乐Linux命令行》:本书适合作为Linux入门学习 《鸟哥Linux私房菜》: 本书较厚,可以用作参考手册,有时间可以通读 上册为基本操作,下册为服务器搭建指南 我的学习笔记 这是我2013年学习时的笔记,对应的视频...

    免费书籍:互联网上的免费书籍

    (Linux命令行), , (中文) (Linux从零开始) (中文) (中文) (实用文件系统设计), (中文) 三,编程语言 3.1 C,C ++ (PDF) () C语言教程:构建Lisp编译器(,) (C Internals) 3.2前进 , ...

    角磨机:在命令行上切片和切块日志

    在命令行上对日志文件进行切片和切块。 角度研磨器允许您解析,汇总,求和,平均值,最小/最大值,百分位数和对数据进行排序。 您可以在终端中实时更新它。 角磨机的设计目的是出于某种原因,无论何时您都没有石墨...

Global site tag (gtag.js) - Google Analytics