2015年8月26日 星期三

RHEL7 create, delete, copy, and move file


創建目錄:mkdir directory

建立一個目錄,範例:mkdir dir
連同子目錄一起建立,範例:mkdir -p /dir1/dir2/dir3

-----------------------------------------------------------------------------------------
刪除檔案或目錄:rm file or directory

強制刪除一個檔案(不包括目錄),範例:rm  -f  file
刪除前出現警示(預設,不包括目錄),範例:rm  -i  file
強制刪除一個檔案或目錄,範例:rm  -rf  file/dir

-----------------------------------------------------------------------------------------
複製檔案或目錄:cp file or directory

複製並產生檔案,範例:cp file1 file2
複製多個檔案到目錄下,範例:cp file1 file2 file3 dir/
複製多個目錄到最後一個目錄下,範例:cp -r dir1 dir2 dir3 dir4

-----------------------------------------------------------------------------------------
移動檔案或目錄:mv file or directory

移動檔案內容(如果目的檔不存在則是更改檔名),範例:mv file1 file2
移動檔案到目錄,範例:mv file1 file2 file3 dir
移動目錄到目錄,範例:mv dir1 dir2
移動多個目錄到最後一個目錄下,範例:mv dir1 dir2 dir3 dir4


RHEL7 User and Group command (table)




2015年8月24日 星期一

RHEL7 Lab-2.2 Managing Files with Shell Expansion


1.建立12個檔案,名稱為 tv_seasonX_episodeY.ogg



2.建立8個檔案,名稱為 mystery_chapterX.odf



3.在/影片(Videos)目錄下建立season1 and season2



4.移動 tv_season1..到season1 ,  tv_season2..到season2



5.建立兩個目錄以上並使用一行指令完成,建立 Documents/my_bestseller/chapters



6.使用一行指令建立三個子目錄,在 Documents/my_bestseller/ 下



7.切換到 Documents/my_bestseller/chapters 目錄下,移動家目錄內mystery_chapter開頭的資料到本目錄



8.移動mystery_chapter1.odf和mystery_chapter2.odf到上個目錄內的editor目錄下



9.移動mystery_chapter7.odf和mystery_chapter8.odf到上個目錄內的vacation目錄下



10.到/影片/season2目錄下,複製tv_season2_episode1.ogg到/Documents/my_bestseller/vacation



11.到Documents/my_bestseller/vacation查看,並用cd -返回,在複製tv_season2_episode2.ogg到/Documents/my_bestseller/vacation,返回目錄查看



12.回到上個目錄,複製/chapters/mystery_chapter5 and 6.odf 檔案到/plot_change



13.到/plot_change目錄下,產生一份mystery_chapter5加上今天日期的檔案和加上從1970-1-1到現在共過了幾秒的檔案和加上使用者名稱的檔案



14.刪除/plot_change目錄下所有檔案並刪除/plot_change



15.刪除/vacation目錄


RHEL7 Practice-2.1 Command-Line File Management


1.在你的家目錄建立空的文件,來練習吧!



2.在你的家目錄移動 song file 到音樂資料夾下,移動film file 到影片目錄下



3.在你的家目錄下建立三個子目錄 分別為friends, family, work.



4.到新建立的目錄下 family and friends ,複製音樂和影片內的資料分別放到兩個目錄下



5.到work目錄下,複製音樂和影片內的檔案進來



6.切換到家目錄,並刪除 family and friends



7.刪除 work file 內全部資料但不會刪除work file.



8.到你的家目錄下,使用 rmdir 指令刪除 work 這個空目錄


2015年8月23日 星期日

RHEL7 Lab-1.1 Accessing the Command Line


1.用 student 帳戶登入到圖形介面的桌面



2.打開終端機視窗



3.更換 student 密碼為 T3st1ngT1me


4.顯示現在時間和日期


5.顯示現在時間,格式為 AM/PM HH:MM:SS



6.查看 /usr/bin/clean-binary-files 文件類型是什麼?



7.使用 wc 指令來顯示 /usr/bin/clean-binary-files 內的[行數、字、字元(包括符號)]
小技巧:輸入wc後按 {ESC + .} 會直接將上一次輸入的最後一段指令複製到上面



8.顯示前10行在 /usr/bin/clean-binary-files 文件
小技巧:head {ESC + .}



9.顯示後10行在 /usr/bin/clean-binary-files 文件
小技巧:tail {ESC + .}



10.使用 tail -n 20 /usr/bin/clean-binary-files 這行指令來練習快速鍵。並顯示末20行資料
Ctrl + a :跳到最前面
Ctrl + Right Arrow:跳到下一個單字



11.回顧一下我們所打的指令紀錄:history


12.退出:exit

2015年8月12日 星期三

RHEL7 VirtualBox 載入USB並分割


VirtualBox官網:https://www.virtualbox.org/
VirtualBox擴充載點:http://download.virtualbox.org/virtualbox/5.0.0/Oracle_VM_VirtualBox_Extension_Pack-5.0.0-101573.vbox-extpack

Step 1:打開 VirtualBox 點檔案→喜好設定(Ctrl+G)→擴充套件→新增剛剛下載的擴充套件


Step 2:點選自己的虛擬機到設定值內,啟用並新增自己的USB


Step 3:打開終端機,輸入:fdisk -l 查看USB有沒有載入進來


Step 4:fdisk /dev/sdb 開始做分割,m可取得說明,先刪除原本分割區,輸入 d


Step 5:輸入 n 新增一個磁區,因筆者使用USB 8G,所以前面不能分割太大的空間,我是選用3個主要磁區(primary)和一個延伸(extended)一個邏輯(logical)的方案來配置。輸入 n 新增後,前三個都輸入 p 來新增主要磁區。

因硬碟的限制所以主要分割和延伸分割最多四個,新增最後一個輸入 e 來延伸配置邏輯分割。

最後最後配置完須按 w 儲存離開才是設定完成。







2015年8月9日 星期日

RHEL7 MariaDB + phpMyAdmin


Step 1:到應用程式→系統工具→軟體,搜尋 mariadb 和 php 並安裝以下套件




Step 2:安裝 Mariadb 資料庫並啟動


Step 3:


Step 4:


Step 5:
phpMyAdmin下載:https://files.phpmyadmin.net/phpMyAdmin/4.4.13.1/phpMyAdmin-4.4.13.1-all-languages.zip


如下圖:


Step 6:進入後,開始設定密碼,並將帳號為任意的使用者移除


RHEL7 Drupal 架站


官方網站:http://drupaltaiwan.org/
繁體語言套件:http://ftp.drupal.org/files/translations/5.x/drupal/drupal-5.23.zh-hant.po
主要檔案:http://ftp.drupal.org/files/projects/drupal-7.38.tar.gz

Step 1:

  1. 將下載目錄內的drupal-7.38.tar.gz解包後,並將drupal-7.38放入/var/www/html且更名為drupal
  2. 把drupal-7.38.zh-hant.po繁體包放入/var/www/html/drupal/profiles/standard/translations/
  3. restorecon -R /var/www/html


Step 2:到網址列輸入 localhost/drupal


Step 3:


Step 4:出現以下畫面解決
  1. yum -y install php-dom php-theseer-fDOMDocument
  2. 到/var/www/html/drupal/sites/default目錄下新增files目錄
  3. cp default.settings.php settings.php
  4. chown apache.apache settings.php
  5. chown apache.apache files
  6. restorecon -R /var/www/html/drupal
  7. 重新整理頁面



 Step 5:資料庫名稱,必須為Mariadb內有的名稱。使用者名稱root
 Step 6:使用者名稱(登入名稱)


Step 7:


Step 8:


Step 9: