File and Directory Commands
-
cd: change the directory. Same as DOS.
-
cd .www changes from your home directory to your .www (HTML) directory.
-
cd .www/cgi-bin channges from your home directory to your cgi-bin
(Perl/CGI) directory.
-
pwd: - tells you where you are; present working
directory. Not your password!
-
ls: lists the directory contents. Similar
to dir command in DOS.
-
ls -l: also tells you premissions, modification date, user group,
etc. Similar to View - Show Details in Windows Explorer.
-
The -l is a flag for the ls command. Many Unix commands
have these. They are additional options for the command.
-
rm filename: removes (deletes) a file.
similar to del in DOS.
-
filename is the name of a file in the current directory, or a
file in another directory with that directory's relative or absolute filename
specified.
-
Can use * as a wildcard.
-
mkdir path: makes a directory named
path (whatever you choose to put where I put path).
-
rmdir path: removes a directory named
path.
-
.. (two periods): The previous directory, relative to the
current path.
-
Examples:
-
You are in .www/cgi-bin, and you want to delete the file called test.txt
in .www. You would type:
rm ../test.txt
-
You are in .www, and you want to delete the file called test.txt in .www/cgi-bin.
You would type:
rm cgi-bin/test.txt
Alternatively,
cd cgi-bin
rm test.txt
-
Demonstration
On To Pico!
Home