linux-文件挂载

软件安装

rpm   -qf (query  file)  tigervnc  (查看该软件安装文件)

rpm  -ivh (install verbose hash) 全文名

rpm   -ql (query location) tigervnc  (查看文件的安装好的文件)

rpm   -ql (query location) tigervnc | less  (分段显示)

rpm   -e  (erase:移除)  vnc   

 

rpm   -qi   tigervnc   (查看软件信息)

rpm   -q    tigervnc  (查看软件是否安装)

rpm

查看软件依赖关系

rpm   -qf (query file)  tigervnc

模糊查询

rpm   -qa  tiger |  less    

或者 rpm   -qa | grep  tigervnc.*

rpm -qa | grep vnc(模糊查询到带vnc[*vnc*]的软件)

软件卸载                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  

rpm   -e  (erase:移除)  vnc   

 

 

查看yum已安装软件列表

yum  list | grep 查询的软件名(模糊,精确,不带.rpm)

@开头的,说明已将安装了的软件

没有@开头的,出现yum_ID的名字,说明yum源里面有安装包,但是没有安装

 

软件组安装

yum  -y  groupinstall  "Graphics Creation Tools"

yum  groupremove  " Graphics Creation Tools"

查看软件组列表

yum   grouplist |  grep 模糊或精确软件名

软件组删除

yum  groupremove   " Graphics Creation Tools"

 

 

文件挂载(命令手动挂载)

查看挂载

mount  / df   -Th

mount   /dev/cdrom (挂载到该目录下,存在问题:可能覆盖其他已存在文件)

 

 

mount  /dev/cdrom   /tm/mnt  (挂载到/tm/mnt下,但是会截断对原有文件访问(改为访问光盘挂载目录),若需要进行访问原有文件,需要截断光盘连接:卸载 umount

 

umout  /tm/mnt  /dev/cdrom (原光盘目录,挂载目录)

 

fdisk -l 查看存在光盘和可挂载的光盘

 

练习:查看光盘的文件数

ll  >> /tmp/a.txt

ll  | wc  -l(line)  (word count)

-l()   -w(单词)   -c  (char)

line     word     char

 

 

错误:卸载光盘时,要在挂载点的上一目录(父目录)

或者该光盘正在被其它软件或服务使用,依赖

解决:cd  ..    umount   /dev/rhel

 

 

注:redhat6.5  卸载光盘目标目录,会删除目标目录,其它不会所以 删除源目录

 

 

 

本地循环挂载(无光驱挂载本地文件)

mount  -o loop  -t (typeauto) iso9660 镜像名  所在目录

进行NFS创建时,添加针对某个用户的权限,需加:

mount  -o  acl  /dev/sdb2   /nfs-server

 

yum 操作

重写yum相关的repo文件

1 删除/etc/yum.repos.d/下的repo文件

2 新建相应的repo文件

3 编辑:

区别名称: [jerry]

name:描述信息  mayadong

baseurl:绝对路径 http:///www.baid.com ,file:///mnt/jack[l挂载光盘rhepackages目录下的所有rpm文件]

http://192.168.1.250/rhel6u5(远程yum源上面有一个apache服务器)

ftp://192.168.1.250/rhel6u5(ftp服务器)

 

enabled是否可用[0 禁用,1可用]

gpgcheck :是否进行文件传输时gpgcheck检测 0:不检测 1:检测

 

注:yum   repolist 值是0

原因1 .repo 配置文件路径有问题

     2  对于rhel 光盘未挂载

光盘掉了需要  yum  clean  all

 

然后重新挂载后进行可管理包数量统计

 

yum安装软件

yum   install   vnc

 

yum卸载软件

yum  erase/remove  vnc

 

 

图形化linux影响yum使用(重复出现)

 影响yum卸载软件

rm -rf /usr/bin/packagekit

 ps -ef | grep packagekit

 

yum查找

yum  search  vnc*

yum  list | grep vnc*

yum  list | less  分屏查看

yum 软件组安装

yum   grouplist

yum   groupinstall

1.用双引号把名字括起来

# yum groupinstall "Graphics Creation Tools"

2.转义字符

# yum  groupinstall Graphics\ Creation\ Tools

gzip  z

bzip2  j

解压压缩包:x. cpio.gz

gunzip  x.cpio.gz

cpio    -idcmv   < x.cpio

解压压缩包:x.zip

unzip   x.zip

 

 

错误提示:需要指定文件类型;即挂载的不是格式化后的硬盘(创建文件系统) 未创建文件系统

解决方法:指定已经格式化的文件系统  mkfs.ext4   / dev/sdb1

mkfs.ext3/.xfs   /dev/sdb1

 

 

文件系统,光盘无法卸载

1.查看需要卸载的文件

mount

 

2.卸载

umount /nfs_client/

 

若遇到设备忙:

umount.nfs: /nfs_client: device is busy

 

>a 查看对应的服务名,然后根据线程

ps -ef | grep nfs

>b 杀死该文件服务

pkill  -9 4850

>c 查看是否被杀死

ps -ef  |  grep nfs

>d  强制卸载

umount  -f /nfs_client/

 

>e若强制卸载无法成功,查看属于当前用户应服务的线程

fuser   -ck  /nfs_client/

/nfs_client/:         5075c

 

>f 杀死当前用户的服务线程

 pkill -9 5075

>g 强制卸载 ,然后查看

 umount  -f  /nfs_client/

 

lsof-----查看打开的文件数

 

如果在卸载设备时,系统提示设备繁忙,无法卸载设备,通常是有进程还在访问该设备或使用该设备上的文件。

这时可用lsof命令获得使用它的进程信息,然后在应用中停止使用该设备或停止该进程。

lsof命令的用法很简单:

lsof   /path/to/device/node

或者lsof  /path/to/mount/point

 

你可能感兴趣的:(vim,redhat)