加入收藏 | 设为首页 | 会员中心 | 我要投稿 PHP编程网 - 黄冈站长网 (http://www.0713zz.com/)- 数据应用、建站、人体识别、智能机器人、语音技术!
当前位置: 首页 > 服务器 > 搭建环境 > Linux > 正文

常用Linux基础命令概括

发布时间:2022-07-15 16:02:25 所属栏目:Linux 来源:互联网
导读:[root@ping ~]# tree -L 1 / #使用tree 命令查看根目录下的一层的目录结构 ls - list directory contents [root@ping ~]# ls -l / 以长格式显示文件和目录的信息 [root@ping ~]# ls -d /* 根目录下的所有的目录和文件 cd - Change the shell working directo
  [root@ping ~]# tree -L 1 /
 
  #使用tree 命令查看根目录下的一层的目录结构
 
  ls - list directory contents
 
  [root@ping ~]# ls -l /
 
  以长格式显示文件和目录的信息
 
  [root@ping ~]# ls -d /*
 
  根目录下的所有的目录和文件
 
  cd - Change the shell working directory
 
  [root@ping ~]# cd -
 
  上次一次所在的目录
 
  [root@ping /]# cd .
 
  当前目录
 
  [root@ping ~]# cd ..
 
  这个目录的上一次目录
 
  [root@ping /]# cd ~
 
  当前用户的家目录
 
  pwd -   Print the name of the current working directory.
 
  [root@ping ~]# pwd
 
  查看当前所处的目录
 
  cp - copy files and directories
 
  [root@ping ~]# cp
 
  拷贝文件或目录
 
  alias - Define or display aliases
 
  [root@ping ~]# alias rm ="mv"
 
  定义别名alies 为mv 命令
 
  unalias - Remove each NAME from the list of defined aliases
 
  [root@ping ~]# alias
 
  alias -rf='you want remvoe files or directories to mv'
 
  取消mv这个别名
 
  cat - concatenate files and print on the standard output
 
  [root@ping ~]# cat -n /root/.bashrc
 
  查看文件内容并列出行号
 
  find - search for files in a directory hierarchy
 
  option:!取反、-a(and)并且、-o(or)
 
  [root@ping ~]# find / -type f -name "useradd"
 
  查找根目录下文件类型为文本文件并且包含名字是"useradd" 的文件路径
 
  head - output the first part of files
 
  [root@ping ~]# head /etc/services
 
  默认查看文件前十行内容
 
  tail - output the last part of files
 
  [root@ping ~]# tail /etc/passwd
 
  默认查看文件后十行内容
 
  [root@ping ~]# rpm -qa | grep mysql
 
  查看当前系统安装关于"mysql"的rpm包名
 
  yum - Yellowdog Updater Modified
 
  [root@ping ~]# yum -y install ftp
 
  用yum安装ftp管理工具
 
  [root@ping ~]# yum grouplist
 
  查看当前系统已经安装和可以安装的包组
 
  [root@ping ~]# yum -y groupinstall PostgreSQL 数据库服务器
 
  向当前系统中安装一组软件包
 
  [root@ping ~]# yum info

(编辑:PHP编程网 - 黄冈站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    热点阅读