Linux 4 Windows
Learn And Run Linux On Your Windows Computer

This Linux 4 Windows Tutorial shows you how to copy text files back and forth between Damn Small Linux and Microsoft Windows. It introduces the smbclient command.

Damn Small Linux - Windows File Copy

This tutorial shows you how to copy text files back and forth between Damn Small Linux and Microsoft Windows. You may choose to review our previous tutorials before doing this one. You don't have to do the tutorials in order. Do this one only when you feel that you need to save your Linux files to Windows or to access files saved in Windows.

This fairly long, somewhat complicated procedure is worth doing. Once you have mastered it you can save your Linux files in Microsoft Windows folders and get them back. Remember, Linux distinguishes between capital letters and lower case letters. Get in the habit of doing so yourself, even on the Windows side of the fence.

Efficiency tip. To repeat Linux commands press the up arrow key one or more times. Linux places you at the end of the command. You can press the left arrow or the Backspace key and modify the command before reentering it.


We will start by setting things up in Windows before moving on to Linux. I ran this tutorial on my Windows XP computer and have verified it in Windows Vista. You may need help for other versions of Windows.

Step 1 You will need your computer’s IP Address. (Don’t worry if you don’t know what that means.) Click the Windows Start button and then Run. In the ensuing box type cmd and click the OK button. Windows displays a box with a black background. Type ipconfig and press the Enter key. Windows responds with one or more IP Addresses such as 145.104.131.1. Write them down, you will need them later. (I have changed my IP Address here for security reasons. Frankly, you don’t need to know my IP Address to transfer files back and forth between Linux and Windows on your computer.) The modified results of the ipconfig command are shown in Figure 1.

Linux Windows File Copy Tutorial Figure 1

Damn Small Linux Windows File Copy Tutorial Figure 1.
Use the ipconfig command to find your IP address, surely different from mine.


Step 2 Create a folder called TF on the Windows desktop that will contain the copied Linux files. Right-click on the folder and click on Sharing and Security. In the Network sharing and security area check both boxes (Share this folder on the network and Allow network users to change my files). Click OK. The hand underneath the TF folder indicates that your Windows folder is shareable. The Windows XP window for this file is shown in Figure 2.

Linux Windows File Copy Tutorial Figure 2

Damn Small Linux Windows File Copy Tutorial Figure 2.
Windows XP Sharing Window


Step 3 Start Linux. Click the letters DSL in the lower left corner of the screen. Access the Beaver text editor as previously. Click the File menu and select New. Enter some simple text such as that good old programming favorite – Hello World followed by the Enter key.
Step 4 Click the File menu and then the Save Option. The top of the screen reads Save “Untitled 1” As… Name the file by entering LWFile in Selection box at the bottom of the screen and click OK. Then close the Beaver text editor.
Step 5 Go into XShells and select Light. Enter the command ls and see if the file is there. If it is enter cat LWFile to verify its contents. Now we are ready to transfer the file to the Window folder.
Step 6 Enter the smbclient command as follows: (replace 145.104.131.1 by your IP address as found in Step 1)

smbclient //145.104.131.1 /TF –U dsl The results with my camouflaged IP Address are shown in Figure 3.

Linux Windows File Copy Tutorial Figure 3

Damn Small Linux Windows File Copy Tutorial Figure 3.
Making the connection to Windows


Step 7 Enter dsl when the Password is requested.
Step 8 You are now communicating with the smbclient command as shown by the smb: \> prompt. Because you are no longer in the general Linux area the grammar rules may be different. Enter put LWFile to copy the file into the Windows folder. (We blanked out the smbclient command to hide our IP Addresss.) The results of my misspelling and the proper command are shown in Figure 4.

Linux Windows File Copy Tutorial Figure 4

Damn Small Linux Windows File Copy Tutorial Figure 4.
Copying the LWFile file, spell its name right.


Step 9 Go into your Windows folder and you should find the file as shown in Figure 5.

Linux Windows File Copy Tutorial Figure 5

Damn Small Linux Windows File Copy Tutorial Figure 5.
The LWFile file is now copied into Windows.


Step 10 Open the LWFile file with Notepad, add a line to it, press the Enter key, save the file, and close Notepad.


Step 11 Go back to Linux (the QEMU window). If the screen shows smb: \> simply type get LWFile, otherwise repeat Steps 6 and 7 before replacing Step 8 with get LWFile.
Step 12 Type exit to return to the Linux command line.
Step 13 Type clear to clear the screen.
Step 14 Verify the contents of the modified file (cat command). Our example is shown in Figure 6.

Linux Windows File Copy Tutorial Figure 6

Damn Small Linux Windows File Copy Tutorial Figure 6.
Verifying the modified LWFile in Linux.


Step 15 We’re done. To firm up this procedure first create a file in Windows, modify it in Linux, and then copy it back into Windows. Guess what! Don’t create a Microsoft Word doc file. Linux won’t be able to read it. (Unless you find and install a Linux word processing application that can work with Word Files.)

Conclusion – This tutorial is probably about as complicated as we will be doing, at least for a while. But it can be very important because it enables you to go back and forth between Linux and Windows. This is one way to save your Linux files.