stat $ stat file $ stat -t file 显示在同一行 $ stat -f file 汇报文件所在文件系统,而非文件本身 wc $ wc file 9 7 37 file 行数、单词数、字节数 $ wc -l file 行数 $ wc -w file 单词数 $ wc -c file 字节数 $ wc -L file 找出最长的行并且显示该行长度 du $ du -sh dir 目录所占空间 file $ file -i file MIME类型名称 $ file -L softlink 链接目标文件类型 softlink: ASCII text touch $ touch -d "2000-1-1 9am" file...
by 宗禹 - Linux文档专区 - 2008-08-24 19:41:45 阅读(803) 回复(0)
[color="#4822dd"]1 umask: 默认情况下 普通文件属性为666 目录为属性为777 有的人喜欢用减法 , 把(默认属性 - umask) 作为创建的新文件的属性 这样是错误的 比如: [root@host]#umask 003 [root@host]#touch test test这个普通文件的属性按照上面的这种减法的话,666-003 = 663 那么test属性为 -rw-rw-wx 可是...
想要在内核态获取文件属性(目录文件、普通文件、uid、gid等等), 该用什么方法呢? 我知道用户态的方法是使用 stat 系统调用,但是内核态这个系统调用是没有导出的,所以不能使用。 不知道 sys_stat 和 vfs_stat 可以实现不,正在努力尝试中 ........ 如果使用 int vfs_stat(char __user *, struct kstat *); 那么这个 kstat 又是什么东东? 另外:sys_stat 的原型貌似是这样的了:asmlinkage long sys_stat(char __user *f...
文件属性和权限 [root@daf root]# ls -al total 64 drwxr-x--- 4 root root 4096 Feb 14 22:02 . drwxr-xr-x 23 root root 4096 Feb 16 13:35 .. -rw-r--r-- 1 root root 1210 Feb 10 06:03 anaconda-ks.cfg -rw------- 1 root root 12447 Feb 14 23:22 .bash_history -rw-r--r-- 1 root root 24 Jun 11 2000 .bash_logout -rw-r--r-- 1 ...
linux文件属性、权限设置文件属性和权限 [color="#ffffff"][root@daf root]# ls -al [color="#ffffff"]total 64 [color="#ffffff"]drwxr-x--- 4 root root 4096 Feb 14 22:02 . [color="#ffffff"]drwxr-xr-x 23 root root 4096 Feb 16 13:35 .. [color="#ffffff"]-rw-r--r-- 1 root root 1210 Feb 10 06:03 anaconda-ks.cfg [color="#ffffff"]-rw------- 1 root root ...
1.命令 ls -al 表示列出所有文件的属性 包括隐藏文件(就是文件名前面第一个字符为.的文件) -rw-rw-r-- 1 wuxiaoxiao wuxiaoxiao 10758 06-17 01:05 command.txt 文件属性 连接数 所属用户 所属组 大小 最新修改时间 文件名 其中文件属性 - rw- rw- r-- 文件类型 所属用户的权限 所属组的权限 其他非本用户组的权限 文件类型: -:文件 d:目录 l:链接文...
首先我们root登录系统后输入ls –al 会有如下所示: [root@tsai root]# ls -al total 64 drwxr-x--- 4 root root 4096 Feb 14 22:02 . drwxr-xr-x 23 root root 4096 Feb 16 13:35 .. -rw-r--r-- 1 root root 1210 Feb 10 06:03 anaconda-ks.cfg -rw------- 1 root root 12447 Feb 14 23:22 .bash_history -rw-r--r-- 1 root root 24 Jun 11 2000 .bash_logout -rw-r--r-- 1 root root 234 Jul 6 2001 .bash_profile -rw-r--r-- ...
linux 檔案屬性 嗯!既然要讓你瞭解 linux 的檔案屬性,那麼有個重要的也是常用的指令就必須要先跟你說囉!那一個?!就是『 ls 』這一個 list 檔案的指令囉!在你以 root 的身份登入 linux 之後,下達『ls -al 』看看,會看到底下的幾個咚咚: [root@linux ~]# ls -altotal 248 drwxr-x--- 9 root root 4096 Jul 11 14:58 . drwxr-xr-x 24 root root 4096 Jul 9 17:25 .. -rw------- 1 root ...
本帖最后由 j3kljs02398j 于 2011-09-07 21:15 编辑 TABLE 1. 获取文件属性(stat,fstat,lstat) 2. 文件类型 2.1 文件类型包括一下几种 2.2 文件类型测试的宏 2.3 文件类型测试实例 3. 文件的权限 3.2 关于权限的小细节 3.3 设置用户ID和设置组ID 3.4 文件权限操作的系统调用 3.4.1 umask函数 3.4.2 chmod和fchmod 3.4.3 chown fchown和lchown 4. 文件的时间 4.1 utime函数 文件有其属性,如类型,...
-rwxrwxrwx 1 root root 293 Oct 19 21:24 test 第一列表示这个文件的属性 第二列表示连接占用的节点 第三列表示文件(或目录)的拥有者 第四列表示拥有者的用户组 第五列表示这个文件的大小 第六列为这个文件的创建日期或者是最近的修改日期 第七列为这个文件的文件名 chgrp [-R] dirname/filename 更改所属用户组,-R用于目录下的递归更改 chown [-R] 帐号名称 文件或目录 chmod 更改9个属性 如:chmod 777 .bashrc ...