日期:2014-05-16  浏览次数:20654 次

linux shell (一)

一、基本操作

1.linux虚拟内存的情况:cat /proc/meminfo

2.每个进程都有自己的内存页面,但是也有一个共享内存页面,多个进程可以读写公用内存区域

查看共享内存:ipcs -m

3.系统用户账户列表

cat /etc/passwd

显示格式:username:password(占位符):UID:GID:fullname:default_dir:default_shell

4.查看文件统计信息和文件类型

stat filename

file filename

5.进程:ps top

6.mount -t type device directory

umount [directory | device]

7.磁盘:df du

8.排序:sort [-n] file

9.grep ack-grep

10.压缩bzip2、gzip、zip

11.归档:tar -zxvf

?

二、linux环境变量

1.全局变量:对所有shell及其子进程可见

2.局部变量:只能在自己的进程中可见

3.var=value? unset var

4.array=(e1 e2 ...) ${array[index | *]}

5alias -p

?