DAY2 学习小组笔记 那朵花的名字叫面码

Linux介绍

今日概览

1.什么是Linux,什么是服务器

Linux

Linux是一套免费使用和自由传播的操作系统内核,是一个基于POSIX和Unix的多用户、多任务、支持多线程和多CPU的操作系统内核。它能运行主要的Unix工具软件、应用程序和网络协议。它支持32位和64位硬件。Linux继承了Unix以网络为核心的设计思想,是一个性能稳定的多用户网络操作系统内核

服务器

服务器是计算机的一种,它比普通计算机运行更快、负载更高、价格更贵。服务器在网络中为其它客户机(如PC机、智能手机、ATM等终端甚至是火车系统等大型设备)提供计算或者应用服务。服务器具有高速的CPU运算能力、长时间的可靠运行、强大的I/O外部数据吞吐能力以及更好的扩展性

Linux服务器

Linux服务器是设计出来进行业务处理应用的,在网络和计算机系统当中有广泛的应用,可以提供数据库管理和网络服务等内容,是一种性能非常高的和开源的服务器,在我国的计算机系统的客户端当中,有很多采用的就是Linux系统,其使用的范围非常广泛,用户体验反应较好。但是对于一些希望计算机应用性能比较高的单位而言,windows系统需要经常进行资源整合和碎片化管理,系统在配置的时候经常需要重新启动,这就无法避免产生停机的问题。同时,由于Linux系统的处理能力非常强悍,具备不可比拟的稳定性特征,因而Linux系统就不用经常进行重启,Linux系统的变化可以在配置的过程中实现,所以Linux服务器出现故障的概率比较小,所以很多企业组织在计算机配置的过程中经常使用Linux系统,从而降低服务器发生崩溃的可能性,很多企业在配置Linux系统的时候,都是通过减少服务器的故障发生率,实现企业业务的高效运转

2.生信为什么需要学Linux

Linux可以快速、批量的处理数据,用命令行完成复杂、重复的操作过程,在生信学习和统计中可以节约时间。

个人认为,Linux操作系统和类Linux操作系统的命令行界面是最适合进行生物信息分析的操作系统。原因有三点:

  • 长期运行的稳定性
  • 多数软件只有Linux版本
  • 强大的Bash命令简化繁琐的操作,尤其是大大简化重复性工作

3.如何召唤linux--阿里云服务器

Linux可以在Win、Mac OS、本地服务器还有云服务器上运行
本次是使用Mac的terminal登录阿里云服务器进行练习的(不用下载putty了)

4.Linux的基本操作

打开终端后,将云服务器的账号输入命令行$后:

(base) Windys-MacBook-Air:~ windy$ ssh [email protected]
[email protected]'s password: 
Welcome to Ubuntu 18.04.1 LTS (GNU/Linux 4.15.0-54-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Tue Mar 10 11:14:16 CST 2020

  System load:  0.0                Processes:           95
  Usage of /:   47.5% of 49.15GB   Users logged in:     1
  Memory usage: 28%                IP address for eth0: 172.17.0.10
  Swap usage:   0%

 * Latest Kubernetes 1.18 beta is now available for your laptop, NUC, cloud
   instance or Raspberry Pi, with automatic updates to the final GA release.

     sudo snap install microk8s --channel=1.18/beta --classic

 * Multipass 1.1 adds proxy support for developers behind enterprise
   firewalls. Rapid prototyping for cloud operations just got easier.

     https://multipass.run/

 * Canonical Livepatch is available for installation.
   - Reduce system reboots and improve kernel security. Activate at:
     https://ubuntu.com/livepatch

*** System restart required ***

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.

可以看到

bio18@VM-0-10-ubuntu:~$

表示已经进入我们的用户界面,在~(家目录)中了
pwd 显示目前的路径(print working directory)

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

mkdir 创建一个文件夹,后面空格后加文件夹的名字

bio18@VM-0-10-ubuntu:~$ mkdir biosoft #存放生信软件
bio18@VM-0-10-ubuntu:~$ mkdir project #存放生信项目
bio18@VM-0-10-ubuntu:~$ mkdir tmp #存放杂七杂八
bio18@VM-0-10-ubuntu:~$ mkdir src #存放源代码

ls 显示该路径中所有的文件

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

rm 删除文件
rmdir 删除一个非空文件夹
rm -r 删除一个空文件夹

bio18@VM-0-10-ubuntu:~$ mkdir rm_test #创建一个文件夹
bio18@VM-0-10-ubuntu:~$ cd rm_test #进入文件夹
bio18@VM-0-10-ubuntu:~/rm_test$ touch doodle.txt #创建一个文本文件
bio18@VM-0-10-ubuntu:~/rm_test$ mkdir huahua #创建一个叫huahua的文件夹
bio18@VM-0-10-ubuntu:~/rm_test$ cd huahua #进入huahua文件夹
bio18@VM-0-10-ubuntu:~/rm_test/huahua$ touch haha.txt # 创建huahua的文本文件
bio18@VM-0-10-ubuntu:~/rm_test/huahua$ cd  # 回到根目录
bio18@VM-0-10-ubuntu:~/rm_test$ rm doodle.txt #删除doodle文本文件
bio18@VM-0-10-ubuntu:~/rm_test$ rm -r huahua #删除huahua文件夹
bio18@VM-0-10-ubuntu:~/rm_test$ cd
bio18@VM-0-10-ubuntu:~$ rmdir rm_test #删除rm_test文件夹
bio18@VM-0-10-ubuntu:~$ ls #显示目前有哪些文件夹,可以看见rm_test已经删除
biosoft  project  src  tmp

cd 接一个目录名,进入该目录

bio18@VM-0-10-ubuntu:~$ cd rm_test 
bio18@VM-0-10-ubuntu:~/rm_test$
bio18@VM-0-10-ubuntu:~/rm_test$ cd - #回到上一级
/home/bio18

cat *查看并显示内容

bio18@VM-0-10-ubuntu:~/tmp$ vi hello world.txt #新建脚本,输入文本
2 files to edit
Esc   #退出编辑模式
:x   #保存退出
bio18@VM-0-10-ubuntu:~/tmp$ cat hello #显查看并显示hello的内容
Life Story
After you've been to bed together for the first time
without the advantage or disavantage of any prior
acquaintance,
the other party very often says to you,
Tell me about yourself, I want to know all about you,
what's your story? And you think maybe they really and trully do

bio18@VM-0-10-ubuntu:~/tmp$ head hello #显示前10行
Life Story
After you've been to bed together for the first time
without the advantage or disavantage of any prior
acquaintance,
the other party very often says to you,
Tell me about yourself, I want to know all about you,
what's your story? And you think maybe they really and trully do

bio18@VM-0-10-ubuntu:~/tmp$ head -n 3 hello 显示前3行
Life Story
After you've been to bed together for the first time
without the advantage or disavantage of any prior

cp 复制,后面用空格分开给复制的文件的重新命名

bio18@VM-0-10-ubuntu:~/tmp$ cp hello file
bio18@VM-0-10-ubuntu:~/tmp$ ls
file  hello  world.txt
bio18@VM-0-10-ubuntu:~/tmp$ cat file
Life Story
After you've been to bed together for the first time
without the advantage or disavantage of any prior
acquaintance,
the other party very often says to you,
Tell me about yourself, I want to know all about you,
what's your story? And you think maybe they really and trully do

ctr+C退出
mv 移动或重命名

bio18@VM-0-10-ubuntu:~/tmp$ mv hello ~/src #文件名后面用空格接路径,就是将该文件移动到该路径的目录中
bio18@VM-0-10-ubuntu:~/tmp$ ls
bio18@VM-0-10-ubuntu:~/tmp$ cd -
/home/bio18
bio18@VM-0-10-ubuntu:~$ cd src
bio18@VM-0-10-ubuntu:~/src$ ls
hello
bio18@VM-0-10-ubuntu:~/tmp$ mv hello src #文件名后用空格接新文件名,可以将该文件重命名
bio18@VM-0-10-ubuntu:~/tmp$ ls
src

后续可以在Linux命令大全上进行更多命令的发掘使用,或者直接在终端使用man命令,后面空格接一个指令,可以看到该指令的使用说明
推荐视频:马哥linux视频教程

你可能感兴趣的:(DAY2 学习小组笔记 那朵花的名字叫面码)