command line samba to copy files

David G. Miller dave at davenjudy.org
Sat Aug 19 15:27:01 UTC 2006


"Deepak Shrestha" <d88pak at gmail.com> wrote: 

>Hi,
>
>I need some pointers on how to use samba from command line. My
>specific problem is like this:
>
>I have been using KDE environment in linux most of the time. In this
>GUI, I can use smb:/ then point to the machine then copy to/from files
>between the machines. Now I want to know how to do that in command
>line. Some help I got after research is to use the "smbclient" command
>but when I use
>$ smbclient //server/share
>I can access that machine and can view the files but how do I copy
>some file from there to my home directory or vice versa? I couldn't
>find any command like "cp" or "mv" in samba prompt.
>
>Thanks
>  
>
smbclient uses a vernacualr that is similar to ftp.  Use "get" to copy 
files from the samba share to your local machine, "put" to copy files 
from your local machine to the samba share, cd to change directories on 
the server and lcd to change directory on the local machine.  There is a 
built in help function to smbclient:

[dave at bend ~]# smbclient //mutilate/share
Password:
Domain=[DAVENJUDY] OS=[Unix] Server=[Samba 3.0.10-1.4E.6.2]
smb: \> dir
  .                                   D        0  Fri Jul 14 11:32:28 2006
  ..                                  D        0  Tue Jul 25 16:48:12 2006
  lost+found                          D        0  Mon May 26 15:42:40 2003
  dave                                D        0  Tue Jul 25 12:52:52 2006
  share1                              D        0  Fri Jul 18 22:09:51 2003
  share2                              D        0  Wed May 17 15:52:13 2006
  judy                                D        0  Wed Jul 12 08:00:27 2006
  share4                              D        0  Wed May 17 15:57:41 2006
  pcap                                D        0  Fri Jul 14 20:50:04 2006
  iso                                 D        0  Wed Jul 12 23:29:24 2006
  tgz                                 D        0  Wed May 17 16:02:09 2006
  erik                                D        0  Sun Apr  3 12:13:43 2005

                36119 blocks of size 4194304. 16637 blocks available
smb: \> help
?              altname        archive        blocksize      cancel        
case_sensitive cd             chmod          chown          del           
dir            du             exit           get            getfacl       
hardlink       help           history        lcd            link          
lowercase      ls             mask           md             mget          
mkdir          more           mput           newer          open          
print          prompt         put            pwd            q             
queue          quit           rd             recurse        reget         
rename         reput          rm             rmdir          setmode       
stat           symlink        tar            tarmode        translate     
volume         vuid           logon          listconnect    showconnect   
!             
smb: \>

Cheers,
Dave

-- 
Politics, n. Strife of interests masquerading as a contest of principles.
-- Ambrose Bierce




More information about the fedora-list mailing list