ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzahz_5.4.0.1/tututil.htm

95 lines
4.3 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<meta name="generator" content="HTML Tidy, see www.w3.org">
<meta http-equiv="Content-Type" content=
"text/html; charset=utf-8">
<title>Qshell utility features</title>
<LINK rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</HEAD>
<body bgcolor="#FFFFFF">
<!-- Java sync-link -->
<SCRIPT LANGUAGE="Javascript" SRC="../rzahg/synch.js" TYPE="text/javascript"></SCRIPT>
<p></p>
<h2>Qshell utility features</h2>
<p>
There are over 100 utilities provided with Qshell that provide many functions. A utility is one of two types:
<ul>
<li>A <a href="simpcmds.htm#builtin">built-in utility</a> is one qsh can run directly without having to search for it. It runs in the same process as the shell interpreter.</li>
<li>A <a href="simpcmds.htm#regular">regular utility</a> is a separate program object that qsh finds by searching for it. It runs in a new process started by the shell interpreter.</li>
</ul>
<p>
A Qshell utility has the following format. The square brackets indicate something that is optionally specified.</p>
<p><pre>
utility [ options ] [ parameters ]
</pre>
<p>
Some utilities allow single letter options preceded by a minus sign (-). For example, several utilities use the -r option for recursively working on a directory tree. More than one option can be specified and all options must be specified before any parameters. If a parameter begins with a minus sign, you can use the -- option to indicate the end of options. For example, in the command line
<p><pre>
utility -r -- -1
</pre>
<p>
the -1 is treated as a parameter because the -- marked the end of the options.</p>
<p><strong>Navigating in the Integrated File System</strong></p>
<p>
When navigating in the Integrated File System, you always have a current working directory. If a file or directory is specified without a leading slash (/), it is assumed to be in the current working directory.</p>
<p>
You can change the current working directory with the <a href="cd.htm">cd</a> utility. For example to change the current working directory to /usr/bin, use this command:
<p><pre>
cd /usr/bin
</pre>
<p>
You can display your current working directory with either the <a href="pwd.htm">pwd</a> or <a href="pwdx.htm">pwdx</a> utilities. The <strong>pwdx</strong> utility resolves symbolic links and displays the absolute current working directory.</p>
<p>
You can list the contents of a directory with the <a href="ls.htm">ls</a> utility. With no parameters, <strong>ls</strong> lists the contents of the current working directory. You can also specify one or more directories as parameters. With the -l (lowercase ell) option, <strong>ls</strong> lists detailed information about each object in the directory, including the permissions for the object, the owner and group of the object, the size of the object, and the date that the object was last accessed.</p>
<p><strong>Working with files and directories</strong></p>
<p>
You can create a new directory with the <a href="mkdir.htm">mkdir</a> utility. When the -p option is specified, <strong>mkdir</strong> creates all of the directories in the path. For example, to create the new directories &quot;/fruits&quot; and &quot;/fruits/pears&quot;, use this command:
<p><pre>
mkdir -p /fruits/pears
</pre>
<p>
You can copy files with the <a href="cp.htm">cp</a> utility. For example, to copy the file &quot;/fruits/apples/delicious&quot; to the file &quot;/fruits/apples/grannysmith&quot;, use this command:
<p><pre>
cp /fruits/apples/delicious /fruits/apples/grannysmith
</pre>
<p>
You can rename or move objects with the <a href="mv.htm">mv</a> utility. For example, to move the file orange in the current directory to the file &quot;tangerine&quot; in the &quot;/fruits&quot; directory, use this command:
<p><pre>
mv orange /fruits/tangerine
</pre>
<p>
You can delete an object with the <a href="rm.htm">rm</a> utility and delete a directory with the <a href="rmdir.htm">rmdir</a> utility. When the -r option is specified, <strong>rm</strong> recursively deletes all of the objects in a directory tree. This is an easy way to delete a large number of objects with one command. For example, to delete all of the files and directories in the &quot;/fruits&quot; directory tree, use this command:
<p><pre>
rm -r /fruits
</pre>
<p></p>
</body>
</html>