Linux 4 Windows
Learn And Run Linux On Your Windows Computer

This Linux 4 Windows Tutorial lets you list and process Damn Small Linux files on your Windows computer. You will use the Beaver text editor and apply the ls, and rm commands and the ? and * wildcards.

Selecting And Deleting Damn Small Linux Files

This tutorial shows you some of the basics of selecting and deleting Damn Small Linux files.


Step 1 Start Linux as in the previous tutorials.

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



Step 3 Access the Beaver Editor (via Apps and then Editors) and create four files with the following names: File1.txt, File11.txt, File12.txt, and File12 (there's no .txt at the end of the last file name.) Each file should have simple but not misleading contents as shown in Figure 1.

Linux file tutorial 2 Figure 1

Damn Small Linux File Tutorial 2 Figure 1
The last of four new files.



Step 4 Dismiss the Beaver window by clicking on the x in the upper-right hand corner. We won't be using Beaver again in the body of this tutorial.

Step 5 Enter one at a time the following two commands in the Bash window. Separate each one by pressing the Enter key. ls and ls *.*. The first command lists all the files. The second command list all files that have an extension, part of their file name after the ., the File12 file is not selected. The results are shown in Figure 2.

Linux file tutorial 2 Figure 2

Damn Small Linux File Tutorial 2 Figure 2
The * selects all.



Step 6 Enter the clear command to clear the Bash window. (This command is very useful; clear the Bash window frequently. Enter the ls *.txt command. This selects only those files with the txt extension. It doesn't select the Events.cal file. The results are shown in Figure 3.

Linux file tutorial 2 Figure 3

Damn Small Linux File tutorial 2 Figure 3
Selecting the txt extension.



Step 7 The ? wildcard selects a character at a time. First we'll try one, then we'll try two. Enter the ls File?.txt command. Next enter the ls File??.txt command. The results are shown in Figure 4

Linux file tutorial 2 Figure 4

Damn Small Linux File tutorial 2 Figure 4
Applying the ? wildcard.



Step 8 The wildcards work for most commands; sometimes in an intuitive manner and sometimes not. Our last activity in this tutorial involves the rm command which removes (deletes) one or more files. It's a good idea to use the ls command before using the rm command. There is no unremove command. We reissue the ls command to prove that the files were really deleted. The results are shown in Figure 5

Linux file tutorial 2 Figure 5

Damn Small Linux File tutorial 2 Figure 5
The rm command removes selected files.







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 create several additional files and see if the ? wildcard works in the file extension. Try to become more efficient with the Beaver text editor by using the Copy and Paste keys Ctrl-C and Ctrl-V keys.

At this point we still don’t have any way to save Linux files. Once you close Damn Small Linux your files disappear. So we are going to provide tutorials that enable you to save Linux files, either to a USB pen drive and alternatively into your Windows system. They are rather intricate, but are well worth following.