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

每一天都是一个阶梯,是向既定目标迈进的新的一步。

Note: 简单有用的 linux commands

相关文章:

你感兴趣的文章:

标签云: