Linux学习笔记 1 环境变量 2 vi命令
1 环境变量篇
1.1 修改 查看 生效 系统环境变量
1 涉及系统环境变量的文件 --> .bash_profile
--> /etc/profile
2 该文件位置 /root/.bash_profile
3 文件编辑器打开 vi .bash_profile
4 文件末尾加入
JAVA_HOME = /usr/share/jdk 1.6.0
PATH = $JAVA_HOME/bin:$PATH
CLASS_PATH=.$JAVA_HOME/lib/dt.jar:
$JAVA_HOME/lib/tools.jar export JAVA_HOME
export PATH
export CLASSPATH 5 文件生效
source /root/.bash_profile
6 验证环境变量
export JAVA_HOME
echo $JAVA_HOME
VI 命令篇章
输入指令 a
退出指令 :q 强退:q! 保存且退出 :wq
存成新文件 :w newfile 查找指令 : ?____ <要查找的单词>
/ ____ 要查的词
n finding the dedicate word then moving to the next
N oppersite direction
:set nu <---show the line number
:set nonu <---remove line number direction :
k
h j l input: i insert in front of the cursor
a insert behind the cursor
o insert in the next line of the cursor delete:
x:delete the char of the cursor
X :delete the char of the cursor dd:delete the current row
5dd:delete the currrent line and the next 5 line
:1,5d delete1 to 5 line
x delete one charactor vi substitute
:s /cici/titi replace the line cici with titi
:s/cici/titi/g replace all the cici with titi in the current line
:n,$s/cici/titi the line n to the last line.each line cici replace with titi
:n,$s /cici/titi/g the line n to the last line.each line cici replace with titi
:.,$s/cici/titi replace all the words in the passages from the first line
to the last line repalce confirmation command.adding character c behind the comma :s/cici/titi/gc all the cici replace with titi + confirmation
show line number :set nu dw delete current words
3dw delete 3 words copy and attach yw copy word
y5w copy all 5 words
yy copy all the line
5yy copy 5 lines
p copy after the current line
:1,2co3 copy from line1 to line2 after line 3
:4,5m6
1 1
2 2
3 3
4 6
5 4
6 5 location command
gg moving to the front of the file
G moving to the end of file
:20 moving to line 20
J merge 2 line
shift + 8 :
finding the word which is in the position of cursor
Linux学习笔记 1 环境变量 2 vi命令的更多相关文章
- linux —— 学习笔记(环境变量的设置)
目录 环境变量概要 与环境变量相关的文件 设置环境变量 注意以及相关 1.环境变量概要 环境变量,简单来说,是储存了环境信息的变量.它可以让你在不指明全部路径的情况下执行某脚本或某应用程序,比如在 l ...
- Linux学习,path,环境变量的配置
方法一: 1.查看当前环境变量配置的所与信息 echo $PATH 注意: echo是输出的意思 加$表示它是一个变量 2.配置环境命令 PATH="$PATH":comdir 注 ...
- Linux学习笔记——切换并取代用户身份命令——su
再次从头好好的学习Linux,本着以免轻易忘记,以备后用的原则,将我觉得常用或者好玩的linux命令记录在这,注意:我的实验环境是 Ubuntu 14.04.1 su 这个命令我经常使用,因为 ...
- Linux学习笔记之ubuntu如何在vi中写入中文注释
点击左边设置system settings,再点击Language Suppotr 点击Remind Me Later 选择ibus 然后关闭,在终端写入ibus-setup,弹出设置框,选择INPU ...
- Linux学习笔记(一):常用命令
经过统计Linux中能够识别的命令超过3000种,当然常用的命令就远远没有这么多了,按照我的习惯,我把已经学过的Linux常用命令做了以下几个方面的分割: 1.文件处理命令 2.文件搜索命令 3.帮助 ...
- linux学习笔记:1.基础知识和命令行基本操作
初次学习linux系统,想在这里记录自己的学习痕迹,如发现有不足之处,希望能指出,谢谢啦,之后的学习是在虚拟机VMware 10下的Red Hat Enterprise linux 6 的操作. 一. ...
- Linux学习笔记(一):常用命令(1)
经过统计Linux中能够识别的命令超过3000种,当然常用的命令就远远没有这么多了,按照我的习惯,我把已经学过的Linux常用命令做了以下几个方面的分割: 1.文件处理命令 2.文件搜索命令 3.帮助 ...
- Linux学习笔记 (六)用户管理命令
一.用户帐号 1.超级用户:具有操作系统中的最高权限,用来管理和维护操作系统.root用户. 2.普通用户:由root用户来创建,在宿主目录中具有完全权限. 3.程序用户:由应用程序添加,维护某个应用 ...
- Linux学习笔记(八)权限管理命令
权限管理命令 权限位含义 chmod chown chgrp umask默认权限 权限位含义 第1位代表文件类型 "-":普通文件 "b":块设备文件 &quo ...
随机推荐
- mac 端口占用问题
查看端口号 终端输入:sudo lsof -i tcp:port 将port换成被占用的端口(如:8086.9998) 将会出现占用端口的进程信息. 杀死占用端口的PID进程 找到进程的PID,使用k ...
- day03 变量 运算符 基本数据类型 输出功能 格式化输出
变量补充 变量的命名 1变量名的命名的大前提:应该能够反映出变量值所记录的状态 具体的1.变量名由字母数字下划线组成 2.不能以数字开头 3.不能使用关键字命名为变量名 两种写法 1.驼峰体(由字母组 ...
- 20165314 2016-2017-2 《Java程序设计》第3周学习总结
20165314 2016-2017-2 <Java程序设计>第3周学习总结 教材学习内容总结 类体包含成员变量和域变量 局部变量只在方法内有效 对象的创建以及对象对自己变量和方法通过用. ...
- linux下安装pip与pip安装
在执行脚本的时候,说有库找不到 pip安装的时候说不认识pip 安装pip 使用脚本安装和升级pip wget https://bootstrap.pypa.io/get-pip.py 运行脚本pyt ...
- getComputedStyle()用法详解
那如果元素即没有在style属性中设置宽高,也没有在样式表中设置宽高,还能用getComputedStyle或currentStyle获取吗?答案是getComputedStyle可以,current ...
- loadrunner获取当前日期、明日日期、昨日日期
DATE_NOW(现在的日期) TIME_NOW(现在的时间) ONE_DAY(一天的时间) ONE_HOUR(一小时的时间) ONE_MIN(一分钟的时间) 可以使用公式获取昨天明天,例如: DAT ...
- go包之logrus显示日志文件与行号
前言: logrus是go中比较好的一个log模块.github上的很多开源项目都在使用这个模块, 我在写这个博文时, github上的logrus的stars数已经有8214了.最近在用这个模块时, ...
- Gson将字符串转map时,int默认为double类型
gson能够将json字符串转换成map, 但是在转成map时, 会默认将字符串中的int , long型的数字, 转换成double类型 , 数字会多一个小数点 , 如 1 会转成 1.0 Gs ...
- delete web server(nginx)
#!/bin/bash conf_dir1="/usr/local/nginx/conf/vhost.d" #conf_dir2="/usr/local/apache2/ ...
- java.io几种读写文件的方式
一.Java把这些不同来源和目标的数据都统一抽象为数据流. Java语言的输入输出功能是十分强大而灵活的. 在Java类库中,IO部分的内容是很庞大的,因为它涉及的领域很广泛:标准输入输出,文件的操作 ...