PIXNET Logo登入

My Source Code

跳到主文

a lonely journey

部落格全站分類:不設分類

  • 相簿
  • 部落格
  • 留言
  • 名片
  • 8月 15 週三 201209:16
  • rsync -av --delete

[sean@station62 tmp]$ cd report
[sean@station62 report]$ cp /etc/passwd 1.txt
[sean@station62 report]$ cp /etc/passwd 2.txt
[sean@station62 report]$ cp /etc/passwd 3.txt
[sean@station62 report]$ ls
1.txt  2.txt  3.txt
[sean@station62 report]$ cd ..
[sean@station62 tmp]$ ls
report
[sean@station62 tmp]$ rsync -av report/ report2
sending incremental file list
created directory report2
./
1.txt
2.txt
3.txt
sent 6058 bytes  received 72 bytes  12260.00 bytes/sec
total size is 5841  speedup is 0.95
(繼續閱讀...)
文章標籤

sean 發表在 痞客邦 留言(0) 人氣(22)

  • 個人分類:Linux
▲top
  • 8月 14 週二 201212:38
  • cp

基本範例
將 /etc/passwd 檔案複製到目前工作目錄
cp /etc/passwd .
/etc/group 與 /etc/fstab 檔案複製到目前工作目錄
cp /etc/group /etc/fstab .
將 /etc/passwd 檔案複製到目前工作目錄後更名為 mypasswd
cp /etc/passwd mypasswd
(繼續閱讀...)
文章標籤

sean 發表在 痞客邦 留言(0) 人氣(9)

  • 個人分類:Linux
▲top
  • 8月 14 週二 201211:22
  • ln - s Symbolic

[sean@station62 tmp]$ ln -s /etc/passwd passwd.txt
[sean@station62 tmp]$ cat passwd.txt
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
...
(繼續閱讀...)
文章標籤

sean 發表在 痞客邦 留言(0) 人氣(0)

  • 個人分類:Linux
▲top
  • 8月 14 週二 201211:06
  • for-in-do-done

[sean@station62 tmp]$ for name in {1..10}
> do echo $name
> done
1
2
3
4
5
6
7
8
9
10
(繼續閱讀...)
文章標籤

sean 發表在 痞客邦 留言(0) 人氣(4)

  • 個人分類:Linux
▲top
  • 8月 14 週二 201211:05
  • rename 大量改名

[sean@station62 tmp]$ rename .htm .html *
[sean@station62 tmp]$ ls
file1.html  file3.html  file5.html  file7.html  file9.html
file2.html  file4.html  file6.html  file8.html
(繼續閱讀...)
文章標籤

sean 發表在 痞客邦 留言(0) 人氣(21)

  • 個人分類:Linux
▲top
  • 8月 13 週一 201212:13
  • 代入展開

[sean@station62 tmp]$ mkdir {0..9}
[sean@station62 tmp]$ ls
0  1  2  3  4  5  6  7  8  9

[sean@station62 tmp]$ mkdir {a..c}{1..3}
[sean@station62 tmp]$ ls
0  1  2  3  4  5  6  7  8  9  a1  a2  a3  b1  b2  b3  c1  c2  c3
(繼續閱讀...)
文章標籤

sean 發表在 痞客邦 留言(0) 人氣(2)

  • 個人分類:Linux
▲top
  • 8月 13 週一 201209:14
  • root history

    1  adduser
    2  adduser sean
    3  passwd sean
    4  fdisk -l
    5  exit
    6  useradd peter
    7  passwd peter
    8  userdel peter
    9  ls -l /home
   10  rm -rf peter
   11  ls
   12  ls -l
   13  ls /home
   14  rm -rf /home/peter
   15  cd /home
   16  ls
   17  cd /var/spool/mail
   18  ls
   19  rm -rf peter
   20  ls
   21  cd ..
   22  ls
   23  cd ~
   24  ls
   25  exit
   26  useradd peter
   27  passwd peter
   28  su -l peter
   29  userdel -r peter
   30  ls
   31  ls /home
   32  useradd peter
   33  passwd peter
   34  ls
   35  ls /home
   36  userdel peter
   37  ls
   38  cd /home
   39  ls
   40  rm -fr peter
   41  ls
   42  cd /var/spool/mail
   43  rm -rf peter
   44  ls
   45  cd /
   46  ls
   47  exit
   48  visudo
   49  exit
   50  cat --help
   51  cat -n /etc/passwd
   52  less /etc/service
   53  ls /etc
   54  ls -l /etc
   55  less services
   56  less /etc/services
   57  cat -n /etc/services | less
   58  cat -n /etc/services | tail
   59  cat -n /etc/services | tail -n 10
   60  cat -n /etc/services | tail -n +20
   61  cat -n /etc/services | tail -n 10
   62  exit
   63  true > /var/log/wtmp
   64  last
   65  w
   66  who
   67  w
   68  uptime
   69  man df
   70  df
   71  man df
   72  df -h
   73  df -T
   74  df -Th
   75  df -h
   76  man du
   77  rm -f date.txt
   78  exit
   79  who
   80  w
   81  whoami
   82  passwd 1234
   83  exit
   84  vi /etc/sysconfig/network-scripts/ifcfg-eth0
   85  ping www.google.com
   86  vi /etc/sysconfig/network-scripts/ifcfg-eth0
   87  service network restart
   88  ping www.sysfree.com
   89  vi /etc/sysconfig/network
   90  vi /etc/hosts
   91  init 0
   92  passwd sean
   93  exit
   94  /etc/init.d/sshd status
   95  /etc/init.d/sshd
   96  chkconfig --list sshd
   97  ssh root@192.168.123.52
   98  rm /etc/ssh/*key*
   99  /service ssh restart
  100  /service sshd restart
  101  /etc/init.d/ssh
  102  /etc/init.d/ssh restart
  103  cd /etc
  104  cd /init.d
  105  cd /init.d/
  106  ls
  107  ls[root@station62 ~]# /etc/init.d/sshd status
  108  ls /etc/ssh/
  109  ls /etc/init.d
  110  ls /etc/init.d/ssh restart
  111  ls /etc/init.d/sshd restart
  112  /etc/init.d/sshd restart
  113  ssh 192.168.123.52
  114  ssh root@192.168.123.52
  115  cd
  116  mkdir tmp
  117  cd tem
  118  ls
  119  cd tmp
  120  ls
  121  scp root@192.168.123.52:/etc/passwd .
  122  cat -n passwd
  123  ls
  124  rm -f passwd
  125  ls
  126  ssh
  127  ssh root@192.168.123.60
  128  LCCNET
  129  ssh root@192.168.123.60
  130  ssh lccnet@192.168.123.60
  131  scp lccnet@192.168.123.60:/report/* .
  132  scp lccnet@192.168.123.60:report/* .
  133  scp /etc/passwd lccnet@192.168.123.60:upload
  134  scp /etc/passwd lccnet@192.168.123.60:upload/passwd-62
  135  ssh lccnet@192.168.123.60:upload/
  136  ssh lccnet@192.168.123.60
  137  ssh root@192.168.123.52
  138  sftp 192.168.123.60
  139  passwd sean
  140  exit
  141  history
(繼續閱讀...)
文章標籤

sean 發表在 痞客邦 留言(0) 人氣(8)

  • 個人分類:Linux
▲top
  • 8月 13 週一 201209:12
  • sean history

[sean@station62 桌面]$ history
    1  ls
    2  who
    3  whoami
    4  exit
    5  ls
    6  who
    7  w
    8  who
    9  ls
   10  root
   11  whois
   12  who
   13  ping www.yahoo.com
   14  exit
   15  ping www.sysfree.com
   16  ping google.com
   17  ping tw.yahoo.com
   18  su -l peter
   19  sudo userdel peter
   20  su -l peter
   21  sudo userdel peter
   22  ls
   23  tty
   24  sudo userdel -r peter
   25  sudo visudo
   26  ls -l /home
   27  sudo userdel peter
   28  ls
   29  cd /home
   30  ls
   31  tty
   32  w
   33  ls
   34  init 0
   35  sudo init 0
   36  su -l
   37  su -
   38  useradd peter
   39  su -
   40  w
   41  su -l root
   42  su -
   43  sudo fdisk -l
   44  sudo adduser peter
   45  sudo passwd peter
   46  su -l peter
   47  su -
   48  sudo su -
   49  cat -n /etc/passwd | less 10
   50  cat -n /etc/passwd
   51  cat -n /etc/passwd | less
   52  cat -n /etc/passwd | head 10-20
   53  cat -n /etc/passwd |
   54  cat -n /etc/passwd | tail +20
   55  cat -n /etc/passwd | tail -n +20
   56  cat -n /etc/passwd | tail -n +20 | head 10
   57  cat -n /etc/passwd | tail -n +20
   58  cat -n /etc/passwd | tail -n +20 | head -n 10
   59  cat -n /etc/passwd | head -n
   60  cat -n /etc/passwd | head -n 20
   61  cat -n /etc/passwd | head -n 30
   62  cat -n /etc/passwd | head -n 30 | head -n 20
   63  cat -n /etc/passwd | head -n 30
   64  cat -n /etc/passwd | head -n 30 | tail -n 10
   65  cat -n /etc/passwd | head -n 30 | tail -n 9
   66  cat -n /etc/passwd | head -n 30 | tail -n 11
   67  cat -n /etc/passwd | tail -n +20 | head -n 10
   68  cat -n /etc/passwd | tail -n +20 | head -n 11
   69  cat -n /etc/passwd | tail -n +20 | head -n 10
   70  cat -n /etc/passwd | tail -n +20 | head -n 11
   71  sudo hostname myserv
   72  ls
   73  grep -n /etc/passwd "root"
   74  grep -n /etc/passwd
   75  ls /etc/passwd
   76  grep --help
   77  cat -n /etc/passwd | grep --color "root"
   78  cat -n /etc/passwd | grep --color "sean"
   79  grep --color "root" /etc/passwd
   80  vi /etc/passwd | grep --color "sean"
   81  vi /etc/passwd
   82  locale -a
   83  locale -a | cat -n | grep "jp"
   84  LANG=ja_JP.eucjp
   85  date
   86  locale -a | cat -n | grep "zh"
   87  LANG=zh.TW.utf8
   88  date
   89  locale -a | cat -n | grep "th"
   90  LANG=th_TH.utf8
   91  date
   92  locale -a | cat -n | grep "ja"
   93  cat /etc/sysconfig/i18n
   94  sudo vi /etc/sysconfig/i18i
   95  sudo vi /etc/sysconfig/i18n
   96  vi
   97  sudo vi /etc/sysconfig/i18n
   98  cat -n  /etc/sysconfig/i18n | less
   99  locale
  100  man nl
  101  man grep -v
  102  man grep
  103  grep -v
  104  nl /etc/passwd
  105  nl /etc/passwd | less
  106  man tac
  107  tac /etc/passwd
  108  tac /etc/passwd | less
  109  tac /etc/passwd | tail 10
  110  tac /etc/passwd | tail
  111  tac /etc/passwd | tail 20
  112  tac /etc/passwd | tail +20
  113  tac /etc/passwd | tail -n +20
  114  tac /etc/passwd | tail -n +10
  115  tac /etc/passwd | tail -n 10
  116  man rev | less -n
  117  nl /etc/passwd | rev
  118  nl /etc/passwd | less -n 10
  119  nl /etc/passwd | less -n
  120  nl /etc/passwd | tail -n
  121  nl /etc/passwd | tail -n 20
  122  nl /etc/passwd | tail -n 10
  123  nl /etc/passwd | tail -n 10 | rev
  124  man man
  125  ls
  126  pwd
  127  man man
  128  ls
  129  pwd
  130  sudo init 0
  131  sudo userdel peter
  132  ls
  133  exit
  134  whoami
  135  id
  136  id root
  137  id lccnet
  138  nl /etc/passwd
  139  nl /etc/passwd | head --color 20
  140  nl /etc/passwd | head 20
  141  man last
  142  last
  143  last | tail 10
  144  man lastlog
  145  lastlog
  146  wc
  147  cat -n /etc/passwd | grep sean | wc
  148  nl /var/log/wtmp
  149  last
  150  lastlog | grep sean
  151  lastlog | grep root
  152  last | grep sean
  153  last | grep sean | cat -n --color
  154  last | grep sean | wc -l
  155  date > date.txt
  156  ls
  157  cat date.txt
  158  date >> date.txt
  159  cat date.txt
  160  true > date.txt
  161  cat date.txt
  162  nl /var/log/wtmp
  163  last
  164  true > /var/log/wtmp
  165  sudo true /var/log/wtmp
  166  last
  167  w
  168  who
  169  sudo true > /var/log/wtmp
  170  sudo su -
  171  man du
  172  du date.txt
  173  rm -f date.txt
  174  du -h /user
  175  du -h /usr
  176  du -h /usr | sort -h
  177  du -h /var | sort -h
  178  sudo du -h | sort -h
  179  sudo du -h /var | sort -h
  180  sudo du -h /home | sort -h
  181  sudo du -h /home | sort -n
  182  sudo du -h /home | sort -h
  183  sudo du -h /home | sort -h | grep sean
  184  sudo du -h /home | sort -h
  185  man free
  186  free
  187  man free
  188  cpu
  189  proc
  190  man bash
  191  kernel
  192  cat cpuinfo
  193  cat /proc/cpuinfo
  194  free -m
  195  free
  196  man top
  197  top
  198  hdpram
  199  hdparm
  200  man hdparm
  201  man linux
  202  linux
  203  v
  204  'v
  205 
  206  hdparm -i
  207  hdparm -tT
  208  hdparm /dev/sda
  209  sudo hdparm /dev/sda
  210  sudo hdparm -i /dev/sda
  211  ps
  212  man ps
  213  ps aux | grep -i xorg
  214  ps aux
  215  ps aux | grep -i gedit
  216  kill 4520
  217  ps aux | grep -i xorg
  218  ps aux | grep -i gedit
  219  kill 4543
  220  w
  221  who
  222  tty
  223  ls
  224  sudo useradd peter
  225  cd /var
  226  ls
  227  cd~
  228  cd ~
  229  ls
  230  ls //etc/home
  231  ls /etc/home
  232  cd /var/home
  233  cd ~
  234  ls
  235  cd /var
  236  ls
  237  rm -rf /var/spool/peter
  238  sudo init 0
  239  man history
  240  history
  241  history | tail 10
  242  history | head
  243  history | tail
  244  history | tail +10
  245  history | tail 10
  246  history | tail
  247  history
  248  userdel -rf peter
  249  sudo userdel -rf peter
  250  ls /home
  251  history
  252  cd /var
  253  cd ..
  254  ls
  255  cd ~
  256  ls
  257  pwd
  258  ls -a
  259  cat -n .bash_history
  260  time
  261  time
  262  time cat etc/services
  263  ls
  264  man date
  265  date +%H +%M +%C
  266  man date
  267  date +%M
  268  date +%HMC
  269  date +%H:+%M:+%C
  270  date +%H:%M:%C ; sleep 3
  271  cal
  272  man cal
  273  cal 7
  274  day
  275  you
  276  i
  277  me
  278  off
  279  cal
  280  cal 1
  281  ls /home
  282  ls /etc
  283  ls /etc/service
  284  ls /etc/services
  285  ls
  286  man alias
  287  alias
  288  alias grep='grep --color'
  289  cat /etc/passwd | grep sean
  290  vi /home/sean/.bashrc
  291  alias
  292  cat /etc/passwd | grep sean
  293  alias
  294  vi ~/.bashrc
  295  c
  296  vi
  297  vi ~/.bashrc
  298  c
  299  dfsf
  300  fds
  301  c
  302  top
  303  sudo vi /boot/menu.lst
  304  sudo vi /boot/grub/menu.lst
  305  sudo init 6
  306  sudo vi /boot/grub/menu.lst
  307  init
  308  sudo init
  309  sudo init 6
  310  grub-md5-crypt
  311  sudo vi /boot/grub/menu.lst
  312  sudo init 6
  313  sudo vi /boot/grub/menu.lst
  314  uname
  315  uname -a
  316  uname -m
  317  uname -r
  318  ps aux
  319  ps aux | head
  320  cat /etc/inittab
  321  c
  322  cat /etc/inittab
  323  init 3
  324  sudo init 3
  325  sudo LANG=tw_ZH.utf8
  326  exit
  327  startx
  328  locale
  329  LANG=zh_TW.UTF-8
  330  locale
  331  startx
  332  runlevel
  333  cat /etc/inittab
  334  chkconfig --list httpd
  335  chkconfig --list
  336  LANG=c
  337  chkconfig --list
  338  LANG=zh_TW.UTF-8
  339  chkconfig --list
  340  LANG=c
  341  chkconfig --list
  342  LANG=zh_TW.UTF-8
  343  chkconfig --list
  344  sudo init 0
  345  sudo passwd sean
  346  exit
  347  ip a
  348  ip r
  349  cat /etc/resolv.conf
  350  hostname
  351  sudo hostname myserv
  352  hostname
  353  exit
  354  LANG=c
  355  ls
  356  LANG=zh_TW.UTF8
  357  ping www.google.com
  358  traceroute www.sysfree.com
  359  mtr
  360  sudo mtr www.google.com
  361  man dhcp
  362  ip a
  363  ping www.google.com
  364  ip a
  365  mtr sysfree.com
  366  sudo mtr sysfree.com
  367  sudo su -
  368  hostname
  369  cat -n /etc/sysconfig/network
  370  ip add
  371  ip a
  372  ip r
  373  cat /etc/sysconfig/network-script/eth0
  374  pppoe
  375  sudo pppoe
  376  sudo
  377  sudo pppoe-setup
  378  cd /etc/init.d/
  379  ls
  380  cd ..
  381  ls
  382  ls /sysconfig/network
  383  ls /sysconfig/network/
  384  ls /etc/sysconfig/network/
  385  ls /etc/sysconfig/network
  386  ls /etc/sysconfig/
  387  clear
  388  list
  389  ls
  390  init 0
  391  sudo init 0
  392  pwd
  393  cd /../../var
  394  pwd
  395  cd
  396  pwd
  397  ls /boot
  398  ls
  399  ls -l
  400  man ls
  401  ls
  402  ~
  403  ls
  404  ls ~
  405  ls
  406  w
  407  pwd
  408  ls
  409  ls /bin
  410  ls /bin > a.txt
  411  ls
  412  cd ..
  413  rm -f a.txt
  414  ls
  415  cd ~
  416  ls
  417  rm -f a.txt
  418  ls
  419  cd
  420  ls
  421  cd 桌面
  422  ls /bin > a.txt
  423  cat a.txt
  424  ls
  425  rm -f a.txt
  426  ssh peter@192.168.1.50
  427  ssh peter@192.168.123.52
  428  ssh root@192.168.123.52
  429  rpm -qa | cat -n | grep ssh
  430  sudo su -
  431  top
  432  startx
  433  ssh peter@192.168.123.52
  434  ls
  435  ls ~
  436  ls
  437  mkdir tmp
  438  ls
  439  rm -f tmp
  440  rm -rf tmp
  441  pwd
  442  ls
  443  cd ..
  444  ls
  445  mkdir
  446  mkdir tmp
  447  ls
  448  scp peter@192.168.123.52:etc/passwd ./tmp/passwd-62
  449  scp peter@192.168.123.52:etc/passwd
  450  scp peter@192.168.123.52:etc/passwd .
  451  scp peter@192.168.123.52:/etc/passwd .
  452  ls
  453  cat passwd
  454  ls
  455  rm -rf passwd
  456  ls
  457  ssh peter@station52
  458  ls
  459  ssh-keygen -t dsa
  460  cd ..
  461  ls
  462  cd -a
  463  ls -a
  464  cd /home/sean/
  465  ls
  466  ls -a
  467  ssh niuser62@192.168.123.60
  468  ssh niuser62@192.168.123.62
  469  ssh niuser62@192.168.123.60
  470  ssh peter@192.168.123.52
  471  ssh-copy-id -i ~/.ssh/id_dsa.pub peter@192.168.123.52
  472  ssh peter@192.168.123.52
  473  sudo useradd sean2
  474  sudo passwd sean2
  475  su -l sean2
  476  man ssh-keygen
  477  ssh-keygen
  478  pwd
  479  ls
  480  cd..
  481  cd ..
  482  ls
  483  cd tmp
  484  ssh-keygen -t dsa
  485  ls
  486  cd ~
  487  ls
  488  ~
  489  ssh peter@192.168.123.52
  490  su sean2
  491  ssh -X peter@192.168.123.52
  492  system-config-
  493  ssh -X peter@192.168.123.52
  494  rmp -qa tiger
  495  rmp -qa --list
  496  sudo init 6
  497  vncviewer 192.168.123.52:1
  498  vncviewer 192.168.123.52:2
  499  sudo init 0
  500  history
(繼續閱讀...)
文章標籤

sean 發表在 痞客邦 留言(0) 人氣(8)

  • 個人分類:Linux
▲top
  • 8月 11 週六 201201:45
  • mysql:ERROR 1045 (28000)

mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
解決方法
[root@127 html]# /etc/init.d/mysqld stop
正在停止 mysqld:                                          [  確定  ]
[root@127 html]# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
[1] 3875
[root@127 html]# 120810 21:37:39 mysqld_safe Logging to '/var/log/mysqld.log'.
120810 21:37:39 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
mysql -u root mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.61 Source distribution
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>  UPDATE user SET Password=PASSWORD('******') where USER='root';
Query OK, 3 rows affected (0.00 sec)
Rows matched: 3  Changed: 3  Warnings: 0
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
mysql> quit
Bye
[root@127 html]# /etc/init.d/mysqld restart
120810 21:39:39 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
正在停止 mysqld:                                          [  確定  ]
正在啟動 mysqld:                                          [  確定  ]
[1]+  Done                    mysqld_safe --user=mysql --skip-grant-tables --skip-networking
[root@127 html]# mysql -uroot -p
Enter password: 輸入剛剛輸入的新密碼 ******
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.61 Source distribution
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
(繼續閱讀...)
文章標籤

sean 發表在 痞客邦 留言(0) 人氣(70)

  • 個人分類:Linux
▲top
  • 8月 09 週四 201210:25
  • ssh -X 遠端圖型介面

[sean@station62 桌面]$ ssh -X peter@192.168.123.52
Last login: Thu Aug  9 10:09:28 2012 from 192.168.123.62
/usr/bin/xauth:  creating new authority file /home/peter/.Xauthority
[peter@localhost ~]$ firefox
(繼續閱讀...)
文章標籤

sean 發表在 痞客邦 留言(0) 人氣(22)

  • 個人分類:Linux
▲top
«1...34512»

文章搜尋

Catalog

  • Javascript (4)
  • DW (3)
  • Preference (10)
  • PHP/Mysql (3)
  • ASP (15)
  • CSS (3)
  • Linux (78)
  • 未分類文章 (1)

Article

  • ASP 判斷手機
  • Javascript string
  • VBS STRING
  • 表單大全
  • Javascript 文字click切換
  • ASP 移除 HTML
  • Server.HTMLEncode
  • 判斷要求來源是否來自本地
  • 淡入淡出文字的javacode
  • CSS 超簡單變圖語法