Linux file content review, you can use the command to achieve. Cat, tac, more, including nl and other commands can be used to view the contents of the file. This article introduces by way of example, what are the commands for the Linux system to view the contents of the file.
/messages at any time the data will be written to the file you want to make the data immediately displayed on the screen, on the use of the -f option when writing, he can always detect /var /log/messages This file, the newly added data will be displayed on the screen. Until you press [crtl]-c, you will leave the detection of tail!
Non-Pure Text File: od
[root@www ~]# od [-t TYPE] File
Option or Parameter:
-t : You can connect to various types of "TYPE" output, for example:
a : use the default byte to output;
c : use ASCII bytes to output
d[size] : Use decimal to output data, each integer occupies size bytes;
f[size] : use floating point value (floating) to output data, each number Occupy size bytes ;
o[size] : Use octal to output data, each integer occupies size bytes;
x[size] :Using hexadecimal To output data, each integer occupies size bytes;
Example 1: Please use the ASCII method to display the contents of /usr/bin/passwd!
[root@www ~]# od -tc /usr/bin/passwd
0000000 177 ELF 001 001 001 \\0 \\0 \\0 \\0 \\0 \\0 \\0 \\0 \\ 0
0000020 002 \\ 0 003 \\ 0 001 \\ 0 \\ 0 \\ 0 260 225 004 \\ b 4 \\ 0 \\ 0 \\ 0
0000040 020 E \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 4 \\ 0 \\ 0 \\ a \\ 0 (\\ 0
0000060 035 \\ 0 034 \\ 0 006 \\ 0 \\ 0 \\ 0 4 \\ 0 \\ 0 \\ 0 4 200 004 \\ b < Br>
0000100 4 200 004 \\b 340 \\0 \\0 \\0 340 \\0 \\0 \\0 005 \\0 \\0 \\0
. . . (omitted later)...
# The first column on the left is the octet to represent the number of bytes. In the above example, the second column 0000020 represents the beginning of
#16th byes (2x8) The meaning of the content.
Example 2: Please list the contents of the /etc/issue file in 8-bit to store the stored value and ASCII comparison table
[root@www ~]# od - t oCc /etc /issue
0000000 103 145 156 164 117 123 040 162 145 154 145 141 163 145 040 065
C ent OS release 5
0000020 056 062 040 050 106 151 156 141 154 051 012 113 145 162 156 145
. 2 (F inal) \\ n K erne
0000040 154 040 134 162 040 157 156 040 141 156 040 134 155 012 012
l \\ ronan \\ m \ \
0000057
# As shown above, you can find out the value that each byte can correspond to!
# For example, e corresponds The recorded value is 145, which is converted to decimal: 1x8^2+4x8+5=101.
Modify the file time or create a new file: touch
modification time (mtime):
When the "content data" of the file changes, it will be upgraded. ! Content data refers to the content of the file, not the attributes or permissions of the file!
status time (ctime):
When the "status" of the file changes, the time is upgraded. For example, permissions and properties are changed. Will upgrade this time.
access time (atime):
When the content of the file is taken, the read time is upgraded. For example, if we use cat to read /etc/man.config , we will upgrade the atime of the file.
By default, ls shows the mtime of the file, which is the time the content of this file was last changed.
[root@www ~]# touch [-acdmt] File Previous12Next Total 2 Pages
Fail2ban in Linux is a tool to protect servers from network attacks. Fail2ban can b
NICs and IP addresses are not one-to-one. Many users create virtual NICs that can b
In Linux, you can use ssh to transfer files to the FPT space and back up some impor
yum is a Linux package manager, also called yum source. During the use of yum, sometimes there is a
How does the CentOS 6.6 system open the XDMCP service?
Linux network card binding setting method
Linux system Vsftpd server virtual user and passive mode configuration method
Linux automatic installation operation example
How to modify the network card DNS in Linux system?
Detailed explanation of the functions and parameters of the Linux system ar command
How to install and upgrade VMware Tools in Fedora
How Ubuntu uses the source command to execute files
Linux git bash garbled solution
Blade server hard disk boot Linux independent installation (2)
How to do Adobe Illustrator CS4 software in win7 is very slow
AppLocker application control strategy under Windows 7 (2)
How to use driver life to get win10 driver + installed software once
WP8.1 or Android Swype keyboard
The best solution for hard disk partitioning under Linux
Internet Express FlashGet new use skills
Windows 8.1 latest exposure Kiosk mode