ls 选项 参数
-a 查看当前目录下的所有文件包括隐藏文件
[root@10 ~]# ls #没有加-a的效果
anaconda-ks.cfg initial-setup-ks.cfg
[root@10 ~]# ls -a #加了-a的效果
. .bash_history .bashrc .cshrc .tcshrc
.. .bash_logout .cache .dbus
anaconda-ks.cfg .bash_profile .config initial-setup-ks.cfg
[root@10 ~]#
-l显示文件的长格式
[root@10 ~]# ls -l 显示文件的长格式
total 8
-rw-------. 1 root root 1383 Jul 12 06:31 anaconda-ks.cfg
-rw-r--r--. 1 root root 1675 Jul 12 06:34 initial-setup-ks.cfg
[root@10 ~]#
-h ”翻译文件“的大小正常显示为字节数
[root@10 ~]# ls -lh
total 8.0K
-rw-------. 1 root root 1.4K Jul 12 06:31 anaconda-ks.cfg
-rw-r--r--. 1 root root 1.7K Jul 12 06:34 initial-setup-ks.cfg
[root@10 ~]#
-A:显示除了. (当前目录)和..(上级目录) 的所有文件
[root@10 ~]# ls -A
anaconda-ks.cfg .bash_logout .bashrc .config .dbus .tcshrc
.bash_history .bash_profile .cache .cshrc initial-setup-ks.cfg
-d 只显示当前目录本身
[root@10 ~]# ls -d
.
-R 递归显示
[root@10 wwj]# ls -R
.:
user
./user:
user1 user10 user2 user3 user4 user5 user6 user7 user8 user9
-r 逆序显示
[root@10 user]# ls -r
user9 user8 user7 user6 user5 user4 user3 user2 user10 user1
pwd 显示当前所在目录
cd 参数 切换目录
cd ~ 切换到当前用户的家目录
cd 切换到当前用户的家目录等同于cd ~
cd - 切换到上一个目录
cat 参数 文件
-n 显示行号
-E 显示行尾结束符
tac 参数 文件
-n 显示行号
-E 显示行尾结束符
nl 文件 相当于cat -n
echo 回显
例如:
[root@10 etc]# echo "hello word"
hello word
-n 不换行
-e 让转义符生效
\t :制表符
\n:换行
系统关机命令 halt
系统重启命令 reboot
date 显示当前时间
%F显示当前年月日
%T显示时分秒
%Y:显示多少年
%m:显示多少月
%d:显示多少日
%H:显示多少时
%M:显示多少分
%S:显示多少秒
%s(从1970年 1-1 00.00.00到现在经过的时间)
设定日期时间:date [MMDDhhmm[[CC]YY][.ss]]
(MM)
hwclock=clock:硬件时钟
显示或者设定时钟
-s:设置为硬件命令为准
-w:设置为系统命令为准