📄 linux选修课讲义台大计中unix讲义.htm
字号:
yppasswd change your password
man <name> see the manual page of <name>
who who is logged in on the system
whoami display the effective current username
w who is logged in, and what are they doing
groups <username> show the user's group name
quota -v <username> show the quota limited on user
du disply disk usage
pwd print working directory name
cd <dirname> change directory to another directory
cd change directory to your home directory
ls list the contents of a directory
options:
-a list all entries
-l list in long format
-g show the group ownership
-R recursively list subdirectories encoutered
-F mark directories with '/', executable files
with '*'
<eg> ls -al
ls -lF
cat <filename> catenate and display a file
more <filename> display a file page by page
echo display a string
<eg> %echo Hello World
Hello World
%
cp <file1> <file2> copy files
rm <filename> remove a file
rm -r <dirname> recursively remove a directory
mv <filename> <newname> rename a file (directory)
mv <filename> <dirname> move a file to the directory
mkdir <dirname> creat a new directory
rmdir <dirname> remove an empty directory
ln <filename> link a file
option: -s symbolic link
chmod <Mode> <filename> change the permission mode of file
absolute:400 read by owner
200 write by owner
100 execute by owner
040 read by group
020 write by group
010 execute by group
004 read by others
002 write by others
001 execute by others
symbolic:u user(owner)
g group
o others
a all
r read access
w write access
x execute access
<eg> chmod 777 test.1
chmod a+r,a+x,a+w test.1
sort <filename> sort a file
talk <username>[@<hostname>] talk with other
mesg [y/n] allow others to talk to you
history list your used commands
jobs list of background jobs
kill terminate process
<eg> %kill -9 -1 //kill all processes
%kill -9 1234 //kill process #1234
ps listing your process
<eg> %ps
PID TTY TIME COMMAND
3211 p0 0:00 - (csh)
1568 p0 0:00 ps
3456 p0 0:01 vi /tmp/snd.3476
3455 p0 0:01 elm
%kill -9 3456
%ps
PID TTY TIME COMMAND
3211 p0 0:00 - (csh)
1570 p0 0:00 ps
3455 p0 0:01 elm
using floppy:
mdir list msdos disk
mcopy a:dosfile unixfile transfer files from/to floppy
mcopy unixfile a:dosfile
mdel a:dosfile delete floppy files
eject eject floppy files disk
附录B A very brief look at Unix history
Unix history goes back to 1969 and the famous "little-used PDP-7
in a corner" on which Ken Thompson, Dennis Ritchie (the R in K&R)
and others started work on what was to become Unix. The name
"Unix" was intended as a pun on Multics (and was written "Unics"
at first -- UNiplexed Information and Computing System).
For the first 10 years, Unix development was essentially confined
to Bell Labs. These initial versions were labeled "Version n" or
"Nth Edition" (of the manuals), and were for DEC's PDP-11 (16
bits) and later VAXen (32 bits). Some significant versions
include:
V1 (1971): 1st Unix version, in assembler on a PDP-11/20.
Included file system, fork(), roff, ed. Was used as a text
processing tool for preparation of patents. Pipe() appeared
first in V2!
V4 (1973): Rewritten in C, which is probably the most
significant event in this OS's history: it means Unix can be
ported to a new hardware in months, and changes are easy. The
C language was originally designed for the Unix operating
system, and hence there is a strong synergy between C and Unix.
V6 (1975): First version of Unix widely available outside
Bell Labs (esp. in universities). This was also the start of
Unix diversity and popularity. 1.xBSD (PDP-11) was derived
from this version. J. Lions published "A commentary on the
Unix Operating System" based on V6.
V7 (1979): For many, this is the "last true Unix", an
"improvement over all preceding and following Unices"
[Bourne]. It included full K&R C, uucp, Bourne shell. V7 was
ported to the VAX as 32V. The V7 kernel was a mere 40
Kbytes!
These Vn versions were developed by the Computer Research Group
(CRG) of Bell Labs. Another group, the Unix System Group (USG),
was responsible for support. A third group at Bell Labs was also
involved in Unix development, the Programmer's WorkBench (PWB),
to which we owe, for example, sccs, named pipes and other
important ideas. Both groups were merged into Unix System
Development Lab in 1983.
Work on Unix continued at Bell Labs in the 1980s. The V series
was further developed by the CRG (Stroustrup mentions V10 in the
2nd edition of his book on C++), but we don't seem to hear much
about this otherwise. The company now responsible for Unix
(System V) is called Unix System Laboratories (USL) and is
majority-owned by AT&T. Novell has bought USL (early 93)?!
But much happened to Unix outside AT&T, especially at Berkeley
(where the other major flavor comes from). Vendors (esp. of
workstations) also contributed much (e.g. Sun's NFS).
The book "Life with Unix" by Don Libes and Sandy Ressler is
fascinating reading for anyone interested in Unix, and covers a
lot of the history, interactions, etc.. Much in the present
section is summarized from this book.
--
☆ [Origin: ◎椰林风情◎] [From: woju.g1.ntu.edu.tw ] [Login: **] [Post: **]
</PRE></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -