歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Note: 簡單有用的 linux commands

Note: 簡單有用的 linux commands

日期:2017/2/28 15:42:27   编辑:Linux教程

常用的 linux/mac terminal command:

# pwd
顯示自己所在的 directory

# ps -ef
顯示正在執行的 process,之後再用 kill 去殺掉它

# rm -r
刪除目錄及其內的檔案

# chmod -R, chown -R, chgrp -R
更新目錄和其內的檔案的權限、擁有者和群組

# top
顯示 cpu & memory 的使用情況

# ssh <username>@<host> -p <port>
用 ssh 連去其他主機

# scp -p <port> <username>@<host>:<remote file> <local dir>
透過 ssh 下載其他主機的檔案

# /etc/init.d/<service name> start/stop/restart
開始/停止/重啟某項 service

# ifconfig
顯示 ip 等資料

# tail -n <number> <file>, head -n <number> <file>
顯示 file 尾/頭 number 行列的資料


--------------------------------------------------------------------------------
以下是 Ubuntu 的筆記:

Host file location: /etc/hosts

set static ip: /etc/network/interfaces

restart network servies: /etc/init.d/networking restart

samba config location: /etc/samba/smb.conf

retstart samba: restart smbd

--------------------------------------------------------------------------------
寫下來時發覺原來 command 不難,找出 config file 的位置才是最麻煩的。

Copyright © Linux教程網 All Rights Reserved