ls 查看文件的信息
#ls? -d? /root/Desktop? ? //顯示目錄本身
#ls? -l? ? //長格式顯示(顯示文件的詳細信息)
文件類型\權(quán)限? ? 硬鏈接個數(shù)? 所有者 所屬組? 大小? ? 修改時間? 名字
#ls -lh? ? //-h? human? 人性化顯示以單位顯示
#ls -s? ? ? //查看大小所使用的塊
#ls -a? ? ? //all 顯示所有文件 (包括隱藏文件)
#ls -R? dir1? ? //遞歸顯示文件
#ls? -S? ? ? ? ? ? //按文件的Size排序
#ls? -t? ? //按修改時間排序
#ls? -r? ? //逆序排列reverse
#ls? -i? ? //顯示文件的inode號(索引號)
#ls a.txt b.txt
#ls a b c
#ls a* 列出含a 的開頭所有,隱藏文件除外。? ? ? ls | grep '^a'
- 多個短選項可以寫在一起,大部分沒有順序
--長選項不能和別的選項寫在一起
隱藏文件:文件名稱前面加“.”
.? ? ? 當(dāng)前目錄
..? ? 上一級目錄
cd :change directory 切換路徑
#cd? ? ? ? //回家
#cd +路徑
#cd -? ? ? //切換到上一次去過的目錄
#pushd? 切換目錄(會顯示之前去過的目錄:堆棧)? ? ? popd 回到上一次去過的目錄
#cd ..? ? ? //切換到上級目錄
凡是安裝了bash而產(chǎn)生的命令,稱為內(nèi)建(builtin )命令--------------------->help cd 查看幫助
type +命令------------------------>查看命令類型
[root@smileboy ~]# type cd
cd is a shell builtin
[root@smileboy ~]# type ls
ls is aliased to `ls --color=auto'
--help(-h) 某一個命令的參數(shù)
man
/usr/share/doc
--help -h
以命令選項的形式出現(xiàn)
#ls? --help
[? ]? ? 表示可選項
{ }? ? 表示必選項
|? ? ? ? 或者
{a | b}
[a | b]
? <>? ? 必選項
...? ? 表示多個
凡是沒有被任何符號修飾的全是必寫
man
manual page
分類:
1.命令
2.系統(tǒng)調(diào)用
3.c標(biāo)準(zhǔn)庫
4.設(shè)備
5.配置文件
6.游戲
7.雜項
8.系統(tǒng)管理
9.內(nèi)核(rhel5、rhel7)
需要記憶:1 、5 、7、8
1.commands? ? 用戶可以從shell 運行命令
5.file formats and conventions? ? ? /etc/passwd
7.macro packages and conventions? 文件系統(tǒng)標(biāo)準(zhǔn)描述,網(wǎng)絡(luò)協(xié)議,ASSCII和其他字符集
8.system management commands? ? 只有root執(zhí)行的
#man -f passwd? //查看都在第幾類有我要查看的文件<====>whatis passwd
#man -a passwd? //查看所有帶passwd的章節(jié)
#man -k passwd? //按關(guān)鍵字查找
空格翻頁? 回車翻行
g? 定位到開頭
G 定位到結(jié)尾
? /關(guān)鍵字? ? n按關(guān)鍵字往下翻? ? N按關(guān)鍵字往上翻
/usr/share/doc 存儲幫助手冊
info? information 非常詳細的信息
時間顯示:
date:顯示當(dāng)前時間
date +%y: 顯示年
date +%y%m%d%H%M%S:顯示年月
#cp 文件名? /var/ftp/pub/`date +%y%m%d%H%M`.文件名 ? //文件上加上時間
[root@smileboy ~]# date +%F
2018-03-15
時間設(shè)置:
date -s 8:50? 設(shè)置時間
hwclock? 查看硬件時間
date? ? 查看系統(tǒng)時間
hwclock -s 同步硬件時間到系統(tǒng)
hwclock -W 同步系統(tǒng)到硬件
官方手冊
http://docs.redhat.com? ? Enterprise Linux (5/6/7)? ? Linux系統(tǒng)相關(guān)幫助指南
http://www.mysql.com? ? ? ? docs? ? ? ? ? ? ? ? ? ? ? ? ? ? MySQL使用指南
http://www.zabbix.com? ? ? Documentation? ? ? ? ? ? Zabbix使用指南