If for example we wanted to make i subdirictory called foo
in Linux or UNIX it you use
mkdir foo
to change into it you would use
CD foo
to remove the directory
rmdir foo
but this will only work if the directory is empty
to remove the directory called foo when it is not empty use
rm -rf foo
but please be sure this is what you really want to do.
Mkdir command creates a subdirectory under a directory (MD creates a directory) . The command Chdir changes the current Default directory(CD changes the current directory). The Rmdir removes the subdirectory(RD removes a directory).
The command pwd displays your current/present working directory.
Use the following command: cd .. The ".." indicates the parent of the current directory
1. The most straightforward way to create a create a subdirectory in the current directory is mkdir name where name is the name of the new directory. 2. Another way is to move a directory and its descendants from somewhere else: mv path name where path is an absolute or relative pathname for an existing directory hierarchy, and name is the directory name it will be given in the current directory. 3. Various utilities for unpacking archives may create directories as they execute; for example cpio, tar, unzip etc.
It is the path as relative to the topmost directory, /. For example, /usr/bin is absolute, but ../bin is relative (Means "the directory 'bin' in the parent of the current directory.")
dir
cd 'cd dirname' (without the quotes) takes you to a directory named dirname if it exists in your current location. 'cd..' takes you up one position to the parent directory to the one you're in now. 'cd\' takes you all the way back to the root directory of the current drive (like c . You can navigate a complete path in one command. For instance, if you wanted to get to the directory named files that was in one named main which was in one named top, you could type: cd\top\main\files then if you typed: cd.. you would end up in the 'main' subdirectory.
CD /
All you need is the PWD(Print Working Directory) command, this will list your current directory absolute path All you need is the PWD(Print Working Directory) command, this will list your current directory absolute path
The command 'pwd' will identify the full path of the present working directory.
cd dirReplace "dir" with the name of your directory.
./sampleprog