美文网首页生信星球培训第五十四期
学习小组Day2笔记--ksprings

学习小组Day2笔记--ksprings

作者: ksprings | 来源:发表于2020-04-18 16:57 被阅读0次

感谢生信星球提供的服务器练习账号

Day2-linux常用命令.png

一、服务器登录

  • putty
  • Finalshell
  • ssh

二、常用命令及参数

tips :善用Tab补全命令

1. pwd 显示当前工作目录/路径

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

2. mkdir 创建目录

3. ls 显示目录、文件

bio05@VM-0-10-ubuntu:~$ ls -a
.  ..  .bash_history  .bash_logout  .bashrc  .cache  .gnupg  .profile
bio05@VM-0-10-ubuntu:~$ mkdir test
bio05@VM-0-10-ubuntu:~$ ls -a
.  ..  .bash_history  .bash_logout  .bashrc  .cache  .gnupg  .profile  test
bio05@VM-0-10-ubuntu:~$ 

4. rm 删除

  • rmdir 删除目录
bio05@VM-0-10-ubuntu:~$ rmdir test
bio05@VM-0-10-ubuntu:~$ ls -a
.  ..  .bash_history  .bash_logout  .bashrc  .cache  .gnupg  .profile
  • 删除文件
bio05@VM-0-10-ubuntu:~$ touch test.txt
bio05@VM-0-10-ubuntu:~$ ls
test.txt
bio05@VM-0-10-ubuntu:~$ rm test.txt 
bio05@VM-0-10-ubuntu:~$ ls
bio05@VM-0-10-ubuntu:~$ 

5. cd 切换目录

bio05@VM-0-10-ubuntu:~$ mkdir tmp
bio05@VM-0-10-ubuntu:~$ pwd
/home/bio05
bio05@VM-0-10-ubuntu:~$ cd tmp
bio05@VM-0-10-ubuntu:~/tmp$ pwd
/home/bio05/tmp
bio05@VM-0-10-ubuntu:~/tmp$ 

6. vi 新建文件/脚本

bio05@VM-0-10-ubuntu:~/tmp$ vi helloworld.txt
bio05@VM-0-10-ubuntu:~/tmp$ ls
helloworld.txt

7. cat/head/tail 显示全部 / 前面 / 后面文件内容

  • cat
bio05@VM-0-10-ubuntu:~/tmp$ cat helloworld.txt 
one
two
three
four
five
six
seven
eight
nine
ten
  • head
bio05@VM-0-10-ubuntu:~/tmp$ head -n4 helloworld.txt 
one
two
three
four
  • tail
bio05@VM-0-10-ubuntu:~/tmp$ tail -n5 helloworld.txt 
six
seven
eight
nine
ten

8. cp 复制

bio05@VM-0-10-ubuntu:~/tmp$ cp helloworld.txt new.txt
bio05@VM-0-10-ubuntu:~/tmp$ ls
helloworld.txt  new.txt
bio05@VM-0-10-ubuntu:~/tmp$ cat new.txt 
one
two
three
four
five
six
seven
eight
nine
ten

9. mv 移动或重命名

  • 移动
bio05@VM-0-10-ubuntu:~/tmp$ tree ~
/home/bio05
└── tmp
    ├── helloworld.txt
    └── new.txt

1 directory, 2 files
bio05@VM-0-10-ubuntu:~/tmp$ mv new.txt ~
bio05@VM-0-10-ubuntu:~/tmp$ tree ~
/home/bio05
├── new.txt
└── tmp
    └── helloworld.txt

1 directory, 2 files
  • 重命名
bio05@VM-0-10-ubuntu:~/tmp$ cd ..
bio05@VM-0-10-ubuntu:~$ ls
new.txt  tmp
bio05@VM-0-10-ubuntu:~$ mv new.txt old.txt
bio05@VM-0-10-ubuntu:~$ ls
old.txt  tmp

三、学习资源

四、思考题

  • ls输出的是横向的列表,怎样输出长格式列表?
bio05@VM-0-10-ubuntu:~$ ls -l
total 8
-rw-rw-r-- 1 bio05 bio05   49 Apr 18 16:21 old.txt
drwxrwxr-x 2 bio05 bio05 4096 Apr 18 16:26 tmp
  • 如何查看长格式列表中文件的大小?
bio05@VM-0-10-ubuntu:~$ ls -lh
total 8.0K
-rw-rw-r-- 1 bio05 bio05   49 Apr 18 16:21 old.txt
drwxrwxr-x 2 bio05 bio05 4.0K Apr 18 16:26 tmp
  • 查看Linux系统版本、内存与硬盘空间?
bio05@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
bio05@VM-0-10-ubuntu:~$ free -lh
              total        used        free      shared  buff/cache   available
Mem:           1.8G        323M         94M        5.5M        1.4G        1.3G
Low:           1.8G        1.7G         94M
High:            0B          0B          0B
Swap:            0B          0B          0B
bio05@VM-0-10-ubuntu:~$ df -lh
Filesystem      Size  Used Avail Use% Mounted on
udev            885M  4.0K  885M   1% /dev
tmpfs           184M  5.5M  178M   3% /run
/dev/vda1        50G   25G   23G  53% /
tmpfs           917M   48K  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/1157
tmpfs           184M     0  184M   0% /run/user/1158
tmpfs           184M     0  184M   0% /run/user/1159
tmpfs           184M     0  184M   0% /run/user/1161
  • 怎样建立类似/tmp/tmp1/tmp1.1 这样的层级目录?
bio05@VM-0-10-ubuntu:~$ tree
.
└── old.txt

0 directories, 1 file
bio05@VM-0-10-ubuntu:~$ mkdir -p tmp/tmp1/tmp1.1
bio05@VM-0-10-ubuntu:~$ tree
.
├── old.txt
└── tmp
    └── tmp1
        └── tmp1.1

3 directories, 1 file
  • 怎样删除这些层级目录?
bio05@VM-0-10-ubuntu:~$ rm -r tmp
bio05@VM-0-10-ubuntu:~$ tree
.
└── old.txt

0 directories, 1 file

相关文章

  • 学习小组Day2笔记--ksprings

    感谢生信星球提供的服务器练习账号 一、服务器登录 putty Finalshell ssh 二、常用命令及参数 t...

  • 2020-03-08

    学习小组day2笔记——肖舒 Linux入门 -常用的基本操作及其易错点

  • 学习小组Day4 -- ksprings

    学习资料 R for Data Science R数据科学--详解ggplot2 学习笔记 准备--载入包 tid...

  • 学习小组Day5 -- ksprings

    一、新手tips 赋值符号是 <-("alt"+"-")Console 控制台输入的是单行命令代码中括号是英文的显...

  • 学习小组Day6-ksprings

    一、R包安装加载 1. 镜像 options("repos" = c(CRAN="https://mirrors....

  • 学习小组Day7-ksprings

    最后一天,偷偷懒,只挂图,不说话,嘿嘿! ps:感谢生信星球提供的优秀教程,感谢花花和豆豆的耐心指导,收获颇丰!希...

  • 学习小组Day3笔记--ksprings

    教程-- conda管理生信软件一文就够 下载(选择最新的合适版本) 清华镜像 安装bash 激活source 添...

  • 2020-06-16

    学习小组Day2笔记--马小林 1、如何使用LINUX 对于windows系统的用户 可以选择在Windows10...

  • 2019-08-07 Day2——DFL

    Day2 学习笔记

  • 学习小组Day2笔记--jam

    学习小组Day2笔记--jam linux系统 基本命令 登录ssh -p 端口 用户名@ip地址 pwd 我在哪...

网友评论

    本文标题:学习小组Day2笔记--ksprings

    本文链接:https://www.haomeiwen.com/subject/jmsbvhtx.html