linux的事

    技术2026-06-16  9

    Ubuntu 安装curses函数库 sudo apt-get install libncurses5 libncurses5-dev

     

     

     

    login shell和no login shell的区别

    一般标准的login shell(不单止bash)启动时都会去读取 /etc/profile文件还有用户家目录下的 .profile文件 所以可以在这些地方做一些变量设置 如语言编码,$HOME,$PS1,$PATH,umask,JAVA_HOME... 在login shell中再启动shell就是no login shell 对于bash来说是只读取家目录下的 .bashrc 但是在这个no login shell中它会继承login shell设置的变量 一个典型的情况是我们的X windows系统,其实它是个特殊的login shell

     

     

     

    格式:  tar  选项  文件目录列表 功能:  对文件目录进行打包备份 选项: -c  建立新的归档文件 -r  向归档文件末尾追加文件 -x  从归档文件中解出文件 -O  将文件解开到标准输出 -v  处理过程中输出相关信息 -f  对普通文件操作 -z  调用gzip来压缩归档文件,与-x联用时调用gzip完成解压缩 -Z  调用compress来压缩归档文件,与-x联用时调用compress完成解压缩   例如: 1.将当前目录下所有.txt文件打包并压缩归档到文件this.tar.gz,我们可以使用 tar czvf this.tar.gz ./*.txt 2.将当前目录下的this.tar.gz中的文件解压到当前目录我们可以使用 tar xzvf this.tar.gz ./

     

     

    关于内核编译

     

    19:54

    make mrproper

     

    make menuconfig或make config或make xconfig

     

    进行目录化配置时,出现如下问题 #make menuconfig    //键入之后 出现 *** Unable to find the ncurses libraries or the  *** required header files.  *** 'make menuconfig' requires the ncurses libraries.  ***  *** Install ncurses (ncurses-devel) and try again.  *** make[1]: *** [scripts/kconfig/dochecklxdialog] 错误 1 make: *** [menuconfig] 错误 2 #sudo apt-get install ncurses-dev     //键入即可 ncurses 用于make menuconfig界面显示 进行图形化配置编译时 #make xcongfig   CHECK   qt * * Unable to find the QT3 installation. Please make sure that * the QT3 development package is correctly installed and * either install pkg-config or set the QTDIR environment * variable to the correct location. * sed < scripts/kconfig/lkc_proto.h > scripts/kconfig/lkc_defs.h 's/P(/([^,]*/),.*/#define /1 (/*/1_p)/'   HOSTCC  scripts/kconfig/kconfig_load.o make[1]: *** 没有规则可以创建“scripts/kconfig/qconf.o”需要的目标“scripts/kconfig/.tmp_qtcheck”。 停止。 make: *** [xconfig] 错误 2 root@wang-desktop:/home/test/linux-2.6.33.2# su -c'yum groupinstall chinese-support' bash: yum:找不到命令 根据http://forum.ubuntu.org.cn/viewtopic.php?t=110461&highlight= 我们知道除了安装ncurses外,还要安装build-essential 和 kernel-package 那么我们就将其安装上 #sudo apt-get install kernel-package #sudo apt-get install build-essential

     

    #sudo apt-get install kernel-package 这个没有装上 所以采用的 make menuconfig

     

     

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

     

    1. 查看内核版本命令:

    1) [root@q1test01 ~]# cat /proc/version   Linux version 2.6.9-22.ELsmp (bhcompile@crowe.devel.redhat.com) (gcc version 3.4.4 20050721

    3.4.4-2)) #1 SMP Mon Sep 19 18:00:54 EDT 2005

    2) [root@q1test01 ~]# uname -a   Linux q1test01 2.6.9-22.ELsmp #1 SMP Mon Sep 19 18:00:54 EDT 2005 x86_64 x86_64 x86_64 GNU/Linux

    3) [root@q1test01 ~]# uname -r   2.6.9-22.ELsmp

     

    2. 查看linux版本:

    1) 登录到服务器执行 lsb_release -a ,即可列出所有版本信息,例如:

       [root@3.5.5Biz-46 ~]# [root@q1test01 ~]# lsb_release -a   LSB Version:    :core-3.0-amd64:core-3.0-ia32:core-3.0-noarch:graphics-3.0-amd64:graphics-3.0-

       ia32:graphics-3.0-noarch   Distributor ID: RedHatEnterpriseAS   Description:    Red Hat Enterprise Linux AS release 4 (Nahant Update 2)   Release:        4   Codename:       NahantUpdate2   注:这个命令适用于所有的linux,包括Redhat、SuSE、Debian等发行版。

    2) 登录到linux执行cat /etc/issue,例如如下:

       [root@q1test01 ~]# cat /etc/issue   Red Hat Enterprise Linux AS release 4 (Nahant Update 2)   Kernel /r on an /m

    3) 登录到linux执行cat /etc/redhat-release ,例如如下:

       [root@q1test01 ~]# cat /etc/redhat-release   Red Hat Enterprise Linux AS release 4 (Nahant Update 2)   注:这种方式下可以直接看到具体的版本号,比如 AS4 Update 1

    4) 登录到linux执行rpm -q redhat-release ,例如如下:

       [root@q1test01 ~]# rpm -q redhat-release   redhat-release-4AS-3   注:这种方式下可看到一个所谓的release号,比如上边的例子是3   这个release号和实际的版本之间存在一定的对应关系,如下:   redhat-release-3AS-1 -> Redhat Enterprise Linux AS 3   redhat-release-3AS-7.4 -> Redhat Enterprise Linux AS 3 Update 4   redhat-release-4AS-2 -> Redhat Enterprise Linux AS 4   redhat-release-4AS-2.4 -> Redhat Enterprise Linux AS 4 Update 1   redhat-release-4AS-3 -> Redhat Enterprise Linux AS 4 Update 2   redhat-release-4AS-4.1 -> Redhat Enterprise Linux AS 4 Update 3   redhat-release-4AS-5.5 -> Redhat Enterprise Linux AS 4 Update 4    另:第3)、4)两种方法只对Redhat Linux有效.

    查看系统是64位还是32位:

    1、getconf LONG_BIT or getconf WORD_BIT

    2、file /bin/ls

    3、lsb_release -a

     

     

    mke2fs(make ext2 file system)

    功能说明:建立ext2文件系统。

     

     

    最新回复(0)