1. linux 基础命令

who, which, basename, dirname, echo, type, hash, whatis, makewhatis, man, info, help, ls, cd,pwd, mkdir, rmdir, touch, rm, date, hwcolck, cal, shutdown, reboot, tty

1 who : Show who is logged on, print information about users who are currently logged in.

  显示登录的用户。

2 which : Show the full path of (shell) commands

  which pwd, which shutdown

3 basename : Print name with any leading directory components removed.

  basename /usr/bin/sort , Output: sort

4 dirname : strip non-directory suffix from file name

  dirname /usr/bin/sort , Output: /usr/bin

5 命令替换

  ‘ ’ :强引用,变量不会替换;

  “ ” :若引用,变量可以替换;

  ` ` :命令应用,类似$()

6 echo : display a line of text , 回显

  echo $PATH , Output: /usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

  echo '$PATH' , Output: $PATH

  echo "zhu biao" , Output: zhu biao

  echo `date +%F`(echo $(date +%F)) , Output: 2016-10-26

7 type : Display information about command type

  type cd , Output: cd is a shell builtin

  type shutdown , Output: shutdown is /sbin/shutdown, 若shutdown已经执行过,将会添加到hash数据库,则:shutdown is hashed (/sbin/shutdown)

8 hash : Rember or display program loacations, 显示hash数据库,执行过的程序次数、位置。

9 whatis : 简洁描述某个命令的功能,该命令在manual文档中的章节

  whatis shutdown , Output:

            shutdown    (2)  - shut down part of a full-duplex connection
            shutdown    (3p)  - shut down socket send and receive operations
            shutdown    (8)  - bring the system down

10 makewhatis : Create the whatis datebase

11 shell command 分为内部命令和外部命令

  内部命令帮助:help command

  外部命令帮助:command --help, man command, info command

12 man : man [section] command , manual , 命令,配置文件格式,库调用等帮助文档

  [section]:

  1: User Commands
     2: System Calls
     3: C Library Functions
     4: Devices and Special Files
     5: File Formats and Conventions
     6: Games et. Al.
     7: Miscellanea
     8: System Administrations tools and Deamons

13 info : 获取在线帮助文档,使用方法类似man

14 help : shell内部命令帮助文档

  help ls

15 {a,b} : 可展开

  {a,b}/{x,y} : a/x a/y b/x b/y

  {a,b}-heburn-{x,y} : a-heburn-x a-heburn-y b-heburn-x b-heburn-y

16 ls : list directory contents

  ls /home/zhubiao

17 cd : change the shell working directory

  cd /home/zhubiao

  cd ~ : 回到用户家目录

  cd ~zhubiao : 回到用户zhubiao家目录

  cd - : 回到上一个目录

18 pwd : Print working directory

19 mkdir : make directories

  Create directories /mnt/linux/bin, /mnt/linux/sbin, /mnt/bin, /mnt/sbin 可用如下命令:

  mkdir -pv /mnt{/linux/{bin/sbin},bin,sbin}

20 rmdir : remove empty diretories

  rmdir /mnt

  rmdir -p /a/b

21 rm : remove files or directories

  rm -rf /a/b/zhubiao

22 touch : 创建文件

23 date : print or set the system date and time

  date [MMDDhhmm[[CC]YY][.ss] :

    date 10262318 设定系统时间为10月26日 23:18,

    date 102623182016.33 设定系统时间为 2016-10-26 23:18:33

    date +%F , Output: 2016-10-26

    date +%T , Output: 23:18:33

    -s : --set "CCYY-MM-DD hh:mm:ss"

24 hwclock : query or set the hadway clock (RTC)

  hwclock --set --date="2016-10-10 23:12:10"

  hwclock -s(--hctosys)

  hwclock -w(--systohc)

25 cal : Display a calendar

  cal , Output:

      October 2016   
      Su Mo Tu We Th Fr Sa
                         1
       2  3  4  5  6  7  8
       9 10 11 12 13 14 15
      16 17 18 19 20 21 22
      23 24 25 26 27 28 29
      30 31

26 shutdown : bring the system down

  shutdown -h now

  shutdown -r +5

27 reboot : reboot, halt, poweroff - reboot or stop the system

28 ternial

  a.虚拟终端 tty#

  b.物理终端 console

  c.伪终端 pts/#

  

一. Linux 常用命令总结的更多相关文章

  1. Linux常用命令(一)

    Linux常用命令 1. pwd查看当前路径(Print Working Directory)    [root@CentOS ~]# pwd/root 2. cd .. 返回上一级 .. 表示上一级 ...

  2. linux常用命令的介绍

    本文主要介绍Linux常用命令工具,比如用户创建,删除,文件管理,常见的网络命令等 如何创建账号: 1. 创建用户 useradd -m username -m 表示会在/home 路径下添加创建用户 ...

  3. linux——常用命令与脚本

    linux常用命令 --文件管理pwd --查看当前目录cd --切换当前目录ls --列出当前目录下的所有文件touch --创建文件mkdir --建立目录rmdir --删除空目录rm --删除 ...

  4. DOS 和 Linux 常用命令的对比

    DOS 和 Linux 常用命令的对比 许多在 shell 提示下键入的 Linux命令都与你在 DOS 下键入的命令相似.事实上,某些命令完全相同. 本附录提供了 Windows的 DOS 提示下的 ...

  5. 第一章,Linux常用命令

    20161124 Linux常用命令1.find find /etc/ -size +50k -lsfind /etc/ -size +50k -ls 2> /dev/null查看目录下大于50 ...

  6. linux 常用命令大全

    linux 常用命令大全 系统信息 arch 显示机器的处理器架构(1) uname -m 显示机器的处理器架构(2) uname -r 显示正在使用的内核版本 dmidecode -q 显示硬件系统 ...

  7. Linux 常用命令行

    Linux常用命令行 第一部分: cd命令 第二部分:文件操作 第三部分:压缩包操作

  8. [工作需求]linux常用命令以及vim常用命令

    一.             Linux 常用命令 mkdir dirname新建文件夹 cd ~ 进入自己的家目录 cd dirname 进入名字为dirname的目录: l 显示当前文件夹下的文件 ...

  9. 对于我的linux常用命令的说明

    我所列出的linux常用命令中的选项并不是全部的选项,是一些我们经常用到的linux命令及选项

  10. Linux 常用命令笔记

    Linux 常用命令笔记 1. locate locate:用来定位文件的位置,如:locate a.txt 但是这个命令有延迟,也就是新建的文件不一定能搜索到,如果非要找到新建的文件可以使用 upd ...

随机推荐

  1. C#设计模式——外观模式(Facade Pattern)

    一.概述 在系统设计中,某一个系统可能非常庞大,用户要使用该系统就不得不掌握大量的接口,造成使用的不便.这时可以考虑将该系统细分成一系列子系统并使子系统间的耦合降到最低,利用外观模式提供一个外观对象, ...

  2. HDFS Append时packet的格式以及DataNode对block/checksum文件的处理

    HDFS Append时packet的格式以及DataNode对block/checksum文件的处理 HDFS的Block一般比较大,默认64MB/128MB,客户端给DataNode发数据实际上是 ...

  3. 1 初识Orchard

    网上关于Orchard的介绍已经很多了,具体Orchard是干啥的我就不再啰嗦,这个系列的主要目的就是介绍学习和使用orchard的过程,和在此过程中碰到问题的解决方案.下面直接进入正题. 获取orc ...

  4. 在phpwind内容页使用百度分享进行图片分享

    在phpwind内容页使用百度分享进行图片分享时,百度分享默认提取到的图片不一定是主题正文内容中的图片,需要使用百度提供的配置机制自行调整. 整个代码添加的位置在此不论,主要原理是在主题正文区域提取图 ...

  5. 一个SpringMVC简单Demo中出现的错误

    最近在学springmvc 一个简答的Springmvc配置包括如下步骤: 1.在 web.xml 文件中配置 DispatcherServlet (该中央控制器相当于 MVC 模式中的 C),还可以 ...

  6. 如何使用mybatis《一》

    mybatis作为ORM轻量级框架一出现就吸引了无数人的眼球,比hibernate要简单且入门较容易,下面开始我的第一个mybatis程序. 一.下载mybatis的包 我们知道任何一个框架都会有其包 ...

  7. CentOS 编译安装 MySQL5.7

    下载 所有版本下载地址: http://dev.mysql.com/downloads/mysql/ 此处用 5.7.10 wget http://dev.mysql.com/get/Download ...

  8. spring mvc 框架搭建及详解

    现 在主流的Web MVC框架除了Struts这个主力 外,其次就是Spring MVC了,因此这也是作为一名程序员需要掌握的主流框架,框架选择多了,应对多变的需求和业务时,可实行的方案自然就多了.不 ...

  9. 【JWPlayer】官方JWPlayer去水印步骤

    在前端播放视频,现在用html5的video标签已经是一个不错的选择,不过有时候还是需要用StrobeMediaPlayback.JWPlayer这一类的flash播放器,JWPlayer的免费版本带 ...

  10. 关于IE处理margin和padding值超出父元素高度的问题

    两个div,父div有padding值,子div有margin-top值,浏览器在解析实际父子位置关系时,他们之间的距离是父padding+子margin-top.现在把父div设置固定高度,并有意让 ...