[转]UBUNTU一句话技巧--Linux入门(给新手)


查看软件xxx安装内容
dpkg -L xxx 


查找软件 
apt-cache search 正则表达式 


查找文件属于哪个包
dpkg -S filename           apt-file search filename


查询软件xxx依赖哪些包
apt-cache depends xxx

查询软件xxx被哪些包依赖
apt-cache rdepends xxx


增加一个光盘源
sudo apt-cdrom add

系统升级
sudo apt-get update       sudo apt-get upgrade       sudo apt-get dist-upgrade 


--------------------------------------------------------------------------------
编译时缺少h文件的自动处理
sudo auto-apt run ./configure 


查看安装软件时下载包的临时存放目录 ls /var/cache/apt/archives 

备份当前系统安装的所有包的列表 dpkg --get-selections | grep -v  deinstall > ~/somefile 

从上面备份的安装包的列表文件恢复所有包
dpkg --set-selections 清理旧版本的软件缓存
sudo apt-get autoclean

清理所有软件缓存
sudo apt-get clean

删除系统不再使用的孤立软件
sudo apt-get autoremove 
----------------------------------------------------------------------
查看内核
uname -a

查看ubuntu版本
cat /etc/issue

查看内核加载的模块
lsmod

查看PCI设备
lspci

查看网卡状态
sudo ethtool eth0

查看USB 设备
lausb

查看cpu信息
vat /proc/cpuinfo

查看当前硬件信息
Lshw

--------------------------------------------------------------------------------

查看硬盘的分区
sudo fdisk -l

查看IDE硬盘信息
sudo hdparm -i /dev/hda

查看sata硬盘信息
sudo hdparm -I /dev/sda
或 sudo apt-get install blktool        sudo blktool dev/sda id

查看硬盘胜于空间
df -hdf -H

查看目录占用空间
du -hs  目录名

U盘无法卸载
syncfuser -km /media/usbdisk

查看当前内存使用情况
free -l

--------------------------------------------------------------------------------
查看当前进程
ps -A

杀死一个进程
kill  进程号(就是 ps -A 中第一列数字  或者 killall 进程名)

强制杀死一个进程(上面的方法没有成功时)
kill -9 进程号   或者 killall -9  进程名

查看当前进程的实时状况
top

查看进程打开的文件
lsof -p

配置 ADSL
sudo pppoeconf

ADSL 手工拨号
sudo pon dsl-provider

激活 ADSL
sudo /etc/ppp/pppoe_on_boot

断开ADSL
sudo poff

查看拨号日志
sudo plog

根据IP查看网卡地址
atping IP地址

查看当前IP地址
sudo ifconfig eth0 |awk '/inet addr/{split($2,x,":");print x[2]}'

查看当前外网的IP地址
w3m -no-cookie -dump ip.loveroot.com |grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}'

查看当前监听80端口的程序
lsof -i :80

--------------------------------------------------------------------------------
查看当前网卡的物理地址 
sudo arp -a | awk '{print $4}'
sudo ifconfig eth0 | head -1 | awk '{print $5}'

立即让网络支持nat 
sudo echo 1 >/proc/sys/net/ipv4/ip_forward
sudo iptables -t nat -I POSTROUTING - j MASQUERADE

查看路由信息netstat -rn
sudo route -n

手工增加删除一条路由
sudo route add -net 192.168.0.0
netmask 255.255.255.0 gw 172.16.0.1
sudo route del -net 192.168.0.0
netmask 255.255.255.0 gw 172.16.0.1

修改网卡MAC地址的方法
sudo ifconfig eth0 down #关闭网卡
sudo ifconfig eth0 hw ether 00:AA:BB:CC:DD:EE #然后改地址
sudo ifconfig eth0 up #然后启动网卡 

--------------------------------------------------------------------------------
添加一个服务sudo update-rc.d 服务名 defaults 99

删除一个服务
sudo update-rc.d 服务名 remove

临时重启一个服务
/etc/init.d/服务名 restart

临时关闭一个服务
/etc/init.d/服务名 stop

配置默认Java使用哪个sudo update-alternatives --config java

修改用户资料
sudo chfn userid

给apt设置代理
export 
http_proxy=http://xx.xx.xx.xx:xxx 

修改系统登录信息
sudo vim /etc/motd

转换文件名由GBK为UTF8
sudo apt-get install convmv
convmv -r -f cp936 -t utf8 --notest --nosmart * 

快速查找某个文件
whereis filename
find 目录 -name 文件名

查看文件类型
file filename

显示xxx文件倒数6行的内容
tail -n 6 xxx 

转载于:https://my.oschina.net/comguo/blog/150484

edjpgcom is a free Windows application that allows you to change (or add) a JPEG commment in a JPEG file. That's all it does. All other fields in a JFIF or Exif file are left untouched. It even keeps the filesystem timestamp! It's based on the rdjpgcom and wrjpgcom utilities from the Independent JPEG Group's 6b distribution. (Heck, it's essentially these two programs combined with a basic dialog control.) Installation: ------------- Copy the executable egjpgcom.exe someplace convenient. It's completely self contained and uses no registry entries. Usage: ------ edjpgcom "filename.jpg" The quotes around the filename are *required* (Don't ask.) A dialog will popup. The text area will contain any existing comment text. You can cut and paste using the usual Ctrl-C, Ctrl-V, Ctrl-X. If you press OK, this text will be added to your file and a backup file will be created with the same name as your file but with a ".bak" added. If you don't want this backup file, check the 'Delete Backup?' checkbox. Of course pressing Cancel will exit without doing anything. If you want to delete a comment, just delete all the comment text. Edjpgcom will then delete the comment section. Now I don't really expect this program to be used from the command line. Instead, I assume that you will add it to either the external programs list of another editing/managment program OR add it to the context menu for JPEG files in windows. NOTE: Changing file associations akin to editing your registry. Be careful and be sure you know how to undo anything you might have done. For example, in Windows 98: * open Windows Explorer * View -> Folder Options * select the "File Types" tab * Find and select the JPG file type(s) NOTE: Sometimes you may not be able to find the JPG File types If this happens see below. * press the "Edit" button * press the "New" button * for the "Action:" enter Comment * for the "Application used..." enter "c:\full\path\to\edjpgcom.exe" "%1" where the quotes are important (if you do not use quotes around the program path name, Windows may assume only short filenames can be passed to the program) and replacing c:\full\path\to with the correct directory path where you put the executable. Now "Comment" should appear when you right-click on a JPEG file. This works well in combination with "View as webpage" or "Thumbnails". In Win2k, the procedure is the same except you get to the add action dialog this way: * Open "Windows NT Explorer" * Tools -> Folder Options * select the "File Types" tab * Find and select the JPG file type(s) * press the "Advanced" button NOTE: Sometimes you may not be able to find the file type associated with .jpg files. This usually happens after several programs have reset your file associations. I use an utility from PC Mag called "Freedom of Association" to reassign the .jpg extension to a registered type. Another alternative is to add a shortcut to egjpgcom.exe to your Windows "Send To" directory. You can then send a file to edjpgcom. It will politely refuse to handle a non-jpeg file. If you use ThumbsPlus to manage your photos (highly recommended), you can add edjpgcom as an external program using the following steps: * Right-click on the tool bar to bring up the customization window * Press the "External Programs" button * Enter the full pathname to edjpgcom.exe in the Program box. * Make sure the "Short Names", "multiple files" and DDE are NOT checked. Now you will have an icon on your toolbar and a menu item on the right-click popup window for image files. Template File ------------- If the environment variable EDJPGCOM_TEMPLATE exists and points to a readable file, then the contents of this file will be used as the default comment when adding a comment to a file that does not already have one. License: -------- Permission to use this software for any purpose, without fee, is hereby granted. THIS SOFTWARE IS BEING PROVIDED AS IS, without any express or implied warranty. If you like it send me one of your photos (email or a postcard) at: edjpgcom@yahoo.com Erik Magnuson 7490 Windover Way Titusville, FL 32780 Send comments/bug reports to edjpgcom@yahoo.com. How it works: ------------- When egjpgcom starts, it opens the file, extracts the comments and then closes the file again. When you press OK, it creates a temporary file with the same path and filename as the original, but with an random 3 digit extension instead of ".jpg". It then copies the header data from the original file, the new comment, and the rest of the original file to this temporary file. It closes the temp file and attempts to rename the original file to ".bak". If this succeeds, it will rename the temporary file to have the original filename. Last, it deletes the backup file if that options is selected. What this means is that if egjpgcom should crash for any reason, you should still have your original file (unless you deleted it!). You might have to clean up a .nnn file but that's it. It's been tested on Win2k, NT 4.0 SP5, Win95a, Win98, and Win98SE. Limitations: ------------ * The egjpgcom program itself only supports a single filename as input. However, if multiple files are selected and "Add Comments" context menu is chosen, multiple copies of egjpgcom will be started. Hopefully, the filename in the title bar will help you figure out which is which. * While a JPEG comment field can up to 64k chars, edjpegcom is limited to 32000 characters by the Win32 edit dialog. * egjpgcom uses the DOS/Windows CRLF convention for line terminators. It will convert any plain CR or LF to a CRLF pair. * edjpgcom has not been tested with multiple COM sections in a single file. * edjpgcom does not get any comment data from other comment fields like Photoshop FileInfo (IPTC/NAA subset) Exif ImageDescription Exif UserComment * Error messages are primitive. Credits: -------- This software is based in part on the work of the Independent JPEG Group. Thanks to Jacob Navia for lcc-win32. rec.photo.digital for all the information. History: -------- 17 Feb 2001 v0.1 foisted upon an indifferent world 19 Feb 2001 v0.2 Fixed Win9x file creation timestamp (well, it worked on Win2k!) 10 Apr 2001 v0.3 Deletes comment section if empty comment entered Does not write file is comment text unchanged and "OK" pressed. Added a simple program icon. 19 Dec 2001 v0.4 Larger dialog box size Defaults to delete backup Optional template file if empty comment block. ------------------------------ 可以在正常的图片中插入一句话代码。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值