Linux 4 Windows
Learn And Run Linux On Your Windows Computer

This Linux 4 Windows Tutorial gets you started with Damn Small Linux files on your Windows computer. You will use the Beaver text editor and apply the pwd, ls, cat, and clear commands.

Getting Started With Damn Small Linux Files

This tutorial shows you some of the basics of creating and processing Damn Small Linux files. Because it is an initial tutorial we will repeat how to do some simple things such as starting Linux that will soon become second nature. You may want to read the articles entitled Ten Important Linux Concepts For Beginners - Number 1, Files and Ten Important Linux Concepts For Beginners - Number 2, Directories before you start clicking. Just in case you forgot, you will often need to press the Ctrl-Alt keys to navigate from one window to another.


Step 1 Start Linux (by double-clicking on the dsl-base.bat file or dsl-base file in the Damn Small Linux folder on your Windows desktop.)

Step 2 Dismiss the Dillo: Getting Started With DSL window.

Step 3 Click the DSL button in the lower-left hand corner of the Linux window (entitled QEMU) and select Light from the XShells menu.

Step 4 To determine the current directory type in pwd command followed by the Enter key. Linux responds that the current directory is /home/dsl and then awaits your next command. Open the DSLFolder and double-click on the dsl-base.bat file (the bat extension may or may not be visible depending on your Windows settings.) You will see Damn Small Linux unfold before your eyes. Your Linux window is shown in Figure 1.

Linux file tutorial 1 Figure 1

Damn Small Linux File Tutorial 1 Figure 1
The pwd command shows where we are.



Step 5 Enter the ls command which lists the contents of the current directory, which presently contains one file named Events.cal. The results are shown in Figure 2.

Linux file tutorial 1 Figure 2

Damn Small Linux File Tutorial 1 Figure 2
The ls command lists our files.



Step 6 Now we are going to create a simple file. Click on the DSL button, open the Apps menu, open the Editors menu, and then choose the file editor Beaver shown in Figure 3.

Linux file tutorial 1 Figure 3

Damn Small Linux File Tutorial 1 Figure 3
The Beaver text editor.



Step 7 Click Beaver’s File menu and then New. Then type the following text: My first Damn Small Linux file. From the File menu click Save or Save As. In the Selection box at the bottom of the Save As box type the following /home/dsl/File1.txt followed by the Enter key as shown in Figure 4.

Linux file tutorial 1 Figure 4

Damn Small Linux File Tutorial 1 Figure 4
Saving the file.



Step 8 When you are sure of your spelling, click OK and close the Beaver file editor. If necessary reopen the Bash command box as in Step 3. You can always clear this box by entering the clear command. Enter the ls command. Your file list now includes the File1.txt file.

Step 9 Type cat File1.txt to obtain the contents of the File1.txt file. The results are shown in Figure 5.

Linux file tutorial 1 Figure 5

Damn Small Linux File Tutorial 1 Figure 5
The cat command shows the file contents.



Step 10 Return to the Beaver editor, access the File menu and then click Open. Notice that File1.txt is now available. The results are shown in Figure 6.

Linux file tutorial 1 Figure 6

Damn Small Linux File Tutorial 1 Figure 6
Beaver is ready to edit the file.







If your eyes are sharp you noticed that the Selection box at the bottom of the Open File window contains /ramdisk/home/dsl and not /home/dsl. Don’t worry, thanks to a special Linux feature (inodes) these two directories are essentially the same. Because this is an intermediate-level feature we won’t be discussing it for quite some time.

Exercises. It’s always a good idea to test your understanding by taking the tutorial a few steps further. The first thing to do is to modify your File1.txt file and save it under a different name. Another worthwhile exercise is to practice switching directories in Beaver’s Open File window. Why not see if the /ramdisk/home/dsl directory really has the same contents as the /home/dsl directory?

At this point we don’t have any way to save Linux files. Once you close Damn Small Linux your File1.txt file disappears. Soon we will provide tutorials that enable you to save Linux files.