1.文件及目錄操作命令
(1)練習(xí)常用shell命令
date、bc、echo、last、history等。
練習(xí):
xushicheng@ubuntu:~$ date #顯示系統(tǒng)時(shí)間
Sun Apr 28 03:40:10 PDT 2019
xushicheng@ubuntu:~$ bc -l #bc 命令是任意精度計(jì)算器語(yǔ)言,通常在linux下當(dāng)計(jì)算器用。-l: #定義使用的標(biāo)準(zhǔn)數(shù)學(xué)庫(kù)
bc 1.06.95
Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
obase=16 /*定義輸出進(jìn)制為16*/
32378 /*輸入32378 */
7E7A /*輸出結(jié)果為7E7A*/
12345 /*輸入12345*/
3039 /*輸出3039*/
2+3
5
3.5+3.6
7.1
8.99*3.2
28.768
xushicheng@ubuntu:~$ pi=$(echo "scale=10; 4*a(1)" | bc -l)
xushicheng@ubuntu:~$ pi=`echo "scale=10; 4*a(1)" | bc -l`
xushicheng@ubuntu:~$ echo $pi
3.1415926532
xushicheng@ubuntu:~$ echo 'hello'
hello
xushicheng@ubuntu:~$ last #last 命令用于顯示用戶最近登錄信息。
xushiche pts/0 :0.0 Sun Apr 28 03:40 still logged in
xushiche tty1 Sun Apr 28 03:38 still logged in
xushiche tty1 Sun Apr 28 03:38 - 03:38 (00:00)
xushiche tty7 :0 Sun Apr 28 03:37 still logged in
reboot system boot 2.6.32-21-generi Sun Apr 28 03:37 - 03:46 (00:09)
xushiche tty1 Wed Apr 24 03:25 - down (00:01)
xushiche tty1 Wed Apr 24 03:25 - 03:25 (00:00)
xushiche tty7 :0 Wed Apr 24 03:24 - down (00:02)
reboot system boot 2.6.32-21-generi Wed Apr 24 03:08 - 03:26 (00:18)
xushiche pts/0 :0.0 Sun May 13 06:41 - 06:51 (00:10)
xushiche tty7 :0 Sat May 12 19:51 - down (229+01:39)
reboot system boot 2.6.32-21-generi Sat May 12 19:35 - 20:31 (229+01:55)
wtmp begins Sat May 12 19:35:30 2018
上一個(gè)教程:【linux系統(tǒng)如何指令拷貝】