The Linux “du” (Disk Usage) is a standard Unix/Linux command, used to check the information of disk usage of files and directories on a machine. The du command has many parameter options that can be used to get the results in many formats. The du com…
Files and Directories Introduction     In the previous chapter we coveredthe basic functions that perform I/O. The discussion centered on I/O for regular files-opening a file, and reading or writing a file. We'll now look at additionalfeatures of the…
4.1 Introduction 4.2 stat, fstat, fstatat, and lstat Functions The lstat function is similar to stat, but when the named file is a symbolic link, lstat returns information about the symbolic link, not the file referenced by the symbolic link. 4.3 文件类…
cp - Copy Files and directories mv - move/rename files and directories mkdir - create directories rm - remove files and directories ln - create hard and symbolic links…
Step 1 Copy the files and directories to other place. Step 2 Delete the files and directories. Step 3 Commit. Step 4 Paste the files and directories from backup place. Step 5 Commit.…
August 27, 2013Software Developmentresources, subversion, svn, tutorial, version control Who knew it would be so hard to get svn to ignore some files and directories? I’m working on an Android project, and I wanted svn to stop looking at me questioni…
1. Finding files on *NIX and sort by size find ~ -iregex ".*/*.sh" -type f -print0 | xargs -0 -n1 du -b | sort -n -r…
本篇主要介绍文件和文件系统中常用的一些函数,文件系统的组织结构和硬链接.符号链接. 通过对这些知识的了解,可以对Linux文件系统有更为全面的了解.   1 umask函数 之前我们已经了解了每个文件与权限相关的9个位(bit),我们现在来了解一下当每个进程创建文件时默认会设置该文件的文件权限(the file mode creation mask). umask函数设置该进程默认创建文件的权限掩码(the file mode creation mask),并且返回之前的权限掩码值. #incl…
 1 File Times 每个文件会维护三个时间字段,每个字段代表的时间都不同.如下表所示: 字段说明: st_mtim(the modification time)记录了文件内容最后一次被修改的时间. st_ctim(the changed-status time)记录了文件的i-node最后一次被修改的时间,如修改文件权限位,修改文件所有者ID,修改关联到该文件的link数目. i-node中的信息和文件的实际内容是分离的,所以当更新i-node时,需要更新的时st_ctim(the ch…
在前面的两篇,我们了解了IO操作的一些基本操作函数,包括open.read和write. 在本篇我们来学习一下文件系统的其他特性和一个文件的属性,涉及的函数功能包括: 查看文件的所有属性: 改变文件所有者: 改变文件权限: 操作文件夹. 我们还会了解一些文件系统相关的数据结构和符号链接(symbolic link). 1 函数stat.fstat.fstatat.lsat函数 #include <sys/stat.h> int stat(const char *restrict pathnam…