linux软件安装

shell就是一个“翻译官”

让我们能与内核交流沟通:

shell分类

shell

补充知识点:

mkdir 创建文件夹

mkdir -p逐级创建文件夹

rm删除非空的文件夹

rm -r递归地删除 ,eg rm -r a/可以删除a/b/c等

rmdir -p逐级删除文件夹

cp复制 移动文件使用:

(base) [yangjy@GSCG01 test]$ ls #test文件夹下有两个文件

clean sra

(base) [yangjy@GSCG01 test]$ cp -r clean/ sra/ #使用cp -r 将clean复制到sra文件夹下

(base) [yangjy@GSCG01 test]$ cd sra/ #成功!

(base) [yangjy@GSCG01 sra]$ ls

clean

cp 不能直接复制文件夹,只能直接复制文件,可以使用参数-r来辅助

(base) [yangjy@GSCG01 test]$ cp sra/ clean/

cp: omitting directory ‘sra/’ #报错

(base) [yangjy@GSCG01 test]$ cp sra/clean/ clean/

cp: omitting directory ‘sra/clean/’ #报错

(base) [yangjy@GSCG01 test]$ cp -r sra/clean/ clean/ #加上参数-r

(base) [yangjy@GSCG01 test]$ ls -lh #成功

total 0

drwxrwxr-x. 3 yangjy yangjy 19 Jan 30 09:52 clean

drwxrwxr-x. 3 yangjy yangjy 19 Jan 30 09:47 sra

环境变量

如何查看环境变量----两个命令env以及export

显示变量值 ----echo $变量名;一定要加上$,echo才能将变量名替换为实际变量值。

echo $PATH

/bin:/usr/bin:/home/yangjy/GEOgetools/sratoolkit.2.10.8-centos_linux64/bin:/home/yangjy/GEOgetools/sratoolkit.2.10.8-centos_linux64/bin:/home/yangjy/miniconda3:/root/usr/local/sratoolkit.2.10.8-centos_linux64/bin:/home/yangjy/.GEOgetools/:/home/yangjy/.aspera/connect/bin/:/home/yangjy/.local/bin:/home/yangjy/bin

路径都是以bin结尾;可以通过ls 路径/bin来查看

通过ls 路径/bin | less来逐个的查看

所以,PATH存放命令的查找路径,类似快捷方式

如果出现ls无法识别;可能是破坏了环境变量,解决:PATH="路径" eg:

PATH="/bin:/usr/bin:/home/yangjy/GEOgetools/sratoolkit.2.10.8-centos_linux64/bin:/home/yangjy/GEOgetools/sratoolkit.2.10.8-centos_linux64/bin:/home/yangjy/miniconda3:/root/usr/local/sratoolkit.2.10.8-centos_linux64/bin:/home/yangjy/.GEOgetools/:/home/yangjy/.aspera/connect/bin/:/home/yangjy/.local/bin:/home/yangjy/bin"

配置环境变量

-系统级配置文件: /etc/profile

- # 用户配置文件:~/.bashrc

使用vim ~/.bashrc可以进入;

---> vim快捷键

shift+g=G可以跳转最后一行

在最后一行输入export 变量

按ESC后 :wq保存并且退出

#通过配置该环境变量,使得重启后依然有效;

#关于vim

#使用vimtutor查看教程

===============================================================================

= W e l c o m e t o t h e V I M T u t o r - Version 1.7 =

===============================================================================

Vim is a very powerful editor that has many commands, too many to

explain in a tutor such as this. This tutor is designed to describe

enough of the commands that you will be able to easily use Vim as

an all-purpose editor.

The approximate time required to complete the tutor is 25-30 minutes,

depending upon how much time is spent with experimentation.

ATTENTION:

The commands in the lessons will modify the text. Make a copy of this

file to practise on (if you started "vimtutor" this is already a copy).

It is important to remember that this tutor is set up to teach by

use. That means that you need to execute the commands to learn them

properly. If you only read the text, you will forget the commands!

Now, make sure that your Shift-Lock key is NOT depressed and press

the j key enough times to move the cursor so that Lesson 1.1

completely fills the screen.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Lesson 1.1: MOVING THE CURSOR

** To move the cursor, press the h,j,k,l keys as indicated. **

^

k Hint: The h key is at the left and moves left.

< h l > The l key is at the right and moves right.

j The j key looks like a down arrow.

v

1. Move the cursor around the screen until you are comfortable.

2. Hold down the down key (j) until it repeats.

Now you know how to move to the next lesson.

3. Using the down key, move to Lesson 1.2.

重点:

大写键caps lock不要打开

通过J可以移动光标。

hljk键可以左右上下移动,功能同键盘上的箭头键;

NOTE: If you are ever unsure about something you typed, press to place

you in Normal mode. Then retype the command you wanted.

NOTE: The cursor keys should also work. But using hjkl you will be able to

move around much faster, once you get used to it. Really!

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Lesson 1.2: EXITING VIM

!! NOTE: Before executing any of the steps below, read this entire lesson!!

1. Press the key (to make sure you are in Normal mode).

2. Type: :q! .

This exits the editor, DISCARDING any changes you have made.

3. When you see the shell prompt, type the command that got you into this

tutor. That would be: vimtutor

4. If you have these steps memorized and are confident, execute steps

1 through 3 to exit and re-enter the editor.

NOTE: :q! discards any changes you made. In a few lessons you

will learn how to save the changes to a file.

5. Move the cursor down to Lesson 1.3

#注意:如果键入了不确定的内容, press 回到正常模式,使用q!退出去。(不会保存修改)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Lesson 1.3: TEXT EDITING - DELETION

** Press x to delete the character under the cursor. **

1. Move the cursor to the line below marked --->.

2. To fix the errors, move the cursor until it is on top of the

character to be deleted.

3. Press the x key to delete the unwanted character.

4. Repeat steps 2 through 4 until the sentence is correct.

---> The ccow jumpedd ovverr thhe mooon.

5. Now that the line is correct, go on to Lesson 1.4.

NOTE: As you go through this tutor, do not try to memorize, learn by usage.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Lesson 1.4: TEXT EDITING - INSERTION

** Press i to insert text. **

1. Move the cursor to the first line below marked --->.

2. To make the first line the same as the second, move the cursor on top

of the first character AFTER where the text is to be inserted.

3. Press i and type in the necessary additions.

4. As each error is fixed press to return to Normal mode.

Repeat steps 2 through 4 to correct the sentence.

---> There is text misng this .

---> There is some text missing from this line.

5. When you are comfortable inserting text move to lesson 1.5.

重点:

如果想要删除某个字符/串,使用x来(是往后删除!);

按i进入编辑模式,按esc退出到浏览模式;

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Lesson 1.5: TEXT EDITING - APPENDING

** Press A to append text. **

1. Move the cursor to the first line below marked --->.

It does not matter on what character the cursor is in that line.

2. Press A and type in the necessary additions.

3. As the text has been appended press to return to Normal mode.

4. Move the cursor to the second line marked ---> and repeat

steps 2 and 3 to correct this sentence.

---> There is some text missing from th

There is some text missing from this line.

---> There is also some text miss

There is also some text missing here.

5. When you are comfortable appending text move to lesson 1.6.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Lesson 1.6: EDITING A FILE

** Use :wq to save a file and exit. **

!! NOTE: Before executing any of the steps below, read this entire lesson!!

1. Exit this tutor as you did in lesson 1.2: :q!

Or, if you have access to another terminal, do the following there.

2. At the shell prompt type this command: vim tutor

'vim' is the command to start the Vim editor, 'tutor' is the name of the

file you wish to edit. Use a file that may be changed.

3. Insert and delete text as you learned in the previous lessons.

4. Save the file with changes and exit Vim with: :wq

5. If you have quit vimtutor in step 1 restart the vimtutor and move down to the following summary.

重点:Press A 也可以进入编辑模式。与i进入编辑的区别:

i是在光标处进行编辑 ;A是在光标后进行编辑

Use :wq to save a file and exit

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Lesson 1 SUMMARY

1. The cursor is moved using either the arrow keys or the hjkl keys.

h (left) j (down) k (up) l (right)

2. To start Vim from the shell prompt type: vim FILENAME

3. To exit Vim type: :q! to trash all changes.

OR type: :wq to save the changes.

4. To delete the character at the cursor type: x

5. To insert or append text type:

i type inserted text insert before the cursor

A type appended text append after the line

NOTE: Pressing will place you in Normal mode or will cancel

an unwanted and partially completed command.

使用esc在插入模式和编辑模式进行切换

Lesson 2.1: DELETION COMMANDS

** Type dw to delete a word. **

1. Press to make sure you are in Normal mode.

2. Move the cursor to the line below marked --->.

3. Move the cursor to the beginning of a word that needs to be deleted.

4. Type dw to make the word disappear.

NOTE: The letter d will appear on the last line of the screen as you type

it. Vim is waiting for you to type w . If you see another character

than d you typed something wrong; press and start over.

---> There are a some words fun that don't belong paper in this sentence.

5. Repeat steps 3 and 4 until the sentence is correct and go to Lesson 2.2.

使用dw 可以删除字符

Lesson 2.2: MORE DELETION COMMANDS

** Type d$ to delete to the end of the line. **

1. Press to make sure you are in Normal mode.

2. Move the cursor to the line below marked --->.

3. Move the cursor to the end of the correct line (AFTER the first . ).

4. Type d$ to delete to the end of the line.

---> Somebody typed the end of this line twice. end of this line twice.

5. Move on to Lesson 2.3 to understand what is happening.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Lesson 2.3: ON OPERATORS AND MOTIONS

Many commands that change text are made from an operator and a motion.

The format for a delete command with the d delete operator is as follows:

d motion

Where:

d - is the delete operator.

motion - is what the operator will operate on (listed below).

A short list of motions:

w - until the start of the next word, EXCLUDING its first character.

e - to the end of the current word, INCLUDING the last character.

$ - to the end of the line, INCLUDING the last character.

Thus typing de will delete from the cursor to the end of the word.

NOTE: Pressing just the motion while in Normal mode without an operator will move the cursor as specified.

使用 d$ (在一行前)使用,可以删除整行

使用 de (在字符前)使用,可以删除整个单词

使用 dw (在字符前)使用,可以删除一个单词

Lesson 2.4: USING A COUNT FOR A MOTION

** Typing a number before a motion repeats it that many times. **

1. Move the cursor to the start of the line marked ---> below.

2. Type 2w to move the cursor two words forward.

3. Type 3e to move the cursor to the end of the third word forward.

4. Type 0 (zero) to move to the start of the line.

5. Repeat steps 2 and 3 with different numbers.

---> This is just a line with words you can move around in.

6. Move on to Lesson 2.5.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Lesson 2.5: USING A COUNT TO DELETE MORE

** Typing a number with an operator repeats it that many times. **

In the combination of the delete operator and a motion mentioned above you

insert a count before the motion to delete more:

d number motion

1. Move the cursor to the first UPPER CASE word in the line marked --->.

2. Type d2w to delete the two UPPER CASE words

3. Repeat steps 1 and 2 with a different count to delete the consecutive

UPPER CASE words with one command

---> this ABC DE line FGHI JK LMN OP of words is Q RS TUV cleaned up.

2w ;3e ;0为移动的使用

d2w; d3e; d0 为删除的使用

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Lesson 2.6: OPERATING ON LINES

** Type dd to delete a whole line. **

Due to the frequency of whole line deletion, the designers of Vi decided

it would be easier to simply type two d's to delete a line.

1. Move the cursor to the second line in the phrase below.

2. Type dd to delete the line.

3. Now move to the fourth line.

4. Type 2dd to delete two lines.

---> 1) Roses are red,

---> 2) Mud is fun,

---> 3) Violets are blue,

---> 4) I have a car,

---> 5) Clocks tell time,

---> 6) Sugar is sweet

---> 7) And so are you.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Lesson 2.7: THE UNDO COMMAND

** Press u to undo the last commands, U to fix a whole line. **

1. Move the cursor to the line below marked ---> and place it on the

first error.

2. Type x to delete the first unwanted character.

3. Now type u to undo the last command executed.

4. This time fix all the errors on the line using the x command.

5. Now type a capital U to return the line to its original state.

6. Now type u a few times to undo the U and preceding commands.

7. Now type CTRL-R (keeping CTRL key pressed while hitting R) a few times

to redo the commands (undo the undo's).

---> Fiix the errors oon thhis line and reeplace them witth undo.

8. These are very useful commands. Now move on to the Lesson 2 Summary.

高效删除行:dd

使用数字+dd实现多行删除

使用u进行修复,即撤销是之前的操作。

Lesson 2 SUMMARY

1. To delete from the cursor up to the next word type: dw

2. To delete from the cursor to the end of a line type: d$

3. To delete a whole line type: dd

4. To repeat a motion prepend it with a number: 2w

5. The format for a change command is:

operator [number] motion

where:

operator - is what to do, such as d for delete

[number] - is an optional count to repeat the motion

motion - moves over the text to operate on, such as w (word),

$ (to the end of line), etc.

6. To move to the start of the line use a zero: 0

7. To undo previous actions, type: u (lowercase u)

To undo all the changes on a line, type: U (capital U)

To undo the undo's, type: CTRL-R

Lesson 3 SUMMARY

1. To put back text that has just been deleted, type p . This puts the

deleted text AFTER the cursor (if a line was deleted it will go on the

line below the cursor).

2. To replace the character under the cursor, type r and then the

character you want to have there.

3. The change operator allows you to change from the cursor to where the

motion takes you. eg. Type ce to change from the cursor to the end of

the word, c$ to change to the end of a line.

4. The format for change is:

c [number] motion

linux内核如何安装vim,linux软件安装以及vim相关推荐

  1. linux上常用命令及通用软件安装

    linux上常用命令及通用软件安装记录. 1, 查询检索 1.1 根据安装包的名字检索安装 rpm 命令: rmp 全称:redhat package manager 参数说明: -a 查询所有套件 ...

  2. linux内核配置与编译,LINUX内核的配置与编译、安装

    LINUX内核的配置与编译.安装 平台为VM RHEL 5.1 SERVER,所用的内核为linux-2.6.25. 可以到上下载相应的内核版本. 解压压缩包,并进入内核目录.下面是具体的步骤: 1. ...

  3. Linux内核开发_1_编译LInux内核

    目录 1. 准备工作 1.1 学习环境 1.2 下载Linux内核源码 1.3 解压Linux内核 1.4 目录结构介绍 2. Linux内核配置 2.1 配置选项 1. make config 2. ...

  4. linux内核学习之三:linux中的32位与64位

    linux内核学习之三:linux中的"32位"与"64位" 在通用PC领域,不论是windows还是linux界,我们都会经常听到"32位" ...

  5. 一文了解linux内核,一文了解Linux的系统结构

    什么是 Linux ? 如果你以前从未接触过Linux,可能就不清楚为什么会有这么多不同的Linux发行版.在查看Linux软件包时,你肯定被发行版.LiveCD和GNU之类的术语搞晕过.初次进入Li ...

  6. 搭建《深入Linux内核架构》的Linux环境

    搭建<深入Linux内核架构>的Linux环境 阅读目录(Content) 作者 软件 概述 正文 一.安装GCC 二.编译Linux内核 三.制作跟文件系统 四.运行qemu 五.启动l ...

  7. Linux内核入门-如何获取Linux内核源代码、生成配置内核

    如何获取Linux内核源代码 如何获取Linux内核源代码 下载Linux内核当然要去官方网站了,网站提供了两种文件下载,一种是完整的Linux内核,另一种是内核增量补丁,它们都是tar归档压缩包.除 ...

  8. 在win10查看本机linux的文件,Windows 10变身开发者利器:内置Linux内核,轻松查看Linux子系统文件...

    原标题:Windows 10变身开发者利器:内置Linux内核,轻松查看Linux子系统文件 来源:创事记 终于!在Windows里可以访问Linux文件了. 这表明,微软插入开源界的触角,越来越深入 ...

  9. linux内核 lts长期演进,Linux Kernel 4.19 将成为下一个LTS(长期支持)系列

    最近Linux内核开发人员和维护人员Greg Kroah-Hartman透露,Linux Kernel 4.19将下一个长期支持的Linux内核系列. 现在Linux Kernel 4.17已经达到使 ...

  10. 查看linux内核的编译时间,linux内核编译步骤

    linux内核编译步骤 对于linux新手来说,编译内核相对有一些难度,甚至不知道如何入手,我通过在网上收集这方面的资料,最终编译成功.现在我归纳了一下,写出这一篇还算比较详细的步骤,希望能对各位新手 ...

最新文章

  1. 如何撰写好一篇论文?密歇根Andrew教授这篇《撰写高影响力论文指南》为你细致讲解论文写作,附视频与pdf...
  2. XP快速启动栏里的显示桌面没有了,其他的都还在,应该怎么再添加进去?
  3. 工业用微型计算机(22)-指令系统(18)
  4. 服务器向用户返回的状态码,常用的有:
  5. exposed beyond app through Intent.getData(),或FileUriExposedException
  6. 1003 我要通过
  7. Maven入门基础-环境篇
  8. Oracle 数据字典表的使用
  9. 华为手机改定位怎么改变_华为推送HMS服务,依靠鸿蒙OS,或将改变手机行业格局...
  10. sed系列:行或者模式匹配删除特定行
  11. 魔方全能小王子降临:一个完全不依赖人类知识的AI
  12. javascript(jQuery版)切换tab效果自动切换(转自www.jqueryba.com)
  13. 拼音模糊搜索 php,基于 XunSearch(迅搜)SDK 的全文搜索 Laravel 5.* 软件包,支持全拼、拼音简写、模糊搜索、热门搜索、搜索提示...
  14. 初学计算机,我在疑惑些什么?
  15. 1.2.1css简介
  16. VBA多条EXCEL记录写入到WORD文档中
  17. 线程池 ExecutorService 的使用例子
  18. NATPort ForwardingPort Triggering
  19. node.js 后台代码怎么部署到服务器上?
  20. 【5】SCI易中期刊推荐——计算机科学(中科院2区)

热门文章

  1. Android直播实现(Android端推流、播放)
  2. 腾讯云数据库TDSQL:分布式数据库,你真的了解吗?
  3. 补充远程桌面数字证书读取问题
  4. 国内大学ip地址范围
  5. 装修如何省钱,极家好不好?
  6. Unity3D开发网络游戏《丛林战争》流程日记
  7. python3爬虫踩坑记纪录篇(二)
  8. 如何检测是否安装了.NET 2.0和.NET 3.0 [ZT]
  9. 黑马程序员课程Vue实战项目_Element-ui——电商后台管理系统-商品管理(商品分类)
  10. 快乐英语新概念英语 绿色