Một số lệnh thông dụng trong linux

1. Xóa toàn bộ các file .svn
  find . -name .svn -print0 | xargs -0 rm -rf
2. Xử lý với các file và thư mục trong thư mục hiện hành.
Ví dụ: chmod riêng folder hoặc file

find . -type d -print0 |xargs -0 chmod 755
find . -type f -print0 |xargs -0 chmod 644
hoặc
find . -type d | xargs chmod 644

3. Forward port thông qua ssh
sudo ssh -L 3308:IPserver:3306   user@IPserver

4. Grep: get 10 lines After ,  get 10 lines Before
cat file.txt | grep -A10 "test" | wc -l
cat file.txt | grep -B10 "test" | wc -l

Còn nữa..

No comments:

Post a Comment