Documente Academic
Documente Profesional
Documente Cultură
cat myfile
To display the contents of a file, one screen at a time, at the UNIX prompt, typ
e
more filename
replacing filename with the name of the file. To see the next screen of text, pr
ess the SPACEBAR key. To quit, press the Q key. To display a list of commands, p
ress the H key.
Just a "nice to know". If you have an id in UNIX and want to know who it belon
gs to, you can do a "finger" command on the id. (see below in red). If you hav
e a name, and need to know what his UNIX id is, you can do a "finger" command on
his/her name (see below in blue). It comes in handy occasionally, Linda
zlw0008@c3f1n2:/home/zlw0008-> finger ymz0001
Login name: ymz0001 In real life: Maury Zuber
Directory: /home/ymz0001 Shell: /usr/bin/ksh
On since Sep 17 07:34:04 on pts/6 from 172.18.181.99
7 minutes 20 seconds Idle Time
Mail last read Fri Jul 20 06:33:56 2001
No Plan.
--
Change owner(chown
)cchown ranga: /home/httpd/html/users/ranga
changes the owner of the given directory to the user ranga.
----
ftp to connect to a remote machine,
----
how to check the number of instances running on a box:
pmon
--------
EVery process is assigned a unique 5 digit id called process id (PID)
if the number gets exhausted it rolls over...
------
Ctrl+Z - suspend the foreground process
for more details:
determine which key performs which function by using the stty command. By enteri
ng
$ stty -a
----------
an exit status of 0 is successful, whereas nonzero values indicate some type of
failure. The exit status of the last command is stored in the variable $?, so yo
u can check whether a command was successful as follows:
if [ $? -eq 0 ] ; then
echo "Command was successful." ;
else
echo "An error was encountered."
exit
fi
If the command exits with an exit code of 0, issue the "good" message; otherwise
, issue an error message and then exit. This can be simplified as follows:
if [ $? -ne 0 ] ; then
echo "An error was encountered."
exit
fi
echo "Command was successful."
Here you check to see whether the command failed. If so, you echo an error messa
ge and exit: otherwise, the if statement completes and the "good" message is iss
ued. This is slightly more efficient than using an else clause.
-----------