Escolar Documentos
Profissional Documentos
Cultura Documentos
What is UNIX ?
Today, many variety exsit in market, Solaris has the leading share.
* Stability
* Advanced security
* Kernel : The kernel is the core of the UNIX operating system. Basically,
the kernel is a large program that is loaded into memory when the machine is
turned on, and it controls the allocation of hardware resources.
* Shell : The shell is a type of program called an interpreter. The shell is a program
that the UNIX kernel runs for you. A program is referred to as a process
while the kernel is running it.
ls /usr
ls l /usr
ls al /usr
ls lrt /usr
pwd
cd ../
cd
cd
cd /u*
cd /u*/f*
File Types
l A link
m Shared memory
p A named pipe
s A semaphore
File Permissions
grep x <file>
cat <file> |grep x
grep i <file>
grep h <file>
cat <file> |grep v x
Cp : cp fx ../
cp p fx ../
Mv : mv fx ../
Rm : rm fx
Rmdir : rmdir dx
Mkdir : mkdir dx
Tar : tar cvf file.tar ./dx
tar xvf file.tar .
Compress : compress fx
Uncompress : uncompress fx.Z
Basic Commands (II)
Wc : Word Count
wc l /etc/passwd
wc /etc/passwd
Df : How full is a file system?
df h .
Du : Shows disk usage
du -ks
Find : find /usr -name x -type f print
Head : head -15 /etc/rc
Tail : tail /etc/rc
tail f /etc/rc
Cat : cat fx
More : more fx
Gzip : gzip fx
Gunzip : gunzip fx.gz
Gzcat : gzcat fx.gz
Sort : sort fx > fx2
sort u fx > fx2
Diff : diff <file1> <file2>
Sed : sed n <st1>, <st2>p <file>
Redirecting Input & Output
Every program you run from the shell opens three files:
Standard input, standard output, and standard error.
A program can be told where to look for input and where to send output,
using input/output redirection.
UNIX uses the "less than" and "greater than" special characters (< and >) to signify
input and output redirection, respectively.
UNIX allows you to connect processes, by letting the standard output of one process
feed into the standard input of another process. That mechanism is called a pipe.
ps
ps ef
ps ef |grep bch |wc l
kill <pid>
kill -9 <pid>
ls > fx
ls > fx &
nohup ls > fx &
Execution Environment
printenv
echo $TERM
cat .profile
Very Nice Text Editor
vi fx
More
for k in ls */*/*
do
mv $k $k.gz
done
for a in `ls`
do
b=`echo $a|awk -F">" '{print $1}'`
mv ${b}* $b
done