LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   How to enter network directory from console? (https://www.linuxquestions.org/questions/linux-networking-3/how-to-enter-network-directory-from-console-812330/)

Mr. Alex 06-05-2010 12:24 PM

How to enter network directory from console?
 
In GNU/Linux to GNU/Linux? For example there is some Samba-shared dir on Linux machine. And I wanna enter that dir from another Linux machine using Terminal or Virtual Console. In Windows it would start (if I'm not wrong) with "\\...". Then a machne name and so on. But if I wanna do it in Linux, I personally only can use Gnome DE with its network...

So help me please on this.

AlucardZero 06-05-2010 12:42 PM

smbmount

marozsas 06-05-2010 02:37 PM

also, smbclient !

As AlucardZero suggested, you can mount a share somewhere (lets say, /home/mr.alex/mnt) and from there, change dir to ~/mnt and use any filesystem-based command on the remote share.

or...you can use smbclient to browse the remote dir and remove, rename, copy files to or from the remote share without mounting it.

Code:

miguel@babylon5:~$ smbclient //server/Temp -U anAccountOntheShare%myPassOnTheShare
Domain=[MYDOMAIN] OS=[Unix] Server=[Samba 3.0.33-3.15.el5_4.1]
smb: \> cd Dir1
smb: \Dir1\> ls
  .                                  D        0  Thu May 27 15:12:02 2010
  ..                                  D        0  Mon May 24 09:15:18 2010
  pv_report_v5.py                    A    5424  Thu Mar 18 14:02:47 2010
  RS130.pdf                          A    79092  Mon May  3 16:41:09 2010
...
  eth0_sa_spike.txt                        6119  Fri Feb 26 15:15:03 2010
  pv_report_v6.py                          6861  Mon Mar 29 17:01:59 2010
  io_sa.png                                12016  Fri Feb 26 11:23:21 2010

                49530 blocks of size 8388608. 24278 blocks available
smb: \Dir1\> get io_sa.png
getting file \Dir1\io_sa.png of size 12016 as io_sa.png (469,4 KiloBytes/sec) (average 469,4 KiloBytes/sec)
smb: \Dir1\> quit
miguel@babylon5:~$

smbclient does not need to be an interactive command like above. It can read the standard input from a pipe, which means you can use it even in a script, something like "cat commands.txt | smclient //server/share "

Check the man page to learn what commands you can use with smbclient.


All times are GMT -5. The time now is 10:20 AM.