Note: 简单有用的 linux commands


常用的 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 的位置才是最麻烦的。

相关内容

    暂无相关文章