Editing the Unix Tree
Make sure to run all of the copy commands below, as we'll be using files from the Ostrom server later in the course.
mkdirThis command name stands for "make a directory".
It creates a new folder (or directory). If no path is specified, the new directory is created in the current directory.
# start in your home directory
cd ~
# create a directory named "unixclass"
# with a subdirectory named "testdir"
mkdir unixclass
mkdir unixclass/testdir
# change current directory directly to "testdir"
cd unixclass/testdir
# go to the parent directory (i.e. unixclass)
# and print the working directory
cd ..
pwdtouchThis command creates an empty file with the given name.
cpandmvThese commands stand for "copy" and "move," respectively.
They copy / move files and directories to the specified location.
Wildcards symbols such as "*" or "?" are commonly used to copy multiple files with a single command.
The symbol "*" stands for any number of alphanumeric characters.
The symbol "?" stands for a single alphanumeric character.
rmdirandrmrmdironly removes empty directories,rmremoves both directories and files.rmneeds-rflag to remove directories.
Last updated
Was this helpful?
