2015年5月6日 星期三

Unix Command Line Cheat sheet - Bash command

Course note for  The Data Scientist’s Toolbox :
Command Line Interface (CLI) - Bash command
這是  The Data Scientist’s Toolbox 第二週的上課筆記之一

延伸閱讀:The Data Scientist’s Toolbox 上課心得

This is for my review and memory. I may update this in the future.
為了我可憐的記憶力 QQ,記錄一下,應該會再更新。

Explanation: directory is folder.
解釋: directory 就是資料夾



pwd: print your working directory 顯示目前的工作目錄

clear: clear  清除目前CLI的文字內容

ls: show files in this directory 顯示目前目錄下的檔案
ls -a: list hidden/unhidden files 顯示目前目錄下的所有檔案
is -l: list details of files 列出檔案的細節
is -al: list details for hidden/unhidden files 列出目前目錄下的所有檔案細節

cd stands for change directory. cd 代表改變directory
cd: 直接打cd,帶你去home directory, 通常是C/user/user
cd .. :去上一層directory

mkdir 檔案名 : make a directory 創造一個資料夾

touch 檔案名: 創一個空檔案

cp 檔案名 路徑名稱: copy 檔案道路徑之中。ex: cp test_file documents
cp -r 路徑名 路徑名稱: 複製資料夾到資料夾

rm 檔案名: remove file
rm -r 路徑名稱 路徑名稱: 刪除資料夾到資料夾   *注意無法回復

mv 檔案 路徑名稱: 移動檔案到路徑
mv 舊檔案名 新檔案名: 可以改變檔案名稱

cp old_path new_path: copy a file to new path
cp -r old_path new_path: copy a directory TO new path

echo 字串/變數: 直接印出字串/變數

date :印出現在日期跟時間



If you want to use (copy, paste or quote) my original article, please contact me through email. (autek.roy@gmail.com) If there is any mistake or comment, please let me know. :D

如要使用(複製貼上或轉載)作者原創文章, 請來信跟我聯絡。(autek.roy@gmail.com) 如果有發現任何的錯誤與建議請留言或跟我連絡。 : )

沒有留言:

張貼留言

請留下您的任何想法或建議!
Please leave any thought or comment!