1.文件及目录操作命令
(1)练习常用shell命令
date、bc、echo、last、history等。
练习:
xushicheng@ubuntu:~$ date #显示系统时间
Sun Apr 28 03:40:10 PDT 2019
xushicheng@ubuntu:~$ bc -l #bc 命令是任意精度计算器语言,通常在linux下当计算器用。-l: #定义使用的标准数学库
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 /*定义输出进制为16*/
32378 /*输入32378 */
7E7A /*输出结果为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
上一个教程:【linux系统如何指令拷贝】
下一个教程:机器学习、深度学习中常用的Linux命令