AIX学习第二课

浏览:
字体:
发布时间:2013-12-17 09:37:06
来源:

Unit 4 Files and Directories 文件和目录

A file is:

A collection of data
A stream of characters or a "byte stream"
No structure is imposed on a file by the operating system
File and directory permissions can be specified in the symbolic syntax or as anoctal number:

文件 名称存在父目录;内容存在磁盘 数据块 大小与占用空间的区别

文件的三种类型 普通 目录 特殊

文件权限分析:

第1个字符——文件类型

以d开头表示目录

以-开头表示普通文件

第2-3个字符表示读写rw

touch mkdir rm 创建删除文件要有写权限

x 代表可以cd进入

rwx 对应7

umask 默认掩码值022 只有管理员可以改

默认创建文件的访问权限为777-022=755

staff 表示普通用户

文件大小

创建时间

隐藏文件以点开头

. 表示当前目录

..表示父目录

.profile

The print working directory command can be used to find out what your current directory is:pwd

绝对路径 和 相对路径

文件系统结构

usr-bin

bin //binary的缩写 存放命令

pwd // print working directory 当前宿主目录

/etc // 存放操作系统的配置信息 相当于windows注册表

/sbin //存放操作系统启动的脚本等

/home //主目录--------------

/var //存放变化的数据 比如 log 文件,邮件 ls /var/spool/mail

/temp //存放临时文件 一般可以删除

/opt //免费软件安装的地方 系统自带的放在usr下

/proc //进程 id 占用的系统资源、临时数据结构等

Listing Directories

ls -l

ls -a (显示所有文件)

ls -R(递归遍历子目录文件)

ls -i (唯一标识文件的号码 i-node)

ls -d(查看当前目录属性

Change Current Directory

cd / // 切换目录

Set your working directory to your home directory:

cd

cd ~

Set your working directory to the parent directory

cd ..

cd /

cd /home/stb106 ls -a /dev

Creating Directories

mkdir

Removing Directories

rmdir (The directory must be empty. You must be at least one directory level higher that the one you are trying to remove.)

The touch command updates the access and modification times of a file.

The command can also be used to create zero-length files.

$ for i in 1 2 3 4 5
> do
> touch file$i
> done
$ ls
d1 dead.letter file1 file4 smit.log
d2 f1.txt file2 file5 smit.script
d3 f2.txt file3 mbox smit.transaction

Unit 5 Using Files

Use the cp command to copy files
Use the mv command to move or rename files
Use the wc command to count the number of lines, words, and bytes in a named file

$ wc [-c] [-l] [-w] filename
Options:
-c counts the number of bytes
-l counts lines
-w counts words
Use the ln command to allow a file to have more than one name

Allows files to have more than one name in the directory structure
Both files reference the same i-node
Cannot be used with directories, cannot span file systems

ln 链接 ln -s

硬链接 与 软连接,前者不能跨分区
Display the contents of a file using the cat, pg, and more commands
Use the rm command to remove files
Print files

Unit 6 File Permissions

ls -l

Every file and directory on the system has file permissions associated with it.
Three permission categories: owner, group, and other
Three bits can be set for each category: read, write, execute (rwx)

Changing Permissions (Symbolic Notation)

chmod mode filename

The umask specifies what permission bits will be set on a new file or directory when created.

ps(显示进程)

last(列出登录信息)

kill (结束某一进程)

halt (关闭系统)

>更多相关文章
24小时热门资讯
24小时回复排行
资讯 | QQ | 安全 | 编程 | 数据库 | 系统 | 网络 | 考试 | 站长 | 关于东联 | 安全雇佣 | 搞笑视频大全 | 微信学院 | 视频课程 |
关于我们 | 联系我们 | 广告服务 | 免责申明 | 作品发布 | 网站地图 | 官方微博 | 技术培训
Copyright © 2007 - 2024 Vm888.Com. All Rights Reserved
粤公网安备 44060402001498号 粤ICP备19097316号 请遵循相关法律法规
');})();