mkdir qe
Files and Directories
Let’s create a new directory called thesis using the command mkdir QE
(which has no output):
As you might guess from its name, mkdir
means “make directory”. Since qe
is a relative path (i.e., doesn’t have a leading slash), the new directory is created in the current working directory:
Since we’ve just created the qe
directory, there’s nothing in it yet:
-F qe ls
ls: qe: No such file or directory
Moving Files Around
We can move our new file into the new directory with the move command, mv. The syntax of mv is $ mv file_being_moved location_moving_to. Moving our new file “QE” to our new directory “qe” can be done as follows:
mv qe QE
mv: rename qe to QE: No such file or directory
$ cd QE
Let’s change our working directory to QE
using cd
, then run a text editor called vi
to create a file called si.in
:
in $ vi si.
Which Editor?
Text editors can be used for writing code, editing text files such as configuration files, creating user instruction files, and many more. In Linux, text editors are of two kinds that is the graphical user interface (GUI) and command-line text editors (console or terminal).
Vi/Vim Editor
Vim is a powerful command-line based text editor that has enhanced the functionalities of the old Unix Vi text editor. It is one the most popular and widely used text editors among System Administrators and programmers that is why many users often refer to it as a programmer’s editor.
Creating Files in Different way
We have seen how to create text files using the vi/vim
editor. Now, try the following command in your home directory:
/si.out touch QE
Copying Files
We can also copy files, leaving the original file while a second version is created either elsewhere or in the same location. The copy command is cp and its syntax is the same as for mv: $ cp file_being_copied location_copying_to. We can create a copy of “QE” into “qe” directory as follows:
cp QE qe
cp: QE: No such file or directory
Removing Files and Directories
If we try to remove the entire thesis directory using rm QE
, we get an error message:
rm QE