A.Linux files
can be divided into four types: ordinary files, directory files, link files, and device files.
1. Ordinary files
are the most used files for users, including text files, shell scripts, binary executables, and various Type of data.
ls -lh to view the properties of a file, you can see something like -rw-r--r--, it is worth noting that the first symbol is -, so The file is a normal file in Linux. These files are typically created with related applications such as image tools, document tools, archiving tools... or cp tools. The way to delete such files is to use the rm command;
2, directory files
In linux, directories are also files, they are included File name and subdirectory name and pointers to those files and subdirectories
When we execute in a directory, we see something like drwxr-xr-x, which is the directory. The directory is a special file in Linux. Note that its first character is d. The command to create a directory can use the mkdir command, or the cp command, to copy a directory to another directory. Remove the command with rm or rmdir.
3. Linked files
Linked files are similar to "shortcuts" in Windows
.
is created by ln -s source file name new file name.
4, device files
includes two kinds of block device files, and the other is character device files
< Br>
Block device files refer to data read and write, they are devices in block units, such as hard disk drive
Character devices mainly refer to serial port interface devices Such as network cards.
Second, the file descriptor
1, the file descriptor and its role
Kernel (Kernel) using a file described in File descriptor to access the file. The file descriptor is a non-negative integer. When opening an existing file or creating a new file, the kernel will return a file descriptor. Reading and writing files also requires the use of file descriptors to specify which files to read and write. For Linux, all operations on devices and files are done using file descriptors. A file descriptor is a non-negative integer that is an index value and points to a record table in which each process in the kernel opens a file. When opening an existing file or creating a new file, the kernel returns a file descriptor to the process; when it needs to read and write files, also needs to pass the file descriptor as a parameter Give the corresponding function. Normally, when a process starts, it opens 3 files: standard input, standard output, and standard error handling. These three files correspond to file descriptors 0, 1, and 2, that is, macros replace STDIN_FILENO, STDOUT_FILENO, and STDERR_FILENO, and readers are encouraged to use these macros instead.) View the default file descriptors for Linux, a total of 1024, which is sufficient for most cases: # ulimit -n View process id #ps aux Get a process file descriptor cd /proc/[pid] /fd[pid] is the pid of the corresponding process. #cd /proc/1473/fd
#sysctl -a
single, enter single-user mode, then change the startup mode to id:3:initdefault: in /etc/inittab (t
on Ubuntu systems Ubuntu is currently the most popular Linux operating system. After the release of
Its still a process of generating vmlinux from the compiled link. It is made up of a bunch of .o fi
A summaryIn order to manage all server accounts and passwords in the enterprise, you can use the Wi
Install RedHat Linux with Oracle VM VirtualBox
Squid log file is too large, how to deal with it?
Teach you completely free self-built Linux firewall
Conflicts in Linux and their coping strategies
Analysis of the main points of Linux system cluster technology
The correct way to restore EXT3 Superblock(bad superblock)
Fedora Features - Smolt solves hardware compatibility problems
Network-based RedHat system unattended installation
The difference between the two-layer, three-layer, and four-layer switches is
How to solve the garbled Windows 8 installation software?
The most common problem with installing Vista
Create a eternal Windows 2000/XP operating system (1)
Win7 system Word can't open the error report how to solve
Win8 can't open IE10 browser solution
Windows XP shutdown settings let the system reborn
How to install and use Makeself
Windows 7 suspended animation scenarios and processing methods
Solve the problem that windows7 resource manager has stopped working