|
|
Unix
Quick Commands
| File
Manipulation |
 |
| Action |
Command |
Example |
| list
file contents |
cat |
cat
myfile |
| append
to a file |
cat |
cat
myfile >>newfile |
| combine
two files |
cat |
cat
myfile1 myfile2 > newfile |
| create
a file |
cat |
cat >newfile |
| copy
a file |
cp |
cp
myfile newfile |
| create
a file |
touch |
touch
newfile |
| move
a file |
mv |
mv
myfile /usr/home/myfile |
| remove
a file |
rm |
rm
myfile |
| Directory
Navigation & Manipulation |
 |
| Action |
Command |
Example |
| change
directory |
cd |
cd
$ORACLE_HOME |
| change
directory -up 1 level |
cd |
cd
.. |
| change
directory -home |
cd |
cd |
| create
directory |
mkdir |
mkdir
mydir |
| remove
directory |
rmdir |
rmdir
mydir |
| current
path |
pwd |
pwd |
| directory
listing |
ls |
ls |
| directory
listing -long |
ls |
ls
-l |
| directory
listing -all/long |
ls |
ls
-al |
| direcoty
listing -all/last created |
ls |
ls-lrt |
| Kilobytes
used in directory |
du |
du
-k mydir |
| Miscellaneous |
 |
| Action |
Command |
Example |
| change password |
passwd |
passwd |
| list processes -owner |
ps |
ps |
| list processes -everyone |
ps |
ps -e |
| list processes -username |
ps |
ps -fu username |
| show
process for sid |
ps |
ps
-ef|grep <sid> |
| show
smon processes |
ps |
ps
-ef|grep smon |
| change access privileges |
chmod |
chmod XXX |
| read/write -owner,group |
chmod |
chmod 660 myfile |
| read/write/execute- owner,group |
chmod |
chmod 770 myfile |
| read -owner,group,world |
chmod |
chmod 444 myfile |
| execute -owner,group |
chmod |
chmod 110 myfile |
| change ownership |
chown |
see access modes |
| default
security for new files |
umask |
umask
023 |
| change group |
newgrp |
newgrp dba |
| who else is logged on |
who |
who |
| who owns this session |
who |
who am i |
| what is my session and group |
id |
id |
| quick top and uptime |
w |
w |
| Change
Access Modes |
 |
| The
postion of X effects:
X00
- owner privileges | 0X0 - group
privileges | 00X -world or other
privileges
The
value of X can be:
0
-no privileges
1 -execute
2 -write
3 -write execute
4 -read
5 -read/execute
6 -read/write
7 -read/write/execute
Using
the above numeric file modes you can set
access using chmod.
chmod XXX myfile
or chmod XXX /usr/home/mydirectory
|
|
|
|
|
|
|