By specifying either the absolute or relative path to file.
Example 1 (absolute path; works from anywhere):
rm /etc/shadow
Example 2 (relative patch; will only work if you are in /usr):
rm ./bin/vi
Example 3 (relative path; removing file from home directory, works from anywhere):
rm ~/mystuff/importantfile
CD /
When a user logs in to a Unix system, the current working directory normally starts at the directory/file
rmdir
The two links are for the current directory (.) and the parent directory (..). This is allow for easy directory traversal.
the commandrmdir will not remove a directory if it is not empty in UNIX. The correct way to remove a directory and all its contents recursively is with the rmcommand.
The '.' refers to the current directory that you are working in, and the '..' refers to its parent (i.e. the directory just above the one you are now in).
Root directory.
Use the 'du' command in the directory you are interested in.
find -type f | wc -l
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.
If you are just removing the directory, use the command: rmdir dir-name The dir-name directory has to be empty for this to work. If there are files or other subdirectories then use the command: rm -rf dir-name
cp - copy a file rm - delete a file mv - rename a file mkdir - create a directory rmdir - remove a directory etc...