daily used command[just for remember]

1. change user : SU
eg: if current user is root, u want to change to another user A, then : su userA


1. just list directory:

ls -l| grep ^d

2. list specific character directory
ls -d abc*

3. list directory via time
ls -l -t
ls -lrt

4. check whether a port number is used:
netstat -n | grep 15010

if generate nothing, then not used; if generated including the port number lines, then its occupied

5 search specific strings from a bunch of file
grep -n -R "string" ./*
在屏幕当前目录下所有打印出包含string字符串的文件名及行数;
-n 打印行数,
-R 遍历目录
./* 当前目录下所有文件

6 copy a file to current directory
cp xyz .

7 add symbolic link

symbolic link: http://en.wikipedia.org/wiki/Symbolic_link
ln -s <SOURCE FILE> <DESINATION FILE>
ln -s /sbcimp/run/pkgs/APRAP/profiles/.aprap_second_functional_run_profile /home/dssengap/.aprap_prod_run_profile
remove symbolic link: rm linkname
8 kill service
kill -9 pid

9. memory used checked:
http://www.cyberciti.biz/faq/linux-check-memory-usage/

猜你喜欢

转载自coderanch.iteye.com/blog/1772599