设为首页 收藏本站
查看: 955|回复: 0

[经验分享] Linux练习命令一

[复制链接]

尚未签到

发表于 2018-5-22 08:52:26 | 显示全部楼层 |阅读模式
  1.clock 和hwclock的用法
  [root@localhost ~]# clock --help   
hwclock - query and set the hardware clock (RTC)
  Usage: hwclock [function] [options...]
  Functions:   
  -h | --help         show this help     
  -r | --show         read hardware clock and print result     
       --set          set the rtc to the time given with --date     
  -s | --hctosys      set the system time from the hardware clock     
  -w | --systohc      set the hardware clock to the current system time     
       --systz        set the system time based on the current timezone     
       --adjust       adjust the rtc to account for systematic drift since     
                      the clock was last set or adjusted     
  -c | --compare      periodically compare the system clock with the CMOS clock     
       --getepoch     print out the kernel's hardware clock epoch value     
       --setepoch     set the kernel's hardware clock epoch value to the     
                      value given with --epoch     
  -v | --version      print out the version of hwclock to stdout
  Options:   
  -u | --utc          the hardware clock is kept in UTC     
       --localtime    the hardware clock is kept in local time     
  -f | --rtc=path     special /dev/... file to use instead of default     
       --directisa    access the ISA bus directly instead of /dev/rtc     
       --badyear      ignore rtc's year because the bios is broken     
       --date         specifies the time to which to set the hardware clock     
       --epoch=year   specifies the year which is the beginning of the     
                      hardware clock's epoch value     
       --noadjfile    do not access /etc/adjtime. Requires the use of     
                      either --utc or --localtime     
       --adjfile=path specifies the path to the adjust file (default is     
                      /etc/adjtime)     
       --test         do everything except actually updating the hardware     
                      clock or anything else     
  -D | --debug        debug mode
  hwclock –s 同步硬件时间到系统时间
  hwclock –w 同步系统时间到硬件时间
  hwclock –r 显示当前硬件时间状态
DSC0000.jpg      
2.cd 进入指定目录

  cd / 直接跳转到根目录
  cd  etc 或cd /etc进入 根目录下的etc目录 前一个是相对路径,后一个是绝对路径
  cd .. 返回上一级目录
  3cal 调出日历
  CAL(1)
  NAME   
       cal - display a calendar
  SYNOPSIS   
       cal [options] [[[day] month] year]
  cal 显示当前日历
  cal year 显示所属年份日历
  cal  -s 本月日历按Sunday列出
  cal –m 本月日历按Monday列出
  4. pwd 显示当前工作目录 命令行下直接pwd
  5. ls
  NAME   
       ls - list directory contents
  SYNOPSIS   
       ls [OPTION]... [FILE]...
  ls:list   
        列出指定路径下的文件或目录的属性信息
  Metadata:属性数据   
            data:数据
  ls [OPTION]... [FILE]...   
            -l: 使用长格式显示     
                drwxr-xr-x 1 root root    8 Aug 23 08:47 .cache     
                    d: 文件类型     
                    rwxr-xr-x:权限,mode     
                    1:文件被硬链接的次数     
                    root: owner,属主;     
                    root: group, 属组     
                    8:size,默认为字节     
                    Aug 23 08:47 修改时间戳     
                    .cache:文件名     
            -d:显示目录自身属性     
            -h: human-readable     
            -a:显示所有文件,包括.开头的隐藏文件     
                .: 当前目录     
                ..: 父目录     
            -r: reverse,逆序显示     
            -R: recusive,递归
DSC0001.jpg

  6.which 和whereis
  查找shell命令路径,但是whereis 会给出帮助文件路径
DSC0002.jpg

  stat
  stat –f file 显示文件状态
DSC0003.jpg

  echo 回显命令
  echo [SHORT-OPTION]... [STRING]...   
       echo LONG-OPTION
  DESCRIPTION   
       Echo the STRING(s) to standard output.
  -n     do not output the trailing newline
  -e     enable interpretation of backslash escapes
  -E     disable interpretation of backslash escapes (default)
  --help display this help and exit   

  echo -e 你好 '\n' 回显你好,并让换行符生效
  echo -n nihao  不进行换行
DSC0004.jpg

  w who 和whoami
  w 显示谁登录和系统 并且在做什么
  who 显示登录系统的用户 那种终端登陆 以及登录的时间和登录地址
  whoami 显示登录系统的用户
  shutdown,halt,poweroff 系统关机命令
  reboot 系统重启命令

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-478924-1-1.html 上篇帖子: LINUX之旅 下篇帖子: Linux归档
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表