一、Linux使用
- 纯linux操作系统
- 虚拟机
- 本地服务器
- 云服务器
二、登录方法(windows)
百度网盘下载xshell
运行,输入
ssh bio05@42.192.49.xx
显示:
Connecting to 42.192.49.166:22...
Connection established.
To escape to local shell, press 'Ctrl+Alt+]'.
输入密码后,显示
Welcome to Ubuntu 18.04.4 LTS (GNU/Linux 4.15.0-118-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
System information as of Tue Apr 20 17:49:32 CST 2021
System load: 0.0 Processes: 86
Usage of /: 12.6% of 49.15GB Users logged in: 0
Memory usage: 13% IP address for eth0: 172.17.0.6
Swap usage: 0%
* Introducing self-healing high availability clusters in MicroK8s.
Simple, hardened, Kubernetes for production, from RaspberryPi to DC.
https://microk8s.io/high-availability
* Canonical Livepatch is available for installation.
- Reduce system reboots and improve kernel security. Activate at:
https://ubuntu.com/livepatch
New release '20.04.2 LTS' available.
Run 'do-release-upgrade' to upgrade to it.
The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.
/usr/bin/xauth: file /home/bio05/.Xauthority does not exist
登录成功
#显示当前路径
bio05@VM-0-6-ubuntu:~$ pwd
/home/bio05
#新建操作
bio05@VM-0-6-ubuntu:~$ mkdir biosoft #新建文件夹biosoft
bio05@VM-0-6-ubuntu:~$ mkdir project #新建文件夹project
bio05@VM-0-6-ubuntu:~$ mkdir tmp #新建文件夹tmp
bio05@VM-0-6-ubuntu:~$ mkdir src #新建文件夹src
#显示列表
bio05@VM-0-6-ubuntu:~$ ls #显示列表
biosoft project src tmp
#删除操作
bio05@VM-0-6-ubuntu:~$ mkdir rm_test #建立rm_test文件夹
bio05@VM-0-6-ubuntu:~$ cd rm_test/ #进入rm_test文件夹
bio05@VM-0-6-ubuntu:~/rm_test$ touch doodle.txt #新建doodle.txt文件
bio05@VM-0-6-ubuntu:~/rm_test$ ls #查看列表
doodle.txt
bio05@VM-0-6-ubuntu:~/rm_test$ mkdir huahua #新建huahua文件夹
bio05@VM-0-6-ubuntu:~/rm_test$ cd huahua/ #进入huahua文件夹
bio05@VM-0-6-ubuntu:~/rm_test/huahua$ touch huahua.txt #新建huahua.txt文本文件
bio05@VM-0-6-ubuntu:~/rm_test/huahua$ cd ..#返回到上级目录
bio05@VM-0-6-ubuntu:~/rm_test$ ls #显示列表
doodle.txt huahua
bio05@VM-0-6-ubuntu:~/rm_test$ rm doodle.txt #删除doodle.txt 文件
bio05@VM-0-6-ubuntu:~/rm_test$ ls #删除成功
huahua
bio05@VM-0-6-ubuntu:~/rm_test$ rm -r huahua/ #删除非空文件夹 huahua
bio05@VM-0-6-ubuntu:~/rm_test$ ls #删除成功
bio05@VM-0-6-ubuntu:~/rm_test$ cd ..#返回上级文件夹
bio05@VM-0-6-ubuntu:~$ rmdir rm_test/ #删除空文件夹
bio05@VM-0-6-ubuntu:~$ ls #删除成功
biosoft project src tmp
#文件操作
bio05@VM-0-6-ubuntu:~$ cd tmp/ #进入tmp
bio05@VM-0-6-ubuntu:~/tmp$ vi hello_world.txt #建立并编辑文本文档
bio05@VM-0-6-ubuntu:~/tmp$ cat hello_world.txt #输出文档内容到屏幕
Thanks teachers this is hello_world.txt
bio05@VM-0-6-ubuntu:~/tmp$ head -n 3 hello_world.txt #查看前3行
Thanks teachers this is hello_world.txt
#复制与移动
bio05@VM-0-6-ubuntu:~/tmp$ ls
hello_world.txt
bio05@VM-0-6-ubuntu:~/tmp$ cp hello_world.txt new_file.txt #将刚才新建的文件复制一个,叫做new_file.txt
bio05@VM-0-6-ubuntu:~/tmp$ ls
hello_world.txt new_file.txt
bio05@VM-0-6-ubuntu:~/tmp$ cat new_file.txt #查看复制后的文件内容
Thanks teachers this is hello_world.txt
bio05@VM-0-6-ubuntu:~/tmp$ mv new_file.txt home.txt #将new_file.txt重命名为home.txt
bio05@VM-0-6-ubuntu:~/tmp$ ls
hello_world.txt home.txt
bio05@VM-0-6-ubuntu:~/tmp$ mv home.txt ~/ 将home.txt移动到家目录
bio05@VM-0-6-ubuntu:~/tmp$ ls
hello_world.txt
bio05@VM-0-6-ubuntu:~/tmp$ cd ..
bio05@VM-0-6-ubuntu:~$ ls
biosoft home.txt project src tmp
#输出长格式目录列表
bio05@VM-0-6-ubuntu:~$ ls -l
total 20
drwxrwxr-x 2 bio05 bio05 4096 Apr 20 17:58 biosoft
-rw-rw-r-- 1 bio05 bio05 42 Apr 20 18:10 home.txt
drwxrwxr-x 2 bio05 bio05 4096 Apr 20 17:59 project
drwxrwxr-x 2 bio05 bio05 4096 Apr 20 17:59 src
drwxrwxr-x 2 bio05 bio05 4096 Apr 20 18:11 tmp
#查看文件大小
bio05@VM-0-6-ubuntu:~$ ls -s #file size
total 20
4 biosoft 4 home.txt 4 project 4 src 4 tmp
#查看操作系统
bio05@VM-0-6-ubuntu:~$ uname -a
Linux VM-0-6-ubuntu 4.15.0-118-generic #119-Ubuntu SMP Tue Sep 8 12:30:01 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
#查看cpu信息
bio05@VM-0-6-ubuntu:~$ cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 94
model name : Intel(R) Xeon(R) Gold 6148 CPU @ 2.40GHz
stepping : 3
microcode : 0x1
cpu MHz : 2394.374
cache size : 28160 KB
physical id : 0
siblings : 1
core id : 0
cpu cores : 1
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl cpuid tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti fsgsbase bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 arat
bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs taa itlb_multihit srbds
bogomips : 4788.74
clflush size : 64
cache_alignment : 64
address sizes : 46 bits physical, 48 bits virtual
power management:
#查看内存信息
bio05@VM-0-6-ubuntu:~$ cat /proc/meminfo
MemTotal: 1877052 kB
MemFree: 293652 kB
MemAvailable: 1550424 kB
Buffers: 160044 kB
Cached: 1183516 kB
SwapCached: 0 kB
Active: 869624 kB
Inactive: 547672 kB
Active(anon): 79176 kB
Inactive(anon): 340 kB
Active(file): 790448 kB
Inactive(file): 547332 kB
Unevictable: 0 kB
Mlocked: 0 kB
SwapTotal: 0 kB
SwapFree: 0 kB
Dirty: 544 kB
Writeback: 0 kB
AnonPages: 73760 kB
Mapped: 113308 kB
Shmem: 5780 kB
Slab: 135288 kB
SReclaimable: 99492 kB
SUnreclaim: 35796 kB
KernelStack: 1724 kB
PageTables: 4416 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 938524 kB
Committed_AS: 372680 kB
VmallocTotal: 34359738367 kB
VmallocUsed: 0 kB
VmallocChunk: 0 kB
HardwareCorrupted: 0 kB
AnonHugePages: 0 kB
ShmemHugePages: 0 kB
ShmemPmdMapped: 0 kB
CmaTotal: 0 kB
CmaFree: 0 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
DirectMap4k: 1879920 kB
DirectMap2M: 217088 kB
DirectMap1G: 0 kB
#查看硬盘空间
bio05@VM-0-6-ubuntu:~$ df -hl
Filesystem Size Used Avail Use% Mounted on
udev 885M 0 885M 0% /dev
tmpfs 184M 5.7M 178M 4% /run
/dev/vda1 50G 6.3G 41G 14% /
tmpfs 917M 24K 917M 1% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 917M 0 917M 0% /sys/fs/cgroup
tmpfs 184M 0 184M 0% /run/user/1006
#新建多级目录
bio05@VM-0-6-ubuntu:~$ mkdir -p /tmp/tmp/tmp/
bio05@VM-0-6-ubuntu:~$ ls
biosoft home.txt project src tmp
bio05@VM-0-6-ubuntu:~$ cd tmp
#删除多级目录
bio05@VM-0-6-ubuntu:~$ rm -r tmp
bio05@VM-0-6-ubuntu:~$ ls
biosoft home.txt project src