Difference between pages "User:ThorstenStaerk" and "Copy files between Linux and Windows"

From Linuxintro
(Difference between pages)
imported>ThorstenStaerk
 
imported>ThorstenStaerk
 
Line 1: Line 1:
This is the user page of Thorsten. Nothing [http://www.linuxintro.org/index.php?title=User:ThorstenStaerk here]. Better go [http://www.staerk.de/thorsten there].
+
This describes how to copy files over the [[network]] between a computer (or [[virtual machine]]) running Windows and another computer (or virtual machine) running Linux.
  
= Lego mindstorm =
+
There is also an article how to [[ntfs|access a Windows partition when running Linux]]. You may need this if your computer is running only one [http://en.wikipedia.org/wiki/Operating_system operating system] and having two [[hard disk]] partitions.
Here are my notes for writing an article on Lego Mindstorm:
 
http://linux.softpedia.com/progDownload/LEGO-RCX-Download-46173.html
 
http://tldp.org/HOWTO/Lego/index.html
 
  
= wiki2mindmap =
+
= You are on a Linux host =
<pre>
 
#!/bin/bash                                                                                                                                   
 
wget http://www.linuxintro.org/wiki/Special:Allpages                                                                                           
 
cat >spider<<EOF                                                                                                                               
 
#!/usr/bin/perl                                                                                                                               
 
require HTML::LinkExtor;                                                                                                                       
 
\$p = HTML::LinkExtor->new(\&parse, "");                                                                                                       
 
sub parse {                                                                                                                                   
 
    my(\$tag, %links) = @_;                                                                                                                   
 
    my (\$att, \$url) = @{[%links]};                                                                                                           
 
    print "\$url\
 
";                                                                                                                           
 
}                                                                                                                                             
 
\$p->parse_file(\$ARGV[0]);                                                                                                                   
 
EOF                                                                                                                                           
 
chmod 777 spider                                                                                                                               
 
  
./spider Special\:Allpages | \
+
== You want to access a Windows drive ==
grep "^/" | \               
+
So you are on a Linux computer and want to access a Windows drive over the network. In this example we assume ''winhost'' is your Windows computer's hostname (you can check the hostname by right clicking on My Computer and selecting Properties). Go to the Windows computer and open the Explorer. Share a folder by right-clicking onto it and selecting "Sharing and security". Call it "share1". Then, on your Linux computer,
grep -v ":" | \             
 
grep -v "?" | \             
 
while read a
 
  do wget "http://www.linuxintro.org/$a"
 
done
 
  
for file in $(ls --ignore="*:*")
+
* Open up your favorite file explorer, perhaps Konqueror or Nautilus
do ./spider $file | \
+
* In the address bar, type ''smb://winhost/share1''
  grep "^/" | \
+
* You should now see the files and folders in that share. Double-click on them to open them up and view them.
  grep -v ":" | \
 
  grep -v "?" | \
 
  grep -v "Main_Page" | \
 
  grep -v "Feedback" | \
 
  grep -v "/Contribute$" | \
 
  grep -v "^/Projects$" | \
 
  grep -v "^/Development$" | \
 
  grep -v "^/Policies$" | \
 
  grep -v "^/Projects$" | \
 
  grep -v "^/Projects/NamingTheWiki$" | \
 
  grep -v "^/Schedules$" | \
 
  grep -v "^/favicon.ico$" | \
 
  grep -v "/opensearch_desc.php$" | \
 
  grep -v "^/$" | \
 
  grep -v ".png$" | \
 
  grep -v "^/Development/Tutorials$" | \
 
  sed "s;^/.*/;;" | \
 
  while read file2
 
  do if [ x"$file" != x"$file2" ]; then echo "\"$file\" -> \"$file2\"" ; fi
 
  done
 
done >datei
 
  
echo "# to create a ps file use 'dot -Tps -o graph.ps graph.dot' (dot it part of the graphviz package)" > graph.dot
+
=== troubleshooting ===
echo "digraph \"Wikimap\" { " >> graph.dot
 
cat datei >>graph.dot
 
echo "}" >> graph.dot
 
  
dot -Tps -o graph.ps graph.dot
+
If that doesn't work, then you may need to do something more complicated.
convert graph.ps graph.jpg
+
 
</pre>
+
* [[install the samba client software]]
 +
* try to find the share:
 +
smbclient -L ''winhost''
 +
* If you see the share, mount it like this:
 +
mount //''winhost''/share1 /mnt/smb
 +
* after the next reboot, your mount will be lost. To make it persistant, add the following line to your /etc/[[fstab]]:
 +
//''winhost''/share1  /mnt/smb smbfs  defaults  0  0
 +
 
 +
== You want to share a folder ==
 +
So you are on a Linux computer and want to share a [[folder]] so that also Windows machines can access it over the [[network]]. To do this, you run the [[SAMBA]] service on your computer. To enable sharing to Windows machines, right click on a folder in Nautilus; the menu should have an item called "Sharing Options". Click it and pick the name for your share. If you don't have Windows folder sharing enabled yet, Nautilus will ask you for a password and install the service, after which you will need to log out and back in. The share should now be available on the Windows computer.
 +
 
 +
See also [[Setting up a Samba Server]].
 +
 
 +
= You are on a Windows host =
 +
 
 +
== You want to access a Linux drive ==
 +
Use [http://www.winscp.com WinSCP]. Choose the SFTP protocol; the login and password are the same as those you use when logging in locally. If it does not work, look at your Linux computer: Try to [[shut down your firewall]] and [[install the openssh service]].
 +
 
 +
== You want to share a folder ==
 +
You can share files with Linux using normal Windows sharing mechanisms. The Linux host will be able to access these files using [[samba]].
 +
 
 +
= See also =
 +
* [[interoperability]]
 +
* [[file sharing]]
 +
* [http://www.linuxquestions.org/questions/linux-networking-3/accessing-windows-shared-folders-in-linux-236735/ "Accessing windows shared folders in linux"]
 +
* [http://forums.fedoraforum.org/showthread.php?t=1641 "Accessing Windows Shared Folders"]
 +
* [http://sathyasays.com/2008/12/15/mounting-accessing-windows-shared-folders-on-linux/ "Mounting & Accessing Windows Shared Folders on Linux"] by Sathya 2008
 +
* [http://lifehacker.com/software/linux-101/mount-a-windows-shared-folder-in-linux-288033.php "Mount a Windows shared folder in Linux"] by Kyle Pott 2007
 +
 
 +
 
 +
[[Category:Guides]]
 +
[[Category:Interoperability]]

Revision as of 08:58, 31 May 2012

This describes how to copy files over the network between a computer (or virtual machine) running Windows and another computer (or virtual machine) running Linux.

There is also an article how to access a Windows partition when running Linux. You may need this if your computer is running only one operating system and having two hard disk partitions.

You are on a Linux host

You want to access a Windows drive

So you are on a Linux computer and want to access a Windows drive over the network. In this example we assume winhost is your Windows computer's hostname (you can check the hostname by right clicking on My Computer and selecting Properties). Go to the Windows computer and open the Explorer. Share a folder by right-clicking onto it and selecting "Sharing and security". Call it "share1". Then, on your Linux computer,

  • Open up your favorite file explorer, perhaps Konqueror or Nautilus
  • In the address bar, type smb://winhost/share1
  • You should now see the files and folders in that share. Double-click on them to open them up and view them.

troubleshooting

If that doesn't work, then you may need to do something more complicated.

smbclient -L winhost
  • If you see the share, mount it like this:
mount //winhost/share1 /mnt/smb
  • after the next reboot, your mount will be lost. To make it persistant, add the following line to your /etc/fstab:
//winhost/share1  /mnt/smb smbfs  defaults  0  0

You want to share a folder

So you are on a Linux computer and want to share a folder so that also Windows machines can access it over the network. To do this, you run the SAMBA service on your computer. To enable sharing to Windows machines, right click on a folder in Nautilus; the menu should have an item called "Sharing Options". Click it and pick the name for your share. If you don't have Windows folder sharing enabled yet, Nautilus will ask you for a password and install the service, after which you will need to log out and back in. The share should now be available on the Windows computer.

See also Setting up a Samba Server.

You are on a Windows host

You want to access a Linux drive

Use WinSCP. Choose the SFTP protocol; the login and password are the same as those you use when logging in locally. If it does not work, look at your Linux computer: Try to shut down your firewall and install the openssh service.

You want to share a folder

You can share files with Linux using normal Windows sharing mechanisms. The Linux host will be able to access these files using samba.

See also