dpkg:--purge needs at least one package name argument
Typedpkg --help for help about installing and deinstalling packages[*];
Use `dselect' or `aptitude' for user-friendly packagemanagement;
Type dpkg -Dhelp for a list of dpkg debug flagvalues;
Type dpkg --force-help for a list of forcing options;
Typedpkg-deb --help for help about manipulating *.deb files;
Type dpkg--license for copyright license and lack of warranty (GNU GPL) [*].
Optionsmarked [*] produce a lot of output - pipe it through `less' or`more' !
-b,-k,-m,-g show output in bytes, KB, MB, or GB
-l show detailed low and high memory statistics
-o use old format (no -/+buffers/cache line)
-t display total for RAM + swap
-s update every [delay] seconds
-c update [count] times
-V display version information and exit
连续监视内存使用情况
watch -d free
# 使用 Ctrl + c 退出
动态显示进程执行情况
top
top指令运行时输入H或?打开帮助窗口,输入Q退出指令。
查看当前有哪些进程
ps -AFL
查看目前登入用户运行的程序
w
查看当前用户程序实际内存占用,并排序
ps -u $USER -o pid,rss,cmd --sort -rss
统计程序的内存耗用
ps -eo fname,rss|awk '{arr[$1]+=$2} END {for (i in arr) {print i,arr[i]}}'|sort -k2 -nr
按内存从大到小排列进程
ps -eo "%C : %p : %z : %a"|sort -k5 -nr
按cpu利用率从大到小排列进程
ps -eo "%C : %p : %z : %a"|sort -nr
查看当前进程树
pstree
中止一个进程
kill 进程号(就是ps -A中的第一列的数字)
或者 killall 进程名
强制中止一个进程(在上面进程中止不成功的时候使用)
kill -9 进程号
或者 killall -9 进程名
图形方式中止一个程序
xkill 出现骷髅标志的鼠标,点击需要中止的程序即可
查看进程打开的文件
lsof -p 进程的pid
显示开启文件abc.txt的进程
lsof abc.txt
显示22端口现在运行什么程序
lsof -i :22
显示nsd进程现在打开的文件
lsof -c nsd
在後台运行程序,退出登录後,并不结束程序
nohup 程序 &
#查看中间运行情况 tail nohup
在后台运行交互式程序,退出登录后,并不结束程序
sudo apt-get install screen
screen vim a.txt
#直接退出后使用
screen -ls # 1656.pts-0.ubuntu (Detached)
screen -r 1656 #恢复
#热键,同时按下Ctrl和a键结束后,再按下功能键
C-a ? #显示所有键绑定信息
C-a w #显示所有窗口列表
C-a C-a #切换到之前显示的窗口
C-a c #创建一个新的运行shell的窗口并切换到该窗口
C-a n #切换到下一个窗口
C-a p #切换到前一个窗口(与C-a n相对)
C-a 0..9 #切换到窗口0..9
C-a a #发送 C-a到当前窗口
C-a d #暂时断开screen会话
C-a k #杀掉当前窗口
#ipod touch可用
for i in *.rmvb; do mencoder -vf harddup -oac mp3lame -lameopts vbr=3 -ovc xvid -xvidencopts fixed_quant=4 -of avi $i -o `echo $i | sed -e 's/rmvb$/avi/'`; done
批量将DVD转为avi
for i in *.VOB; do mencoder -oac mp3lame -lameopts aq=7:vbr=2:q=6 -srate 44100 -ovc xvid -xvidencopts fixed_quant=4 -of avi $i -o `echo $i | sed -e 's/VOB$/avi/'`; done
批量将任何格式的电影转为ogv
#sudo apt-get install ffmpeg2theora
#firefox3.5或chrome直接支持播放,无需安装任何解码器,注意不支持rmvb,rmvb会出现a/v不同步问题
for i in *; do ffmpeg2theora --optimize --deinterlace $i; done
批量将rmvb格式的电影转为ogv
#!/bin/bash
for i in *; do
mkfifo "/tmp/$i"
mencoder -quiet -vf harddup -ovc raw -oac pcm -o "/tmp/$i" "$i" &
ffmpeg2theora --optimize --deinterlace "/tmp/$i" -o "`echo $i | sed 's//(.*/)/..*$//1/'`.ogv"
rm "/tmp/$i"
done
let &termencoding=&encoding
set fileencodings=utf-8,gbk,ucs-bom,cp936
#再提供一个实践中觉得不错的配置:
" Encoding related
set encoding=UTF-8
set langmenu=zh_CN.UTF-8
language message zh_CN.UTF-8
set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1
set fileencoding=utf-8
gedit中文乱码的解决
gconftool-2 --set /apps/gedit-2/preferences/encodings/auto_detected "[UTF-8,CURRENT,GB18030,BIG5,ISO-8859-15,UTF-16]" --type list --list-type string
编译和打包
安装通用编译环境
sudo apt-get install build-essential
通用的编译安装步骤
./configure && make && sudo make install
如何编译安装软件kate
sudo apt-get install apt-build
sudo apt-build install kate
Converters
ppmtompeg
convert series of PPM frames to an MPEG movie
jpegtopnm
convert JFIF/JPEG/EXIF file to Netpbm format
pnmtojpeg
convert PPM to JPEG/JFIF/EXIF format
anytopnm
convert any graphics format to Netpbm format
bmptoppm
convert Windows or OS/2 Bitmap file to PPM
ppmtobmp
convert PPM to Windows or OS/2 Bitmap file
winicontoppm
convert Windows icon file to PPM
ppmtowinicon
convert PPM to Windows icon file
giftopnm
convert GIF to portable anymap
ppmtogif
convert PPM to GIF
pnmtopng
convert Netpbm format to Portable Network Graphics
pngtopnm
convert PNG (Portable Network Graphics) to Netpbm formats
palmtopnm
convert Palm pixmap to Netpbm formats
pnmtopalm
convert Netpbm formats to Palm pixmap
jbigtopbm
convert JBIG BIE (compressed bitmap) to PBM
pamtopnm
convert a PAM image to PBM, PGM, or PPM
pbmtojbig
convert PBM to JBIG BIE (compressed bitmap)
pnmtofiasco
convert Netpbm image to Fiasco (wfa) highly compressed format
fiascotopnm
convert Fiasco (wfa) highly compressed format to Netpbm image
hpcdtoppm
convert photo CD to PPM
pbmtonokia
convert PBM to Nokia Smart Messaging Format (SMF)
pbmtowbmp
convert PBM to WAP (Wireless App Protocol) Wireless Bitmap
wbmptopbm
convert WAP (Wireless App Protocol) Wireless Bitmap to PBM
neotoppm
convert Atari Neochrome (.neo) image to PPM
ppmtoneo
convert PPM image to Atari Neochrome (.neo)
pbmtomda
convert from PBM to Microdesign (for Amstrad PCWs)
mdatopbm
convert from Microdesign (for Amstrad PCWs) to PBM
atktopbm
convert Andrew Toolkit raster object to PBM
pbmtoatk
convert PBM to Andrew Toolkit raster object
brushtopbm
convert Xerox doodle brushes to PBM
cmuwmtopbm
convert CMU window manager format to PBM
g3topbm
convert Group 3 FAX to PBM
pbmtog3
convert PBM to Group 3 FAX
icontopbm
convert Sun icon to PBM
pbmtoicon
convert PBM to Sun icon
gemtopnm
convert GEM .img format to PBM or pixmap
macptopbm
convert MacPaint to PBM
pbmtomacp
convert PBM to MacPaint
mgrtopbm
convert MGR format to PBM
pbmtomgr
convert PBM to MGR format
pi3topbm
convert Atari Degas .pi3 to PBM
pbmtopi3
convert PBM to Atari Degas .pi3
xbmtopbm
convert X10 or X11 bitmap to PBM
pbmtoxbm
convert PBM to X11 bitmap
pbmtox10bm
convert PBM to X10 bitmap
ybmtopbm
convert Bennet Yee "face" file into PBM
pbmtoybm
convert PBM into Bennet Yee "face" file
pbmto10x
convert PBM to Gemini 10x printer graphics
pbmtoascii
convert PBM to ASCII graphic form
asciitopgm
convert ASCII character graphics to PGM
pbmtobbnbg
convert PBM to BBN BitGraph graphics
pbmtocmuwm
convert PBM to CMU window manager format
pbmtoepson
convert PBM to Epson printer graphics
pbmtogem
convert PBM into GEM .img file
pbmtogo
convert PBM to GraphOn graphics
pbmtolj
convert PBM to HP LaserJet black and white graphics
ppmtolj
convert PPM to HP LaserJet color graphics (PCL)
pjtoppm
convert HP PaintJet file to PPM
ppmtopj
convert PPM to HP PaintJet file
thinkjettopbm
convert HP Thinkjet printer stream to PBM
pbmtoplot
convert PBM into Unix plot(5) file
pbmtoptx
convert PBM to Printronix graphics
pbmtozinc
convert PBM to Zinc Interface Library icon
fitstopnm
convert FITS format to portable anymap
pnmtofits
convert Netpbm formats to FITS format
fstopgm
convert Usenix FaceSaver(tm) format to PGM
pgmtofs
convert PGM to Usenix FaceSaver(tm) format
hipstopgm
convert HIPS format to PGM
lispmtopgm
convert a Lisp Machine bitmap file into PGM format
pgmtolispm
convert PGM into Lisp Machine format
pnmtops
convert Netpbm formats to Postscript
pstopnm
convert Postscript to Netpbm formats
psidtopgm
convert PostScript "image" data to PGM
pbmtolps
convert PBM image to Postscript using lines
pbmtoepsi
convert a PBM image to encapsulated Postscript preview bitmap
pbmtopsg3
convert PBM images to Postscript using G3 fax compression.
rawtopgm
convert raw grayscale bytes to PGM
pgmtopbm
convert PGM to PBM
gouldtoppm
convert Gould scanner file to PPM
ilbmtoppm
convert IFF ILBM to PPM
ppmtoilbm
convert PPM to IFF ILBM
imgtoppm
convert Img-whatnot to PPM
mtvtoppm
convert MTV ray-tracer output to PPM
pcxtoppm
convert PC Paintbrush format to PPM
pgmtoppm
colorize a portable graymap into a PPM
pi1toppm
convert Atari Degas .pi1 to PPM
ppmtopi1
convert PPM to Atari Degas .pi1
picttoppm
convert Macintosh PICT to PPM
ppmtopict
convert PPM to Macintosh PICT
qrttoppm
convert QRT ray-tracer output to PPM
rawtoppm
convert raw RGB bytes to PPM
sldtoppm
convert an AutoCAD slide file into a PPM
spctoppm
convert Atari compressed Spectrum to PPM
sputoppm
convert Atari uncompressed Spectrum to PPM
tgatoppm
convert TrueVision Targa file to PPM
ppmtotga
convert PPM to TrueVision Targa file
ximtoppm
convert Xim to PPM
xpmtoppm
convert XPM format to PPM
ppmtoxpm
convert PPM to XPM format
yuvtoppm
convert Abekas YUV format to PPM
eyuvtoppm
convert Encoder/Berkeley YUV format to PPM
ppmtoeyuv
convert PPM to Encoder/Berkeley YUV format
ppmtoyuv
convert PPM to Abekas YUV format
ppmtoyuvsplit
convert PPM to 3 subsampled raw YUV files
yuvsplittoppm
merge 3 subsampled raw YUV files to one PPM
ppmtoacad
convert PPM to AutoCAD database or slide
ppmtoicr
convert PPM to NCSA ICR graphics
ppmtopcx
convert PPM to PC Paintbrush format
ppmtopgm
convert PPM to portable graymap
ppmtopuzz
convert PPM to X11 "puzzle" file
rasttopnm
convert Sun raster file to Netpbm formats
pnmtorast
convert Netpbm formats to Sun raster file
tifftopnm
convert TIFF file to portable anymap
pnmtotiff
convert Netpbm formats to TIFF RGB file
pnmtotiffcmyk
convert Netpbm formats to TIFF CMYK file
xwdtopnm
convert X10 or X11 window dump to Netpbm formats
pnmtoxwd
convert Netpbm formats to X11 window dump
pnmtoplainpnm
convert regular Netpbm format image into plain Netpbm format
pbmtopgm
convert PBM file to PGM by averaging areas
411toppm
convert 411 (Sony Mavica) to PPM
ppmtosixel
convert PPM to DEC sixel format
ppmtouil
convert PPM to Motif UIL icon file
sbigtopgm
convert Santa Barbara Instrument Group CCD file to PGM
vidtoppm
convert Parallax XVideo JPEG to sequence of PPM files
pnmtorle
convert PNM to Utah Raster Toolkit (urt/rle) file
rletopnm
convert Utah Raster Toolkit (urt/rle) file to PNM
ppmtoleaf
convert PPM to Interleaf
leaftoppm
convert Interleaf to PPM
bioradtopgm
convert Biorad confocal image to PGM
pbmtoln03
convert PGM image to Dec LN03+ Sixel image
pbmtopk
convert PBM image to packed format (PK) font
pktopbm
convert packed format (PK) font to PBM image