AIX学习第二课
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 (关闭系统)
- 07-30如何用u盘重装win10系统
- 07-30bios设置u盘启动
- 07-30技嘉主板bios如何设置u盘启动项
- 12-22开源视频平台:MediaCore(MediaDrop)
- 12-22JVMjavacore和heapdump文件生成选项
- 12-22使用飞信机器人发短信需要开放的端口
- 12-22TCP连接的三次握手--一次故障记录
- 12-22磁盘管理之一 逻辑卷管理
- 01-11全球最受赞誉公司揭晓:苹果连续九年第一
- 12-09罗伯特·莫里斯:让黑客真正变黑
- 12-09谁闯入了中国网络?揭秘美国绝密黑客小组TA
- 12-09警示:iOS6 惊现“闪退”BUG
- 11-28Bossjob宣布上线AI翻译功能
- 11-28腾讯应用宝电脑版推小宝AI助手 部分功能已
- 11-28周鸿祎亲自上阵演短剧,将于发布会上播出
- 11-28机构:2024第三季度全球NAND闪存产业营收增
- 11-18LG新能源宣布与Bear Robotics达成合作,成为