Day2——庚帥博方便面

Windows 10 已經(jīng)有WSL Cmder作為terminal 好看一些

ssh登錄服務(wù)器

ssh_login.png

顯示當(dāng)前路徑

bio01@VM-0-10-ubuntu:~$ pwd
/home/bio01

創(chuàng)建目錄&顯示目錄列表

bio01@VM-0-10-ubuntu:~$ mkdir biosoft
bio01@VM-0-10-ubuntu:~$ mkdir project
bio01@VM-0-10-ubuntu:~$ mkdir tmp
bio01@VM-0-10-ubuntu:~$ mkdir src
bio01@VM-0-10-ubuntu:~$ ls
biosoft  project  src  tmp

刪除操作

bio01@VM-0-10-ubuntu:~$ mkdir rm_test
bio01@VM-0-10-ubuntu:~$ ls
biosoft  project  rm_test  src  tmp
bio01@VM-0-10-ubuntu:~$ cd rm_test/
bio01@VM-0-10-ubuntu:~/rm_test$ touch doodle.txt
bio01@VM-0-10-ubuntu:~/rm_test$ ls
doodle.txt
bio01@VM-0-10-ubuntu:~/rm_test$ vi doodle.txt
bio01@VM-0-10-ubuntu:~/rm_test$ mkdir chao
bio01@VM-0-10-ubuntu:~/rm_test$ cd chao
bio01@VM-0-10-ubuntu:~/rm_test/chao$ touch delete.txt
bio01@VM-0-10-ubuntu:~/rm_test/chao$ ls
delete.txt
bio01@VM-0-10-ubuntu:~/rm_test/chao$ cd ..
bio01@VM-0-10-ubuntu:~/rm_test$ ls
chao  doodle.txt
bio01@VM-0-10-ubuntu:~/rm_test$ rm doodle.txt
bio01@VM-0-10-ubuntu:~/rm_test$ ls
chao
bio01@VM-0-10-ubuntu:~/rm_test$ rm -r chao
bio01@VM-0-10-ubuntu:~/rm_test$ ls
bio01@VM-0-10-ubuntu:~/rm_test$ cd ..
bio01@VM-0-10-ubuntu:~$ ls
biosoft  project  rm_test  src  tmp
bio01@VM-0-10-ubuntu:~$ rmdir rm_test/
bio01@VM-0-10-ubuntu:~$ ls
biosoft  project  src  tmp

進入目錄/返回之前目錄

bio01@VM-0-10-ubuntu:~$ cd ~
bio01@VM-0-10-ubuntu:~$ cd
bio01@VM-0-10-ubuntu:~$ ls
biosoft  project  src  tmp
bio01@VM-0-10-ubuntu:~$ cd tmp
bio01@VM-0-10-ubuntu:~/tmp$ ls
bio01@VM-0-10-ubuntu:~/tmp$ cd ~/src
bio01@VM-0-10-ubuntu:~/src$ cd -
/home/bio01/tmp
bio01@VM-0-10-ubuntu:~/tmp$ cd
bio01@VM-0-10-ubuntu:~$ pwd
/home/bio01
bio01@VM-0-10-ubuntu:~$

vi文本編輯

bio01@VM-0-10-ubuntu:~$ cd tmp
bio01@VM-0-10-ubuntu:~/tmp$ ls
bio01@VM-0-10-ubuntu:~/tmp$ cd ~/src
bio01@VM-0-10-ubuntu:~/src$ cd -
/home/bio01/tmp
bio01@VM-0-10-ubuntu:~/tmp$ cd
bio01@VM-0-10-ubuntu:~$ pwd
/home/bio01
bio01@VM-0-10-ubuntu:~$ cd tmp
bio01@VM-0-10-ubuntu:~/tmp$ ls
bio01@VM-0-10-ubuntu:~/tmp$ vi hello_world.txt

文本內(nèi)容輸出到屏幕

bio01@VM-0-10-ubuntu:~/tmp$ cat hello_world.txt
I'm not a newbie on linux.
But login with ssh again is great.
We should be careful with "rm".
I do learn a new trick:
"cd -" is capale to bring you back to the directory you visit.
Oops
I'm not that familiar with vi hot keys
bioinformatics planet is great
bioinformatics planet is great
bioinformatics planet is great
bio01@VM-0-10-ubuntu:~/tmp$ head hello_world.txt
I'm not a newbie on linux.
But login with ssh again is great.
We should be careful with "rm".
I do learn a new trick:
"cd -" is capale to bring you back to the directory you visit.
Oops
I'm not that familiar with vi hot keys
bioinformatics planet is great
bioinformatics planet is great
bioinformatics planet is great
bio01@VM-0-10-ubuntu:~/tmp$ head -n 3 hello_world.txt
I'm not a newbie on linux.
But login with ssh again is great.
We should be careful with "rm".

復(fù)制/移動文件

bio01@VM-0-10-ubuntu:~/tmp$ cp hello_world.txt new_file.txt
bio01@VM-0-10-ubuntu:~/tmp$ ls
hello_world.txt  new_file.txt
bio01@VM-0-10-ubuntu:~/tmp$ mv hello_world.txt ~/home.txt
bio01@VM-0-10-ubuntu:~/tmp$ ls
new_file.txt
bio01@VM-0-10-ubuntu:~/tmp$ ls ~
biosoft  home.txt  project  src  tmp

練習(xí)探索

//longlist printing
bio01@VM-0-10-ubuntu:~/tmp$ ls -l 
total 4
-rw-rw-r-- 1 bio01 bio01 318 Dec 17 23:29 new_file.txt
bio01@VM-0-10-ubuntu:~/tmp$ cd ~
bio01@VM-0-10-ubuntu:~$ ls -l
total 20
drwxrwxr-x 2 bio01 bio01 4096 Dec 17 23:14 biosoft
-rw-rw-r-- 1 bio01 bio01  318 Dec 17 23:27 home.txt
drwxrwxr-x 2 bio01 bio01 4096 Dec 17 23:14 project
drwxrwxr-x 2 bio01 bio01 4096 Dec 17 23:14 src
drwxrwxr-x 2 bio01 bio01 4096 Dec 17 23:29 tmp
bio01@VM-0-10-ubuntu:~$ ls -l -k
total 20
drwxrwxr-x 2 bio01 bio01 4096 Dec 17 23:14 biosoft
-rw-rw-r-- 1 bio01 bio01  318 Dec 17 23:27 home.txt
drwxrwxr-x 2 bio01 bio01 4096 Dec 17 23:14 project
drwxrwxr-x 2 bio01 bio01 4096 Dec 17 23:14 src
drwxrwxr-x 2 bio01 bio01 4096 Dec 17 23:29 tmp
// print as long list; size measured with k
bio01@VM-0-10-ubuntu:~$ ls -lk
total 20
drwxrwxr-x 2 bio01 bio01 4096 Dec 17 23:14 biosoft
-rw-rw-r-- 1 bio01 bio01  318 Dec 17 23:27 home.txt
drwxrwxr-x 2 bio01 bio01 4096 Dec 17 23:14 project
drwxrwxr-x 2 bio01 bio01 4096 Dec 17 23:14 src
drwxrwxr-x 2 bio01 bio01 4096 Dec 17 23:29 tmp
// Linux system version
bio01@VM-0-10-ubuntu:~$ lsb_release -a 
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.1 LTS
Release:        18.04
Codename:       bionic
// kernel version
bio01@VM-0-10-ubuntu:~$ uname -a 
Linux VM-0-10-ubuntu 4.15.0-54-generic #58-Ubuntu SMP Mon Jun 24 10:55:24 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
//CPU information
bio01@VM-0-10-ubuntu:~$ cat /proc/cpuinfo 
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 94
model name      : Intel(R) Xeon(R) Gold 61xx CPU
stepping        : 3
microcode       : 0x1
cpu MHz         : 2500.000
cache size      : 4096 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 rdseed adx smap xsaveopt xsavec xgetbv1 arat
bugs            : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds
bogomips        : 5000.00
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:
//hardisk space
bio01@VM-0-10-ubuntu:~$ df -lm 
Filesystem     1M-blocks  Used Available Use% Mounted on
udev                 885     1       885   1% /dev
tmpfs                184     6       179   3% /run
/dev/vda1          50332  8510     39677  18% /
tmpfs                917     1       917   1% /dev/shm
tmpfs                  5     0         5   0% /run/lock
tmpfs                917     0       917   0% /sys/fs/cgroup
tmpfs                184     0       184   0% /run/user/1001
tmpfs                184     0       184   0% /run/user/1004
bio01@VM-0-10-ubuntu:~$ df -l
Filesystem     1K-blocks    Used Available Use% Mounted on
udev              906224       4    906220   1% /dev
tmpfs             187740    5428    182312   3% /run
/dev/vda1       51539404 8713512  40628696  18% /
tmpfs             938680      24    938656   1% /dev/shm
tmpfs               5120       0      5120   0% /run/lock
tmpfs             938680       0    938680   0% /sys/fs/cgroup
tmpfs             187736       0    187736   0% /run/user/1001
tmpfs             187736       0    187736   0% /run/user/1004
//memerory info
bio01@VM-0-10-ubuntu:~$ free -m 
              total        used        free      shared  buff/cache   available
Mem:           1833         235         168           5        1429        1410
Swap:             0           0           0
bio01@VM-0-10-ubuntu:~$ ls
biosoft  home.txt  project  src  tmp
bio01@VM-0-10-ubuntu:~$ cd tmp
// create and remove hierarchy directories
bio01@VM-0-10-ubuntu:~/tmp$ mkdir -p /tmp/tmp1/tmp1.1
bio01@VM-0-10-ubuntu:~/tmp$ ls
new_file.txt
bio01@VM-0-10-ubuntu:~/tmp$ rm -r /tmp/tmp1
rm: descend into write-protected directory '/tmp/tmp1'? y
rm: remove write-protected directory '/tmp/tmp1/tmp1.1'? y
rm: cannot remove '/tmp/tmp1/tmp1.1': Permission denied
bio01@VM-0-10-ubuntu:~/tmp$ mkdir -p ~/tmp/tmp1/tmp1.1
bio01@VM-0-10-ubuntu:~/tmp$ ls -R
.:
new_file.txt  tmp1

./tmp1:
tmp1.1

./tmp1/tmp1.1:
bio01@VM-0-10-ubuntu:~/tmp$ rm -r tmp1
bio01@VM-0-10-ubuntu:~/tmp$ ls
new_file.txt
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

友情鏈接更多精彩內(nèi)容