![]() The file directory could also have been created using a full path however all the previous directories must already exist. Directories can be created either singularly (in which case all directories above it must already exist) or several at a time allowing parent directories to be created at the same time.Ĭreating a single directory from the current directory is done by mkdir followed by the name of the new directory. New directories can be created using the mkdir command. ![]() The -l option is used to give more information, including: permissions owner, and owning group file size and date last modified in addition to the filename. ![]() Typing ls on it's own will list all the files and directories contained within the current directory. The ls command can be used to list the contents of a directory. The $OLDPWD variable is useful if you want to move back to the directory you were at previously.Ĭd $OLDPWD Listing the Contents of a Directory (ls) To view the current working directory you can view the $PWD variable, and to view the previous directory there is the variable $OLDPWD. There are also two shell variables that are normally set. The pwd (print working directory) command will return the name of your current directory. ![]() When moving around the directory structure it's easy to forget where you are. To change directory use cd followed by either the absolute or relative directory. You can move around the directories by using the cd (change directory command). This is normally /home/username (for username stewart that will be /home/stewart). When first logging onto a UNIX system you will normally be in your "home" directory. These are command-line programs that can often be used together by using pipelines or redirects (see the Command Basics Reference Guide). The guide lists some of the useful commands.
0 Comments
Leave a Reply. |