View a few lines of Linux logs
Display commands in reverse order tail view
Command format: Tail [-R] [-N number] [File]
"One" starts at line No. 3000 and displays 1000 rows. The 3000~3999 line is displayed
Cat FileName | Tail-n +3000 | Head-n 1000
Show file//display top 1000 lines starting from 3000 lines
"Two" displays 1000 rows to 3000 rows
Cat filename| Head-n 3000 | Tail-n +1000
* Note the order of the two methods
Decomposition:
Tail-n 1000: Show last 1000 rows
Tail-n + 1000: Starting from 1000 lines, showing 1000 rows later
Head-n 1000: Show front 1000 lines
Used in a log-slicing scenario. such as 1 logs a day, if used Tail-f, after 0 points in the console will not see the print log. (because the original log file will be stale finle.20151022 format)
If you use Tail-f, you can still see the printed log in the console after 0.
"Three" with sed command
Sed-n ' 5,10p ' filename so you can only view lines 5th through 10th of the file.
Linux installation software# sudo apt-get install rsync Note: In Debian, Ubuntu and other online installation methods;
# yum Install rsync Note: Fedora, Redhat and other online installation methods;
# RPM-IVH rsync Note: Fedora, Redhat and other RPM package installation method;
Source Package Installation
Tar xvf rsync-xxx.tar.gz
CD rsync-xxx
./configure--prefix=/usr; make and make install Note: You have to install GCC and so on before compiling the installation with the source package;
CPU information for Linux 1. View the number of physical CPUs
#cat/proc/cpuinfo |grep "Physical id" |sort |uniq|wc-l
2. View the number of logical CPUs
#cat/proc/cpuinfo |grep "Processor" |wc-l
3. View CPU is a few cores
#cat/proc/cpuinfo |grep "Cores" |uniq
4. Check the CPU frequency
#cat/proc/cpuinfo |grep Mhz|uniq
Linux Common Operations Command (ii)