Linux练习命令一

1.clock 和hwclock的用法

[[email protected] ~]# 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 显示当前硬件时间状态


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,递归

6.which 和whereis

查找shell命令路径,但是whereis 会给出帮助文件路径

stat

stat –f file 显示文件状态

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  不进行换行

w who 和whoami

w 显示谁登录和系统 并且在做什么

who 显示登录系统的用户 那种终端登陆 以及登录的时间和登录地址

whoami 显示登录系统的用户

shutdown,halt,poweroff 系统关机命令

reboot 系统重启命令

时间: 2024-08-03 17:39:19

Linux练习命令一的相关文章

Linux常用命令(echo、date、ls、cd、history、cat)

一.linux常用命令有很多今天我们来总结一下常用的入门命令: 1.linux下关机命令:poweroff.init 0.halt.shutdown -h now 2.linux下重启命令:reboot.init 6.shutdown -r now 3.shutdown命令: 格式:shutdown  options TIME 其中options有以下几个: -r:执行重启 -c:取消shutdown命令 -h:执行关机 其中TIME有以下几个: now:表示现在 +m:相对时间表示法,从命令提

Linux常用命令学习

补充: 管道符号:   | 含义: 命令1 的正确输出作为命令2的输出对象. 格式: 命令1   |  命令2 举例: ls -ctrl |  more 常用命令: netstat   -an    |  grep    ESTABLISHED         查看正在连接的端口 netstat   -an    |   grep   LISTEN find   .    -name   test.txt    |     cat    -n          在当前目录下找到文件名为test.

linux 解压缩命令

linux zip命令 zip -r myfile.zip ./*将当前目录下的所有文件和文件夹全部压缩成myfile.zip文件,-r表示递归压缩子目录下所有文件. 2.unzipunzip -o -d /home/sunny myfile.zip把myfile.zip文件解压到 /home/sunny/-o:不提示的情况下覆盖文件:-d:-d /home/sunny 指明将文件解压缩到/home/sunny目录下: 3.其他zip -d myfile.zip smart.txt删除压缩文件中

linux常用命令详解

linux常用命令 cut命令 例如:cut -d\| -f1,4 xx.txt -d 表示字段分隔符 -f 表示要显示的字段域,如果域之间,(逗号)隔开表示显示对应的单个域,如果用-隔开表示显示连续的域 sort命令 例如:sort -t\| -k2 xx.txt -n 按数值排序 -r 降序 -t 字段分隔符 -k 以哪个字段为关键字进行排序 -u 去重 -f 排序时不区分大小写 uniq命令 注意:使用uniq命令时,一定要先进行排序 -c 显示文件中行重复的次数 -d 只显示重复的行 -

linux mail 命令参数

使用mail发邮件时,必须先将sendmail服务启动. mail –s “邮件主题” –c”抄送地址” –b “密送地址” -- -f 发送人邮件地址 –F 发件人姓名 < 要发送的邮件内容 三种常用格式发信    mail -s test [email protected]                         #第一种方法,你可以把当前shell当成编辑器来用,编辑完内容后Ctrl-D结束    echo “mail content”|mail -s test [email pr

使用配置hadoop中常用的Linux(ubuntu)命令

生成key: $ ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa $ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys -t   密钥类型可以用 -t 选项指定.如果没有指定则默认生成用于SSH-2的RSA密钥. -f filename             指定密钥文件名. 来源:http://www.aboutyun.com/thread-6487-1-1.html 远程登录执行shell命令key ssh远

Linux常用命令大全

系统信息 arch 显示机器的处理器架构(1) uname -m 显示机器的处理器架构(2) uname -r 显示正在使用的内核版本 dmidecode -q 显示硬件系统部件 - (SMBIOS / DMI) hdparm -i /dev/hda 罗列一个磁盘的架构特性 hdparm -tT /dev/sda 在磁盘上执行测试性读取操作 cat /proc/cpuinfo 显示CPU info的信息 cat /proc/interrupts 显示中断 cat /proc/meminfo 校验

(转)linux常用命令

原地址:http://www.cnblogs.com/svage/p/3700122.html 1.删除目录及子目录下的 .svn目录 find . -type d -name ".svn" | xargs rm -rf 2./tmp 目录的权限 drwxrwxrwt rwt的意思是:对目录有执行权限,但不能删除,即sticky bit rwx : 可读可写可执行 4+2+1 3.改变群组.用户.权限 chgrp   群组名   改变的目录 groupadd -g gid gname

linux date 命令使用

http://blog.sina.com.cn/s/blog_654c6ec70101mx99.html http://codingstandards.iteye.com/blog/1157513 linux date 命令使用,码迷,mamicode.com

Linux 常用命令之文件和目录

1. cd 命令格式:cd  [dirName](cd和目录之间使用空格隔开) 作用:切换当前目录至dirName. 实例: cd /home 切换当前目录到/home (查看当前目录命令为pwd) cd .. 返回上一级目录 cd ../.. 返回上两级目录 cd ~ 进入个人的主目录 2. ls 命令格式:ls [选项] [目录名] (目录名为空时表示当前目录) 作用: 查看目录中的文件 常用选项: -a, –all 列出目录下的所有文件,包括以 . 开头的隐含文件. -l 除了文件名之外,