常用的tar和rpm命令参数列表

[不指定 2008/04/30 17:53 | by ipaddr ]
一. TAR
  1.压缩一组文件为tar.gz后缀。
  # tar cvf backup.tar /etc
  #gzip -q backup.tar
  或
  # tar cvfz backup.tar.gz /etc/
  
  2.释放一个后缀为tar.gz的文件。
  #gunzip backup.tar.gz
  #tar xvf backup.tar
  或
  # tar xvfz backup.tar.gz
  
  3.用一个命令完成压缩
  #tar cvf - /etc/ | gzip -qc > backup.tar.gz
  
  4.用一个命令完成释放
  # gunzip -c backup.tar.gz | tar xvf -
  
  5.如何解开tar.Z的文件?
  # tar xvfz backup.tar.Z
  或
  # uncompress backup.tar.Z
  #tar xvf backup.tar
  
  6.如何解开.tgz文件?
  #gunzip backup.tgz
  
  7.如何压缩和解压缩.bz2的包?
  #bzip2 /etc/smb.conf
  这将压缩文件smb.conf成smb.conf.bz2
  #bunzip2 /etc/smb.conf.bz2
  这将在当前目录下还原smb.conf.bz2为smb.conf
  注: .bz2压缩格式不是很常用,你可以man bzip2
  
二. RPM
  
  1.安装一个包
  # rpm -ivh
  
  2.升级一个包
  # rpm -Uvh
  
  3.移走一个包
  # rpm -e
  
  4.安装参数
  --force 即使覆盖属于其它包的文件也强迫安装
  --nodeps 如果该RPM包的安装依赖其它包,即使其它包没装,也强迫
  安装。
  
  5.查询一个包是否被安装
  # rpm -q < rpm package name>
  
  6.得到被安装的包的信息
  # rpm -qi < rpm package name>
  
  7.列出该包中有哪些文件
  # rpm -ql < rpm package name>
  
  8.列出服务器上的一个文件属于哪一个RPM包
  #rpm -qf
  
  9.可综合好几个参数一起用
  # rpm -qil < rpm package name>
  
  10.列出所有被安装的rpm package
  # rpm -qa
  
  11.列出一个未被安装进系统的RPM包文件中包含有哪些文件?
  # rpm -qilp < rpm package name>

Apt和dpkg快速参考

[不指定 2008/04/30 17:43 | by ipaddr ]

Debian官方文档: http://www.debian.org/doc/user-manuals
Debian官方APT中文文档: http://www.debian.org/doc/manuals/apt-howto/index.zh-cn.html
来源:互联网
整理:鱼漂 admin.net(#)163.com


apt-cache search # ------(package 搜索包)
apt-cache show #------(package 获取包的相关信息,如说明、大小、版本等)
apt-get install # ------(package 安装包)
apt-get install # -----(package --reinstall 重新安装包)
apt-get -f install # -----(强制安装, "-f = --fix-missing"当是修复安装吧...)
apt-get remove #-----(package 删除包)
apt-get remove --purge # ------(package 删除包,包括删除配置文件等)
apt-get autoremove --purge # ----(package 删除包及其依赖的软件包+配置文件等(只对6.10有效,强烈推荐))
apt-get update #------更新源
apt-get upgrade #------更新已安装的包
apt-get dist-upgrade # ---------升级系统
apt-get dselect-upgrade #------使用 dselect 升级
apt-cache depends #-------(package 了解使用依赖)
apt-cache rdepends # ------(package 了解某个具体的依赖,当是查看该包被哪些包依赖吧...)
apt-get build-dep # ------(package 安装相关的编译环境)
apt-get source #------(package 下载该包的源代码)
apt-get clean && apt-get autoclean # --------清理下载文件的存档 && 只清理过时的包
apt-get check #-------检查是否有损坏的依赖
dpkg -S filename -----查找filename属于哪个软件包
apt-file search filename -----查找filename属于哪个软件包
apt-file list packagename -----列出软件包的内容
apt-file update --更新apt-file的数据库

dpkg --info "软件包名" --列出软件包解包后的包名称.
dpkg -l --列出当前系统中所有的包.可以和参数less一起使用在分屏查看. (类似于rpm -qa)
dpkg -l |grep -i "软件包名" --查看系统中与"软件包名"相关联的包.
dpkg -s 查询已安装的包的详细信息.
dpkg -L 查询系统中已安装的软件包所安装的位置. (类似于rpm -ql)
dpkg -S 查询系统中某个文件属于哪个软件包. (类似于rpm -qf)
dpkg -I 查询deb包的详细信息,在一个软件包下载到本地之后看看用不用安装(看一下呗).
dpkg -i 手动安装软件包(这个命令并不能解决软件包之前的依赖性问题),如果在安装某一个软件包的时候遇到了软件依赖的问题,可以用apt-get -f install在解决信赖性这个问题.
dpkg -r 卸载软件包.不是完全的卸载,它的配置文件还存在.
dpkg -P 全部卸载(但是还是不能解决软件包的依赖性的问题)
dpkg -reconfigure 重新配置

源地址:http://ubuntuforums.org/showthread.php?t=280473&
Update: November 18, 2007

A few of the downsides on the Nexstar LX NAS device that I purchased is that:
1. It does not support CIFS
2. It does not support SATA drives (IDE only)
3. It is 10/100 Mbps (no gigabit)
4. It does not have any fault tolerance.  

网上邻居的中文目录的显示乱码

  • 确认你的local,如果为:zh_CN.UTF-8 则:

在 /etc/samba/smb.conf 中的 [global] 段加上:

display charset = UTF-8
unix charset = UTF-8
dos charset = cp936
  • 确认你的local,如果为:zh_CN.GB2312 zh_CN.GBK 则:

在 /etc/samba/smb.conf 中的 [global] 段加上:

display charset = cp936
unix charset = cp936
dos charset = cp936
  • 设置完毕後,需要注销一次。才可以看到中文的目录。
  • 如果对方也是Linux并且Samba的版本过低,也会出现乱码,并且设置无效,请升级对方的Samba的版本。
提示:使用Nautilus访问网上邻居的办法:[文件]=>[连接到服务器],服务器类型选择[Windows供享]。
访问前可能还需要:sudo apt-get install smbfs

从windows转移到ubuntu的用户,常常会发现自己在windows在创建/下载/保存的文件经常性出现乱码问题(kubuntu出现问题 的可能性更高一些)。而使用默认播放器打开以往的音乐文件(mp3等)时,出现乱码的机会更是接近100%。出现这个问题是因为文件或是文件标签编码并不 是系统默认的UTF8,而windows系统默认使用的是GBK。只要将文件编码做一下转换就解决乱码的问题。

  • 需要用到的工具
 sudo apt-get install convmv iconv python-mutagen

要转换文件编码请先进入要转换文件的目录

  • 转换文件名由GBK为UTF8
 convmv -r -f cp936 -t utf8 --notest --nosmart *
  • 转换文件内容由GBK到UTF8
 iconv -f gbk -t utf8 $i > newfile 
  • 转换 mp3 标签编码
 find . -iname “*.mp3” -execdir mid3iconv -e GBK {} \;

注意:保证自己对需转换文件有写权限

享受蓝色的Ubuntu:Blubuntu

[不指定 2008/04/27 19:22 | by ipaddr ]
很多朋友都不喜欢Ubuntu那黄黄的主题,安装好Ubuntu后的第一件事就是更换自己喜欢的主题。

你是否知道,Ubuntu事实上已经为你准备了一套蓝色的主题呢?还包括墙纸、边框和控件!

相信你一定会喜欢的!这个主题就是Blubuntu。

 

Blubuntu来自Ubuntu官方Wiki上, 目的是提供一个蓝色的又与原本黄色主题风格相似的一套完整的主题。

用它非常简单,因为是Ubuntu官方的,所以只要打一条命令从源里安装即可。

sudo apt-get install blubuntu-look

默认情况下, 它会安装上包括GDM、会话Splash、主题和墙纸在内的所有主题元素,一次性搞定,再也不必自己搭配了吧!

安装好后,可以到“系统”->“首选项”->“外观”来启用它,名字就是Blubuntu。

在/etc/X11目录下有一个xorg.conf文件,鼠标的配置就是在这里了。在这个目录下,你还会 发现另一个文件,叫 xorg.conf.BeforeVMwareToolsInstall,看这个文件名和内容,应该是vmware-tools装完后,对 xorg.conf修改了,所以做了一个备份,进后入,看鼠标配置的几个参数,有一个明显是不同的,配置如下:
Section "InputDevice"
   Identifier "Mouse0"
   Driver "mouse"
   Option "Protocol" "IMPS/2"
   Option "Device" "/dev/input/mice"
   Option "ZAxisMapping" "4 5"
   Option "Emulate3Buttons" "yes"
EndSection
这是备份里的配置,而xorg.conf的配置是:
Section "InputDevice"
   Identifier "Mouse0"
   Driver "mouse"
   Option "Protocol" "ps/2"
   Option "Device" "/dev/input/mice"
   Option "ZAxisMapping" "4 5"
   Option "Emulate3Buttons" "yes"
EndSection
看出来了吧。呵呵,把那个ps/2改成IMPS/2,然后,重启了一下机器。鼠标滚轮终于可以用了。
(鱼漂提醒:Ubuntu 8.04当中,需要增加Option "Protocol",以及修改Driver)

Upstart is an event-based replacement for the /sbin/init daemon which handles starting of tasks and services during boot, stopping them during shutdown and supervising them while the system is running.

It was originally developed for the Ubuntu distribution, but is intended to be suitable for deployment in all Linux distributions as a replacement for the venerable System-V init.

http://upstart.ubuntu.com/

所以,在ubuntu下面,没有/etc/inittab文件。

概要

本文分步介绍了如何将一个文件夹复制到另一个文件夹中并保留其权限。

当您使用 Windows Explorer 复制或移动文件和文件夹时,在这些文件或文件夹上设置的权限可能会发生改变。例如,当您在一个 NTFS 文件系统卷内或在两个 NTFS 卷之间复制一个文件时,Windows 2000 将把它当作一个新文件。作为一个新文件,它将具有目标文件夹的权限,您将成为“创建者所有者”。

注意:您必须对目标文件夹具有“写”权限才能复制文件和文件夹。

可以使用带 /O/X/E/H/K 开关的 Xcopy 命令复制文件并保留已明确应用于这些文件的现有权限。

这些开关具有下列作用:
/E - 复制文件夹和子文件夹,包括空文件夹。
/H - 还复制隐藏文件和系统文件。
/K - 复制属性。一般情况下,Xcopy 将重置只读属性。
/O - 复制文件所有权和 ACL 信息。
/X - 复制文件审核设置(暗含 /O)。
注意:此操作过程不会覆盖继承的权限。使用带 /O /X /E /H /K 开关的 Xcopy 命令复制文件时,将应用下面的继承权限:
直接分配到文件和文件夹的安全设置将被保留。
从源父文件夹中继承的安全设置将丢失。
目标文件夹的安全设置将被继承。
当您将文件或文件夹移动到 FAT 卷时,这些文件夹和文件将丢失它们的 NTFS 权限,因为 FAT 卷不支持 NTFS 权限。
有关继承的更多信息,请参见 Windows 帮助中的“更改继承的权限”主题。

将一个文件夹复制到另一个文件夹中并保留其权限

1.单击开始,然后单击运行
2.打开框中,键入 cmd,然后单击确定
3.键入 xcopy source destination /O /X /E /H /K ,然后按 Enter,其中 source 是要复制的文件的源路径,destination 是这些文件的目标路径。

示例

键入 xcopy c:\olddocs c:\newdocs /O /X /E /H /K,然后按 Enter,其中 olddocs 是源文件夹,newdocs 是目标文件夹。

有关 Xcopy 开关的更多信息,请在命令提示符下键入 xcopy /?,然后按 Enter。 有关 Xcopy 开关的其他信息,请单击下面的文章编号,以查看 Microsoft 知识库中相应的文章:
240268 (http://support.microsoft.com/kb/240268/) Windows 中的 COPY、XCOPY 和 MOVE 覆盖功能发生更改

How to config Remote Desktop

[不指定 2008/04/21 15:23 | by ipaddr ]

如何配置远程桌面服务,禁用打印机重定向。

参考微软文档: http://technet.microsoft.com/en-us/library/bb457106.aspx


To access Terminal Services Group Policy
  1. From the Start menu, click Run, type mmc, and then click OK.

  2. On the File menu, click Add/Remove Snap-in.

  3. In the Add/Remove Snap-in dialog box, click Add.

  4. In the Add Standalone Snap-in dialog box, click Group Policy, click Add, and then click Finish.

  5. In the Add Standalone Snap-in dialog box, click Close.

  6. In the Add/Remove Snap-in dialog box, click OK.

  7. In the console pane, double-click Computer Configuration, click Administrative Templates, click Windows Components, and then click Terminal Services.

(鱼漂提醒你,也可以直接运行gpedit.msc命令)

Terminal Services Group Policies are organized individually and in folders. Table 8-4 lists some of the Terminal Services Group Policy folders, policies, and functions that affect Remote Desktop.

Table 8-4 Group Policy Settings That Affect Remote Desktop

Folder

Group Policy

Function

Terminal
Services

Allow users to connect remotely using Terminal Services

Enables Remote Desktop on computers targeted by this policy.

Automatic reconnection

Allows Remote Desktop Connection clients to automatically reconnect if the network link is temporarily lost.

Limit maximum color depth

Sets a limit on the color depth of any connection to a terminal server or Remote Desktop.

Client/Server Data Redirection

Allow audio redirection

Allows users to play the remote computer audio at the local computer during a Remote Desktop session.

Do not allow clipboard redirection

Disables sharing of clipboard contents.

Do not allow drive redirection

Disables mapping of client drives in Remote Desktop sessions.

Do not allow COM port redirection

Disables redirection of data from the remote computer to client COM ports during the Remote Desktop session.

Do not allow client printer redirection

Disables mapping of client printers in Remote Desktop sessions.

Do not allow LPT port redirection

Disables redirection of data from the remote computer to client LPT ports during the Remote Desktop session.

Do not set default client printer to be default printer in a session

Directs Terminal Services to automatically not specify the client printer as the default printer in the Remote Desktop session.

Encryption and Security

Always prompt client for password upon connection

Directs Terminal Services to always prompt users for passwords at logon.

Set client connection encryption level

Directs Terminal Services to enforce the specified encryption level for all data sent between the client and the remote computer during Terminal Services connections.

Client

Do not allow passwords to be saved

Controls whether passwords can be saved on this computer from Terminal Services clients. This setting is available only for Window XP Service Pack 2.

分页: 1/2 第一页 1 2 下页 最后页 [ 显示模式: 摘要 | 列表 ]