tail -n 13 history |awk '{print $2,$3,$4,$5,$6,$7,$8.$9,$10}'提取第2到第11列


# cat history |awk '{print $2,$3,$4,$5,$6,$7,$8.$9,$10}'

 

# tail -n 13 history
215 systemctl stop
216 systemctl stop xinetd
217 systemctl stop firewalld
218 systemctl disable firewalld
219 vim neokylin.repo
220 yum install -y *tigervnc*
221 vncserver :55
222 history
223 history |cut 2
224 cd /home/
225 mkdir pxe-cut
226 cd pxe-cut/
227 history >>history
[root@localhost pxe-cut]# tail -n 13 history |awk '{print $2,$3,$4,$5,$6,$7,$8.$9,$10}'
systemctl stop
systemctl stop xinetd
systemctl stop firewalld
systemctl disable firewalld
vim neokylin.repo
yum install -y *tigervnc*
vncserver :55
history
history |cut 2
cd /home/
mkdir pxe-cut
cd pxe-cut/
history >>history

 

 

# tail -n 13 history |awk '{print $2,$3,$4,$5,$6,$7,$8.$9,$10}'
systemctl stop
systemctl stop xinetd
systemctl stop firewalld
systemctl disable firewalld
vim neokylin.repo
yum install -y *tigervnc*
vncserver :55
history
history |cut 2
cd /home/
mkdir pxe-cut
cd pxe-cut/
history >>history

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM