# du -sh /home //目錄空間使用量 s:不顯示子目錄,全部加總
h:以磁碟單位顯示用量
# df -h //掛載分割區資訊
+++++++++++++++++++++++++++++++++
#yum -y update
# vi /etc/crontab
.
.
0 5 * * * root /user/bin/yum -y update
//minute hour day month day of week
//每天早上5時自動更新
//#which yum 查詢令位置
+++++++++++++++++++++++++++++++++
#yum -y update
# vi /etc/crontab
.
.
0 5 * * * root /user/bin/yum -y update
//minute hour day month day of week
//每天早上5時自動更新
//#which yum 查詢令位置
+++++++++++++++++++++++++++++++++
# cat /etc/passwd //帳號相關
# cat /etc/shadow //密碼相關
# cat /etc/group //群組名稱
+++++++++++++++++++++++++++++++++
# ps aux | grep vsftpd
# cat /etc/group //群組名稱
+++++++++++++++++++++++++++++++++
# ps aux | grep vsftpd
# kill 2845 //當時的pid
# netstat -tunlp //-t:只列tcp -u:只列udp
-n:埠號顯示 -l:只列正在傾聽
-p:行程編號
+++++++++++++++++++++++++++++++++
#wget ftp://.../vsftpd-2...rpm
#rpm -ivh vsftpd-2...rpm //-i:安裝 -h:顯示進度列###
#rpm -Uvh vsftpd-2...rpm //更新套件
#rpm -e vsftpd-2...rpm //移除 erase
+++++++++++++++++++++++++++++++++
# more /root/install.log //空白鍵 下ㄧ頁 q:離開
# less /root/install.log //PageUp + PageDown q:離開
:20移動到20行
/可搜尋文字
# tail -n 3 -f /root/install.log //-n 3 顯示檔尾3行
-f 持續監看 Ctrl+C 中斷
# touch /root/install.log //1.可新增空白檔案
2.改變檔案更動時間
# cat -n /root/install.log //-n行號檢視
+++++++++++++++++++++++++++++++++
# ls -l /usr/lib | more //ls輸出結果 接至 more輸入來源
| 管線
# df > mydf //將df結果產生檔案mydf若mydf存在則覆蓋
# cat mydf
# echo "data1" > myfile //檔案不存在則產生檔案
# cat myfile
# echo "data2" > myfile //覆蓋
# cat myfile
# echo "data3" >> myfile //新資料加至原檔尾端
# cat myfile
+++++++++++++++++++++++++++++++++
# mkdir dvdrom
# mount -t iso9660 /dev/cdrom dvdrom //VirtualMachine要設定好CD/DVD-->Connection-->Use physical drive:實際光碟位置
# ls dvdrom
# umount dvdrom
+++++++++++++++++++++++++++++++++
#mkdir usb
#mount -t vfat /dev/sdb usb //需為FAT32,NTFS不支援
#ls usb
#umount usb
++++++++++++++++++++++++++++++++
# route -n > RouteTable.txt
# cat RouteTable.txt
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 eth0
0.0.0.0 192.168.2.1 0.0.0.0 UG 0 0 0 eth0
# netstat -tunlp //-t:只列tcp -u:只列udp
-n:埠號顯示 -l:只列正在傾聽
-p:行程編號
+++++++++++++++++++++++++++++++++
#wget ftp://.../vsftpd-2...rpm
#rpm -ivh vsftpd-2...rpm //-i:安裝 -h:顯示進度列###
#rpm -Uvh vsftpd-2...rpm //更新套件
#rpm -e vsftpd-2...rpm //移除 erase
+++++++++++++++++++++++++++++++++
# more /root/install.log //空白鍵 下ㄧ頁 q:離開
# less /root/install.log //PageUp + PageDown q:離開
:20移動到20行
/可搜尋文字
# tail -n 3 -f /root/install.log //-n 3 顯示檔尾3行
-f 持續監看 Ctrl+C 中斷
# touch /root/install.log //1.可新增空白檔案
2.改變檔案更動時間
# cat -n /root/install.log //-n行號檢視
+++++++++++++++++++++++++++++++++
# ls -l /usr/lib | more //ls輸出結果 接至 more輸入來源
| 管線
# df > mydf //將df結果產生檔案mydf若mydf存在則覆蓋
# cat mydf
# echo "data1" > myfile //檔案不存在則產生檔案
# cat myfile
# echo "data2" > myfile //覆蓋
# cat myfile
# echo "data3" >> myfile //新資料加至原檔尾端
# cat myfile
+++++++++++++++++++++++++++++++++
# mkdir dvdrom
# mount -t iso9660 /dev/cdrom dvdrom //VirtualMachine要設定好CD/DVD-->Connection-->Use physical drive:實際光碟位置
# ls dvdrom
# umount dvdrom
+++++++++++++++++++++++++++++++++
#mkdir usb
#mount -t vfat /dev/sdb usb //需為FAT32,NTFS不支援
#ls usb
#umount usb
++++++++++++++++++++++++++++++++
# route -n > RouteTable.txt
# cat RouteTable.txt
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 eth0
0.0.0.0 192.168.2.1 0.0.0.0 UG 0 0 0 eth0
沒有留言:
張貼留言