ubuntu下的各种命令及说明

来源:互联网 发布:ubuntu怎么重新分区 编辑:程序博客网 时间:2024/06/07 23:47

        一, 查看有线网卡和无线网卡型号的命令:lspci|grep -i net   ,   查询结果

          00:19.0 Ethernet controller: Intel Corporation Ethernet Connection I218-V (rev 04) (有线网卡型号)
          04:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8723BE PCIe Wireless Network Adapter(无限网卡型号)

       二,获取root权限命令: su , 第一次使用到时候需要另外设置, 这个在另外一篇博客专门记录;

       三,以root 的身份执行命令: sudo   , 在执行的命令前加上该命令,表名以root身份执行。

       四,安装软件命令,一共三种方式:

          1,APT方式:

           (1) 普通安装: apt-get install 软件名1 软件名2...;   如 apt-get install install qq yy

           (2) 修复安装: apt-get -f install  软件名1 软件名2...;   如 apt-get -f install install qq yy

           (3) 重新安装: apt-get --reinstall install 软件名1 软件名2...;   如 apt-get --reinstall install -f install install qq yy

        2,  Dpkg方式:dpkg -i package_name.deb;         

        3, 源码安装:

           (1),  *.tar.gz 格式 : sudo tar xvf  源码包名字, 如:sudo tar xvf jdk-7u79-linux-x64.tar.gz, 这里注意,如果加上 sudo, 那么在执行删除的操作的时候,也要加 sudo 才行。如果要解压到指定目录, tar xfv 源码包命 -C 目的路径, 如  tar xvf jdk-7u79-linux-x64.tar.gz -C /sur/local


        五,卸载软件命令,两种方式:

         1,APT方式:

             (1) 仅卸载软件:apt-get remove 软件名1 软件名2..; 如 apt-get remove qq yy

           (2) 卸载软件及其配置文件: apt-get --purge remove  软件名1...:  如 apt-get --purge -remove qq;

           (3) 卸载软件及其配置文件: apt-get purge 软件名1...:  如 apt-get purge -remove qq; 貌似与 (2)一样。

         2,Dpkg方式:

           (1) 仅卸载软件: dpkg -r 包名1 包名2;

           (2) 卸载软件及配置文件: dpkg -P 包名1 包名2;


         六, 查看 linux 内核命令: uname -a 。 查询结果: Linux hinkPad-E450c 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux。    其中 Linux 表示 linux 系统, hinkPad-E450c 表示我电脑名字,  3.13.0-32-generic 表示我内核版本。


         七, echo 命令: echo 命令是shell 编程里面一个很常用到命令, 它要结合别到命令来使用, 如下:

           1, echo "options rtl8723be fwlps=0 swlps=0" > /etc/modprobe.d/rtl8723be.conf , 这个命令是结合 > 来使用的,

表示往/etc/modprobe.d 这个目录下的 rtl8723be.conf 这个文件写入options rtl8723be fwlps=0 swlps=0 这段文本内容。

2, echo $PATH , 这个命令是用来查看环境变量的。

          八,查看已安装的软件版本号: apt-cache show 软件名, 如 apt-cache show python.  

         九,查看磁盘使用空间命令: df -h 。

         十,查看swap(交换空间)和内存的大小及使用: free -m

         十一, 删除文件夹及文件夹下面的所有文件: rm -rf 文件夹名 , 如 rm -rf qq

         十二, 查询某个具体文件的位置: locate 文件名  , 如 locate gitconfig

         十三, 查询ubuntu版本命令:cat /etc/issue




0 0