linux shell 编程 之 shell简介
2011-05-27 16:35
387 查看
linux shell 编程 之 shell简介
×什么是shell
×存取权限和安全
×shell简单脚本
×shell特性
#cat /etc/shells
#echo $SHELL
查看当前运行的shell
~~~~~~~
chmod [who] operator [permission] filename
who (u ,g ,o ,a)
operator (+,-,=)
permission (r,w,x,s,t)
ex: chmod u=rwx,g+w,o-x 1.txt
~~~~~~~~
chmod mode file
mode r 4,w 2,x 1
ex: chmod 4744 1.txt 相当于 chmod u+s 1.txt
chmod 6744 1.txt 相当于 chmod g+s 1.txt
chmod 7744 1.txt 相当于 chmod o+T 1.txt
~~~~~~~~~~~~~~~~~~~~~
chown [-R] owner.group myfile 表示-R则myfile目录和目录下面的所有文件权限都要改变
chown owner:group myfile
chown :group myfile
chgrp 用法同chown
~~~~~~~~~~~~~~
umask umask的值是原值(目录满值是7,文件满值是6)的反值。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
符号链接
ln -s
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
shell
注意赋予权限 chmod u+x filename
运行方法 ./filename
~~~~~~~~~~~~~~~`
shell 特性
tar -czf filename.tar.gz filename & 放在后台运行
jobs -l 查看后台运行程序
~~~~~~~~~~~~~~~~~~~~~~~~~
后台 &
变量
管道 ls |sort sort----排序
重定向 sort <myfile.txt>myfile_dort.txt <输入 > 输出
特殊字符
" "
touch qwe qwr
touch "qwe qwr"
; ---------- 一行运行多个命令
$ -----------变量名的开头
本文出自 “初出茅庐” 博客,谢绝转载!
×什么是shell
×存取权限和安全
×shell简单脚本
×shell特性
#cat /etc/shells
#echo $SHELL
查看当前运行的shell
~~~~~~~
chmod [who] operator [permission] filename
who (u ,g ,o ,a)
operator (+,-,=)
permission (r,w,x,s,t)
ex: chmod u=rwx,g+w,o-x 1.txt
~~~~~~~~
chmod mode file
mode r 4,w 2,x 1
ex: chmod 4744 1.txt 相当于 chmod u+s 1.txt
chmod 6744 1.txt 相当于 chmod g+s 1.txt
chmod 7744 1.txt 相当于 chmod o+T 1.txt
~~~~~~~~~~~~~~~~~~~~~
chown [-R] owner.group myfile 表示-R则myfile目录和目录下面的所有文件权限都要改变
chown owner:group myfile
chown :group myfile
chgrp 用法同chown
~~~~~~~~~~~~~~
umask umask的值是原值(目录满值是7,文件满值是6)的反值。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
符号链接
ln -s
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
shell
注意赋予权限 chmod u+x filename
运行方法 ./filename
~~~~~~~~~~~~~~~`
shell 特性
tar -czf filename.tar.gz filename & 放在后台运行
jobs -l 查看后台运行程序
~~~~~~~~~~~~~~~~~~~~~~~~~
后台 &
变量
管道 ls |sort sort----排序
重定向 sort <myfile.txt>myfile_dort.txt <输入 > 输出
特殊字符
" "
touch qwe qwr
touch "qwe qwr"
; ---------- 一行运行多个命令
$ -----------变量名的开头
本文出自 “初出茅庐” 博客,谢绝转载!
相关文章推荐
- Linux Shell编程学习笔记一:shell简介
- 实战Linux Shell(1):Shell简介
- Linux Shell编程(4)——shell特殊字符(上)
- shell脚本编程简介
- 第一部分 Shell基础编程——第一章 Shell简介
- linux shell 编程笔记 - shell的输入与输出 -3- 标准输入-标准输出-标准错误
- Linux简介及常用命令使用5--linux shell编程入门
- Linux Shell高级编程技巧——第二章 Shell工具
- linux shell scrip(脚本)编程简介------变量、特殊符号和表达式
- shell 编程简介
- Linux Shell编程一:shell命令
- Linux Shell脚本教程:30分钟玩转Shell脚本编程(笔记)
- Linux Shell 编程入门简介
- Linux shell编程(二):shell语法
- 第二部分 Linux Shell高级编程技巧——第二章 Shell工具
- Shell_awk_awk编程简介
- linux shell编程指南第十四章------环境和shell变量
- Linux Shell编程实战---shell实现图片下载神器
- Shell 编程详解之Shell简介<一>
- Shell简介:shell简单编程