pscp命令linux文件上傳與下載

(壹)上傳

  2.開始→運行→cmd進入到dos模式 輸入以下命令

  pscp D:\java\apache-tomcat-5.5.27\webapps\szfdc.rar dev@192.168.68.249:/home/dev

  3.輸入密碼 ok 文件已經上傳到目標機器的/home/dev目錄下了

  (二)下載

  1、開始→運行→cmd進入到dos模式 輸入以下命令

  pscp dev@192.168.68.248:/home/dev/gren.sql d:\gren.sql;輸入密碼。ok!

  其中:dev為linux的用戶名,192.168.68.248為遠程Linux主機ip地址,/home/dev/gren.sql為linux下的文件 ,d:\gren.sql為保存在本地的文件

  其他

  ——————————————————————

  pscp是putty安裝包所帶的遠程文件傳輸工具,使用和Linux下scp命令相似,具體的使用方法如下:

  PSCP和SCP功能相同,在windows下使用,只有壹個文件,建議將pscp.exe放到C:\WINDOWS\system32下面,這樣就可以在任何地方調用了。語法與scp相同,下面是幾個有用的options。

  -p 拷貝文件的時候保留源文件建立的時間。

  -q 執行文件拷貝時,不顯示任何提示消息。

  -r 拷貝整個目錄

  -v 拷貝文件時,顯示提示信息。

  Usage:

  pscp   [options]   [user@]host:source   target

  pscp   [options]   source   [source…]   [user@]host

  pscp   [options]   -ls   user@host:filespec

  用法:

  pscp [選項] [用戶名@]主機:源文件 目標文件

  pscp [選項] 源文件 [源文件……] [用戶名@]主機

  pscp [選項] -ls 用戶名@主機:文件空間?

  Options:

  選項:

  -p    preserve file attributes 保護文件屬性

  -q    quiet, don’t show statistics 安靜,不顯示統計

  -r    copy directories recursively 復制子文件夾

  -V    print version information and exit  顯示信息

  -v    show verbose messages

  -load sessname  Load settings from saved session

  -load  加載,加載保存節的設定

  -P port   connect to specified port

  -P      端口,連接到指定空間端口

  -l user   connect with specified username

  -l 用戶,用指定的用戶連接空間

  -pw passw login with specified password

  -pw     密碼,用指定的密碼登錄空間

  -1/-2   強迫 ssh 使用的版本

  -4 -6   force use of IPv4 or IPv6

  -C      打開壓縮

  -i   key         鑰匙,證明用的鑰匙文件

  -batch  關閉交互能力,也許

  -unsafe 不安全,允許伺服端取代字符 (危險的)

  常用的方法:

  1、把本地文件file傳輸到Linux服務器的/root/

  C:\>pscp.exe file 192.168.32.50:/root/

  它會提示妳輸入密碼,就像Linux下使用scp那樣。

  【註意】這裏pscp會使用妳Windows登陸的用戶名,因此妳可能需要指定Linux用戶名。

  C:\>pscp.exe file root@192.168.32.50:/root/

  或者

  C:\>pscp.exe -l root file 192.168.32.50:/root/

  【註意】這裏”-l root”要在file之前

  2、把本地目錄dir、文件file傳輸到Linux服務器的/root/,並指定服務器端口2009

  C:\>pscp.exe -P 2009 -r dir file root@192.168.32.50:/root/

  3、把服務器上的/root/file文件取回來本地當前目錄

  C:\>pscp.exe root@192.168.32.50:/root/file .

  4、把服務器上的/root/dir目錄取回本地”C:\My Documents\data\”目錄

  C:\>pscp.exe -r root@192.168.32.50:/root/dir “C:\My Documents\data\”

通過Enumeration和Iterator遍歷Hashtable的效率分析

今天需要遍歷壹個Hashtable,查看了壹下Hashtable類,發現它提供了如下幾個方法可供我們遍歷:

  keys() – returns an Enumeration of the keys of this Hashtable

  keySet() – returns a Set of the keys

  entrySet() – returns a Set of the mappings

  elements() – returns an Enumeration of the values of this Hashtable

  4種方法,那種更好呢,寫段代碼來比較壹下吧:

  import java.util.Enumeration;

  import java.util.Hashtable;

  import java.util.Iterator;

  import java.util.Map.Entry;

  public class traveseHashTable {

  public static void main(String[] args) {

  Hashtable<String, String> ht = new Hashtable<String, String>();

  for (int i = 0; i < 10000; i++) {

  ht.put(“Key=” + i, “Val=” + i);

  }

  // 1. Enumeration

  long start = System.currentTimeMillis();

  Enumeration<String> en = ht.keys();

  while (en.hasMoreElements()) {

  en.nextElement();

  }

  long end = System.currentTimeMillis();

  System.out.println(“Enumeration keys costs ” + (end – start)

  + ” milliseconds”);

  // 2. Enumeration

  start = System.currentTimeMillis();

  Enumeration<String> en2 = ht.elements();

  while (en2.hasMoreElements()) {

  en2.nextElement();

  }

  end = System.currentTimeMillis();

  System.out.println(“Enumeration elements costs ” + (end – start) + ” milliseconds”);

  // 3. Iterator

  start = System.currentTimeMillis();

  Iterator<String> it = ht.keySet().iterator();

  while (it.hasNext()) {

  it.next();

  }

  end = System.currentTimeMillis();

  System.out.println(“Iterator keySet costs ” + (end – start) + ” milliseconds”);

  // 4. Iterator

  start = System.currentTimeMillis();

  Iterator<Entry<String, String>> it2 = ht.entrySet().iterator();

  while (it2.hasNext()) {

  it2.next();

  }

  end = System.currentTimeMillis();

  System.out.println(“Iterator entrySet costs ” + (end – start) + ” milliseconds”);

  }

  }

  這裏創建了壹個10000個元素的Hashtable來供我們遍歷,打印出結果如下:

  Enumeration keys costs 6 milliseconds

  Enumeration elements costs 5 milliseconds

  Iterator keySet costs 10 milliseconds

  Iterator entrySet costs 10 milliseconds

  我們看到,通過叠代來遍歷比枚舉要多花盡壹倍的時間。所以建議大家最好通過枚舉類來遍歷Hashtable哦。

Killtest NS0-101 最新考題更新

科目編號:NS0-101
科目名稱:NetApp Accredited Sales Professional Exam
考題數目:50 Q&As

Killtest 題庫網NS0-101考試發生更新,題庫數目變為50題,
考試版本為V8.02.
有需要的客戶請聯繫客服或者直接購買,保證一次性通過考試。凡在killtest 題庫網購買題庫的客戶如果沒有通過考試,我們將全額退款。

1.Where do you go to find the latest training and events?
A.NetApp Partner.Wiki
B.NetApp Live
C.NetApp Field Portal
D.Partner Academy
Answer:C
2.What are the three most popular Partner resources?(Choose three)
A.NetApp Field Portal
B.NetApp Live
C.Partner Academy
D.NetApp GetSuccessful Partner Enablement Program
E.NetApp University Learning Center(Learning@App)
Answer:A,D,E
3.In the NetApp Value Theme, which three promises does NetApp make to your customer?(Choose three)
A.NetApp delivers value, speed, and emciency to help customers reduce cost and complexity.
B.NetApp enables greater emciency by using faster hardware devices.
C.NetApp enables breakthroughs by helping customers change the way they conduct business.
D.NetApp promises to create an outstanding customer experience.
E.NetApp promises to replace a customer’s existing infrastructure with better hardware and software.
Answer:A,C,D
4.If your customers are thinking about moving to a virtualized infrastructure, they should be interested in which two features?(choose two)
A.A tightly secured storge environment to protect critical business data.
B.Reduced infrastructure complexity to respond more nimbly to changing business requirements.
C.Increasing the number of IT personnel to manage the demands of the infrastructure
D.Having fewer application servers and the management costs associated with them.
E.Increasing storage capacity within their application-based silos.
Answer:A,B
5.Which two groups of features of Data ONTAP are used for data protection?(choose two)
A.SnapVault, SnapManager, SnapRestore
B.SnapRecover, FilexClone, Snapshot technology
C.Deduplication, SnapRestore, FlexClone
D.Snapshot technology, SnapLock, MetroCluster
E.Thin provisioning, Snapshot technology, vitualization
Answer:A,D