Linux运维工程师常用到的Linux基础命令

今天小编要跟大家分享的文章是关于Linux运维工程师常用到的Linux基础命令(一)。本篇文章是小编为大家整理的一些常用的Linux基础命令,Linux入门新手和正在Linux学习的小伙伴快来看一看吧,希望能够对大家有所帮助!

Linux运维工程师常用到的Linux基础命令(一)

1、[root@ping ~]# tree -L 1 /

#使用tree 命令查看根目录下的一层的目录结构

2、ls – list directory contents

[root@ping ~]# ls -l /

以长格式显示文件和目录的信息

3、[root@ping ~]# ls -d /

显示目录和文件

4、[root@ping ~]# ls -d /*

根目录下的所有的目录和文件

5、cd – Change the shell working directory

[root@ping ~]# cd –

上次一次所在的目录

6、[root@ping /]# cd .

当前目录

7、[root@ping ~]# cd ..

这个目录的上一次目录

8、[root@ping /]# cd ~

当前用户的家目录

9、pwd – Print the name of the current working directory.

[root@ping ~]# pwd

查看当前所处的目录

10、cp – copy files and directories

[root@ping ~]# cp

拷贝文件或目录

11、alias – Define or display aliases

[root@ping ~]# alias rm =”mv”

定义别名alies 为mv 命令

12、unalias – Remove each NAME from the list of defined aliases

[root@ping ~]# alias

alias -rf=’you want remvoe files or directories to mv’

alias cp=’cp -i’

alias l.=’ls -d .* –color=auto’

alias ll=’ls -l –color=auto’

alias ls=’ls –color=auto’

alias mv=’mv -i’

[root@ping ~]# unalias mv

取消mv这个别名

13、cat – concatenate files and print on the standard output

[root@ping ~]# cat -n /root/.bashrc

查看文件内容并列出行号

14、find – search for files in a directory hierarchy

option:!取反、-a(and)并且、-o(or)

[root@ping ~]# find / -type f -name “useradd”

查找根目录下文件类型为文本文件并且包含名字是”useradd” 的文件路径

15、head – output the first part of files

[root@ping ~]# head /etc/services

默认查看文件前十行内容

16、tail – output the last part of files

[root@ping ~]# tail /etc/passwd

默认查看文件后十行内容

17、[root@ping ~]# tail -f /var/log/messages

查看文件动态更新的内容

18、rpm – RPM Package Manager

[root@ping ~]# rpm -ivh /mnt/Packages/elinks.el6_3.x86_64.rpm

安装显示输出rpm软件包情况

19、[root@ping ~]# rpm -qa | grep mysql

查看当前系统安装关于”mysql”的rpm包名

20、yum – Yellowdog Updater Modified

[root@ping ~]# yum -y install ftp

用yum安装ftp管理工具

以上就是小编今天为大家分享的关于Linux运维工程师常用到的Linux基础命令的文章,希望本篇文章能够对正在从事Linux相关工作的小伙伴们有所帮助。想要了解更多Linux相关知识记得关注马哥教育官网。

声明:文章来源于网络,侵删!

相关新闻

历经多年发展,已成为国内好评如潮的Linux云计算运维、SRE、Devops、网络安全、云原生、Go、Python开发专业人才培训机构!