Shell and DoC Systems, Lab 1
The Linux Terminal and Scientia
Chapter 3: Copying, Moving, Removing
Make empty directories and files
At the end of Exercise 5, we saw mkdir
. This makes a new, empty
directory.
Now, ensure you’re in your home directory, and then use mkdir
to make a new
directory, modules
, in your ~
.
username@MACHINE:~$ mkdir modules
Now check that this has had the desired effect using:
username@MACHINE:~$ ls -l
Let’s make a sub-directory of modules
, shell
, and then move into it.
username@MACHINE:~$ mkdir modules/shell
username@MACHINE:~$ cd modules/shell
(Notice how we made a nested subdirectory by using the relative pathname.)
To make a new, empty file, use touch
.
username@MACHINE:shell$ touch empty_file.txt
username@MACHINE:shell$ ls -l
total 0
-rw-r--r-- 1 username mai 0 Aug 18 13:12 empty_file.txt
Exercise 6
- Change to the parent of
/homes/username/modules/shell
using..
- Make a subdirectory of the
shell
directory callednotes
, from where you are now. - Put an empty file in
shell/notes
, calledcommands.txt