item | desc |
---|---|
CTRL + SHIFT + = | 窗口放大 |
CTRL + - | 窗口缩小 |
clear | 清屏 |
reset | 重启 shell |
CTRL + l | 清屏[实际上是向上推屏] |
item | desc | |||
---|---|---|---|---|
username | @ | hostname | : | workdirectory |
cnplaman@pla:~$ |
cnplaman@cnplaman-virtual-machine:~/Desktop$
. 文件位置:/etc/hostname
. 建议以集群+ip的方式命名,如web101
cnplaman@cnplaman-virtual-machine:~/Desktop$ hostname cnplaman-virtual-machine cnplaman@cnplaman-virtual-machine:~/Desktop$ vi /etc/hostname cnplaman-virtual-machine
cnplaman@cnplaman-virtual-machine:~/Desktop$ hostnamectl Static hostname: cnplaman-virtual-machine ...
. 修改并查看[实际上已经生效了]
cnplaman@cnplaman-virtual-machine:~/Desktop$ hostnamectl set-hostname cnplaman cnplaman@cnplaman-virtual-machine:~/Desktop$ hostnamectl Static hostname: pla ...
. 重启终端
cnplaman@pla:~/Desktop$
各主机名和ip地址的对应关系
.window系统位于:C:\Windows\System32\drivers\etc
cnplaman@pla:~/Desktop$ vi /etc/hosts
cnplaman@pla:~/Desktop$ ping 172.23.163.39 PING 172.23.163.39 (172.23.163.39) 56(84) bytes of data. 64 bytes from 172.23.163.39: icmp_seq=1 ttl=128 time=0.825 ms 64 bytes from 172.23.163.39: icmp_seq=2 ttl=128 time=0.541 ms 64 bytes from 172.23.163.39: icmp_seq=3 ttl=128 time=1.05 ms ... ...
cnplaman@pla:~/Desktop$ ifconfig Command 'ifconfig' not found, but can be installed with: sudo apt install net-tools
cnplaman@pla:~/Desktop$ ifconfig ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.227.128 netmask 255.255.255.0 broadcast 192.168.227.255 ...
item | desc |
---|---|
-c | 取消关闭 |
-r | 关闭并重启;reboot |
time | now:立即关闭;+n:n分钟后关闭;hh:mm:ss:指定时间关闭 |
item | desc |
---|---|
space | 向下翻页 |
f | forward |
b | backward |
q | 退出quit |
$ type cd cd is a shell builtin
$ ls --help Usage: ls [OPTION]... [FILE]... List information about the FILEs (the current directory by default). Sort entries alphabetically if none of -cftuvSUX nor --sort is specified. ... ...
$ cd --help cd: cd [-L|[-P [-e]] [-@]] [dir] Change the shell working directory. ... ...
item | desc |
---|---|
date | 2022年 06月 13日 星期一 19:38:25 CST |
date +%Y-%m-%d | 2022:12:23 |
date +%y | 22;年份短表示 |
date +%H:%M:%S | 21 |
date +%D | 12/23/22 |
date +%h | 12月 |
date +%s | stamp时间戳,秒数 |
date -s | 设置系统时间 |
$ date "+%Y:%m:%d %H:%M:%S"//使用字符串的形式,否则中间的空格不能识别 2022:12:23 21:29:03
item | desc |
---|---|
cal | |
cal -y | 查看本年度日历 |
cal -n | 查看n个月份的日历 |
cal year_num | 查看某年的日历 |
cal -m | 从星期一到星期日显示日历 |
cnplaman@pla:~/Desktop$ tar -cvf c.tar 01.c 02.c 03.c 01.c 02.c 03.c cnplaman@pla:~/Desktop$ ls -lh total 12K -rw-rw-r-- 1 cnplaman cnplaman 0 6月 13 20:32 01.c -rw-rw-r-- 1 cnplaman cnplaman 0 6月 13 20:32 02.c -rw-rw-r-- 1 cnplaman cnplaman 0 6月 13 20:32 03.c -rw-rw-r-- 1 cnplaman cnplaman 10K 6月 13 20:32 c.tar cnplaman@pla:~/Desktop$ tar -zcvf c.tar.gz 01.c 02.c 03.c 01.c 02.c 03.c cnplaman@pla:~/Desktop$ ls -lh total 16K -rw-rw-r-- 1 cnplaman cnplaman 0 6月 13 20:32 01.c -rw-rw-r-- 1 cnplaman cnplaman 0 6月 13 20:32 02.c -rw-rw-r-- 1 cnplaman cnplaman 0 6月 13 20:32 03.c -rw-rw-r-- 1 cnplaman cnplaman 10K 6月 13 20:32 c.tar -rw-rw-r-- 1 cnplaman cnplaman 134 6月 13 20:33 c.tar.gz
sudo apt install sl sl