Text Manipulation

Get introduced to text manipulation, creating files within the server, and the default editor that enables the writing of those files.

Introduction to text manipulation

This lesson introduces multiple ways of manipulating text in files. We will also be looking into file and folder creation.

Creating files and folders

We can create a folder using mkdir, which is a utility for the creation of directories in the Linux system. Simply provide a name for the new directory with mkdir, and we’re good to go.

We can use the touch command for file creation, though it can also be used to modify the timestamps of files and directories. Again, we simply provide the name and extension for the file we’d like to create.

The terminal below shows how we create a new folder called world and then create a text file inside it called hello.txt.

Terminal 1
Terminal
Loading...

Removing files and folders

We can remove files and folders with the rm command. To remove individual files, simply provide their name with the command. Removing folders is slightly trickier; empty folders require the -d option, while non-empty folders require the -r option. The latter option recursively removes ...