搜尋此網誌

2015年7月14日 星期二

在 Linux 下找出佔用磁碟空間最大的目錄/檔案

找出 /home 目錄中佔用磁碟空間最大的目錄
du -hsx /home/* | sort -hr | head

找出前 10 大的檔案
find /home -type f -printf '%s %p\n' | sort -nr | head

找出前 10 大的 exe 檔案
find /home -type f -iname '*.exe' -printf '%s %p\n' | sort -hr | head

2015年7月2日 星期四

CentOS 6 安裝 Graphical Window System (X.org-X11)



yum -y groupinstall 'Desktop'

yum -y groupinstall 'Desktop Platform'

yum -y groupinstall 'X Window System'

yum -y groupinstall 'Fonts'

yum -y groupinstall 'Graphical Administration Tools'

yum -y groupinstall 'GNOME Desktop Environment'

yum -y groupinstall "Chinese Support"


如有安裝中文語系套件,要再修改預設語系

編輯: /etc/sysconfig/i18n,
將 LANG="en_US.UTF-8" 改為 LANG="zh_TW.UTF-8" ,
如果檔案是空白的,請直接加入:
LANG="zh_TW.UTF-8"








yum -y groupinstall "X Window System" "Desktop" "Fonts" "General Purpose Desktop"

CentOS 文字模式及圖形模式的切換

CentOS 6 切換文字介面只要將

/etc/inittab

「id:3:initdefault:」裡的3改成「id:5:initdefault:」即可



CentOS 7 切換文字介面只要將

/etc/inittab

圖形介面:#systemctl set-default graphical.target
文字介面:#systemctl set-default multi-user.target

指令下完之後,重新開機就變成您想要的模式了

Yumdownloader



If downloading a installed package, "yumdownloader" is useful.


1.Install the yum-utils package:
# yum install yum-utils


Run the command followed by the desired package:
# yumdownloader <package>


Note:
The package is saved in the current working directly by default; use the --destdir option to specify an alternate location.
Be sure to add --resolve if you need to download dependencies.

2015年6月24日 星期三

RedHat/CentOS 關閉 SELINUX

編輯 /etc/sysconfig/selinux 這個檔案

將 SELINUX=enforcing 改成 SELINUX=disabled ,

重開機就可以了!

2015年6月21日 星期日

註冊 Redhat Linux

subscription-manager register

Username: email adress
Password: password
The system has been registered with ID: 8d1eef8f-f44a-42bd-b423-4197c3c20082

再次執行 yum,若出現如下指令表示已經註冊但還沒有套用可用的授權訂閱。

Loaded plugins: product-id, security, subscription-manager
This system is registered to Red Hat Subscription Management, but is not receiving updates. You can

use subscription-manager to assign subscriptions.
Setting up Update Process
No Packages marked for Update



查看可用訂閱。
subscription-manager list --available

[root@localhost tmp]# subscription-manager list --available
+-------------------------------------------+
    Available Subscriptions
+-------------------------------------------+
Subscription Name: 30 Day Red Hat Enterprise Linux Server Self-Supported Evaluation
Provides:          Red Hat Container Images Beta
                   Red Hat Beta
                   Red Hat Enterprise Linux Atomic Host Beta
                   Oracle Java (for RHEL Server)
                   Red Hat Container Images
                   Red Hat Enterprise Linux Server
                   Red Hat Enterprise Linux Atomic Host
SKU:               RH00065
Contract:          10719296
Pool ID:           8a85f9814df266ee014dfb931cfc2854
Available:         2
Suggested:         1
Service Level:     Self-Support
Service Type:      L1-L3
Subscription Type: Instance Based
Ends:              07/16/2015
System Type:       Physical




使用 subscribe 參數訂閱可用的 Pool。


subscription-manager subscribe --pool=8a85f9814df266ee014dfb931cfc2854

Successfully attached a subscription for: 30 Day Red Hat Enterprise Linux Server Self-Supported

Evaluation


完成!




搜尋此網誌