linux Learning (II) ----- Linux directory structure, remote login, vi and vim

linux directory structure

basic introduction

linux file system directory structure is a tree-type layer level, the uppermost layer in this structure is the root "/", and then creating another directory in the directory.

The directory structure specific description

Linux directory summary

1, there is a directory linux and a long root /

2, the contents of each directory stored linux is planned, without misplacing files.

3, in the form of linux based file management of our equipment, so linux systems, everything is a file.

4, what is stored under various linux file directory, you must have an understanding. 

Telnet Linux systems

Why do you need a remote login Linux

Description:

When developed, the specific situation is this:

1, linux server development team is shared.

2, formally launched the program is running in the public network.

3, so programmers need to log in to the remote centos project management or development.

4, a schematic draw a simple network topology (help understanding)

5, Telnet client has Xshell5, Xftp5, we learn to use Xshell5 and Xftp, similar to other remote tools

Remote Login Linux-Xshell5 

Description:

Xshell is the best remote login to the Linux operating software, smooth speed and perfect solution to the problem of Chinese garbled, is the first choice of software programmers. ----- SSH Chinese garbage problem serious 

Xshell [1] is a powerful secure terminal emulation software that supports SSH1, SSH2, and TELNET protocol Microsoft Windows platform. It xshell be used to access a remote server under different systems in the Windows interface to achieve better control of the remote terminal.

Special Note : If you want to install the XShell 5 can remotely access a Linux system, it needs to have a premise that Linux SSHD enabled service that listens on port 22.

setup ---> System Services -> sshd

 

 

安装 XShell5 并使用 

安装就一步步傻瓜安装即可。。。

远程上传下载文件 Xftp5

XFtp5 软件介绍

是一个基于 windows 平台的功能强大的 SFTP、FTP 文件传输软件。使用了 Xftp  以后,windows  用户能安全地在 UNIX/Linux 和 Windows PC 之间传输文件。 

Xftp5 的配置和使用 

如何解决 XFTP5 中文乱码的问题

说明:如上图配置后,还需要刷新一下,就可以解决中文乱码

vi以及vim 

vi 和 vim 的基本介绍 

所有的 Linux 系统都会内建 vi 文本编辑器。 Vim 具有程序编辑的能力,可以看做是 Vi 的增强版本,可以主动的以字体颜色辨别语法的正确 性,方便程序设计。代码补完、编译及错误跳转等方便编程的功能特别丰富,在程序员中被广泛使用。

vi 和 vim 的三种常见模式 

1、正常模式 

在正常模式下,我们可以使用快捷键。 以 vim 打开一个档案就直接进入一般模式了(这是默认的模式)。在这个模式中, 你可以使用『上 下左右』按键来移动光标,你可以使用『删除字符』或『删除整行』来处理档案内容, 也可以使用 『复制、贴上』来处理你的文件数据。

2、插入模式/编辑模式

在模式下,程序员可以输入内容。 按下 i, I, o, O, a, A, r, R 等任何一个字母之后才会进入编辑模式, 一般来说按 i 即可。

3、命令行模式 

在这个模式当中, 可以提供你相关指令,完成读取、存盘、替换、离开 vim 、显示行号等的动 作则是在此模式中达成的! 

示例 

vi 和 vim三种模式的相互转化图

快捷键的使用案例

1、拷贝当前行yy,拷贝当前行向下的5行5yy,并粘贴(p)。
2、删除当前行dd,删除当前行向下的5行5dd
3、在文件中查找某个单词[命令行下/关键字,回车查找,输入n就是查找下一个],查询hello.
4、设置文件的行号,取消文件的行号.[命令行下:set nu和:set nonu]
5、编辑/etc/profile文件,使用快捷键到底文档的最末行[G]和最首行[gg],注意这些都是在正常模式下执行的。
6、在一个文件中输入"hello",然后又撤销这个动作,再正常模式下输入 u
7、编辑/etc/profile文件,并将光标移动到第20行
   第一步:显示行号:set nu
      第二步:输入 20 这个数  
      第三步: 输入 shift+g

开机、重启和用户登录注销 

关机&重启命令 

基本介绍 

1、shutdown

shutdown -h now : 表示立即关机

shutdown -h 1 : 表示 1 分钟后关机

shutdown -r now: 立即重启

2、halt

就是直接使用,效果等价于关机

3、reboot

就是重启系统。

4、sync

把内存的数据同步到磁盘

注意细节 

当我们关机或者重启时,都应该先执行以下 sync 指令,把内存的数据写入磁盘,防止数据丢失。 

用户登录和注销 

基本介绍 

1、登录时尽量少用 root 帐号登录,因为它是系统管理员,最大的权限,避免操作失误。可以利 用普通用户登录,登录后再用”su - 用户名’命令来切换成系统管理员身份 

2、在提示符下输入 logout 即可注销用户 

 

Guess you like

Origin www.cnblogs.com/alimayun/p/11295836.html