现在的位置: 首页 > 综合 > 正文

linux的小知识记录

2013年06月11日 ⁄ 综合 ⁄ 共 2470字 ⁄ 字号 评论关闭

1.

[root@localhost ~]# chmod 777 /home/user 注:仅把/home/user目录的权限设置为rwxrwxrwx

[root@localhost ~]# chmod -R 777 /home/user 注:表示将整个/home/user目录与其中的文件和子目录的权限都设置为rwxrwxrwx

2.

cp /home/student/*  /opt 是将 /home/student/目录下的文件都考到/opt/目录下,不包含目录

cp /home/student/   /opt  包含目录

3.

su -i

make install

sudo mkdir hello

其中权限的区别具体搞得也不是很明白

sudo -i 运行结果 PWD=/root
sudo su 运行结果 PWD=/home/用户名(当前用户主目录)

反正当执行make的时候如果出现权限不够,或者找不到arm-linux-gcc的时候就要想想该用哪个了,echo $PATH当前的路径来判断

比如我在装yasm的时候

sudo make install出现

/bin/bash: line 4: arm-linux-ranlib: command not found

su -i

make install

 

4.

 

http://blog.chinaunix.net/uid-9080032-id-3222636.html

  cat和EOF的使用

(1)cat和EOF简介
cat      用于显示文本文件内容,全部输出
EOF   “end of file”,表示文本结束符
 
(2)使用
用法1.多行导入文件(新建文件或者覆盖文件内容)
 
  1. cat << EOF >abcd.txt   
  2. Hello!   
  3. This is a test file!   
  4. Test for cat and EOF!   
  5. EOF 
 
来看下执行结果
 
  1. cat abcd.txt  
  2. Hello!   
  3. This is a test file!   
  4. Test for cat and EOF! 
这就是多行导入!
 
用法2.文件追加
cat << EOF >> test.sh
 
5.

apt-get  install

Apt-get  remove

查看默认安装路径为dpkg -L cheese

6.

fedora中查看是否安装cmake

rpm -qa | grep -i cmake

7.

fedora查询包的位置

which ipppd

whereis ipppd

8.

导出环境变量

修改profile文件:
#vi /etc/profile 
在里面加入:
export PATH="$PATH:/opt/au1200_rm/build_tools/bin "

 修改.bashrc文件:
# vi /root/.bashrc 
在里面加入:
export PATH="$PATH:/opt/au1200_rm/build_tools/bin "

Source /etc/profile 就可以了

9.

压缩的命令; tar -cvf  hello.tar  hello所在的目录

1.

[root@localhost ~]# chmod 777 /home/user 注:仅把/home/user目录的权限设置为rwxrwxrwx

[root@localhost ~]# chmod -R 777 /home/user 注:表示将整个/home/user目录与其中的文件和子目录的权限都设置为rwxrwxrwx

2.

cp /home/student/*  /opt 是将 /home/student/目录下的文件都考到/opt/目录下,不包含目录

cp /home/student/   /opt  包含目录

3.

su -i

make install

sudo mkdir hello

其中权限的区别具体搞得也不是很明白

sudo -i 运行结果 PWD=/root
sudo su 运行结果 PWD=/home/用户名(当前用户主目录)

反正当执行make的时候如果出现权限不够,或者找不到arm-linux-gcc的时候就要想想该用哪个了,echo $PATH当前的路径来判断

比如我在装yasm的时候

sudo make install出现

/bin/bash: line 4: arm-linux-ranlib: command not found

su -i

make install

 

4.

 

http://blog.chinaunix.net/uid-9080032-id-3222636.html

  cat和EOF的使用

(1)cat和EOF简介
cat      用于显示文本文件内容,全部输出
EOF   “end of file”,表示文本结束符
 
(2)使用
用法1.多行导入文件(新建文件或者覆盖文件内容)
 
  1. cat << EOF >abcd.txt   
  2. Hello!   
  3. This is a test file!   
  4. Test for cat and EOF!   
  5. EOF 
 
来看下执行结果
 
  1. cat abcd.txt  
  2. Hello!   
  3. This is a test file!   
  4. Test for cat and EOF! 
这就是多行导入!
 
用法2.文件追加
cat << EOF >> test.sh
 
5.

apt-get  install

Apt-get  remove

查看默认安装路径为dpkg -L cheese

6.

fedora中查看是否安装cmake

rpm -qa | grep -i cmake

7.

fedora查询包的位置

which ipppd

whereis ipppd

8.

导出环境变量

修改profile文件:
#vi /etc/profile 
在里面加入:
export PATH="$PATH:/opt/au1200_rm/build_tools/bin "

 修改.bashrc文件:
# vi /root/.bashrc 
在里面加入:
export PATH="$PATH:/opt/au1200_rm/build_tools/bin "

Source /etc/profile 就可以了

9.

压缩的命令; tar -cvf  hello.tar  hello所在的目录

抱歉!评论已关闭.