21, ఏప్రిల్ 2012, శనివారం

PREPARED BY RAMANJANEYULU DAYINABOYINA ON 5TH .MAY.1998 WHEN I WAS STUDYING MCA



[ramu]# cat> data
unix is from multics
unix is multipurpuse    
this is ram's unix class

[ramu]# cat data| cut -c 1
u
u
t
[ramu]# cat data| cut -c 3 5 7
cut: 5: No such file or directory
cut: 7: No such file or directory
[ramu]# cat data| cut -c 3,5,7
i s
i s
i s
[ramu]# cat data| cut -c 3,5,7,8
i s
i s
i s

[ramu]# cat data |cut -i [5-8],12
cut: invalid option -- i
Try `cut --help' for more information.

[ramu]# ls -l
total 81060
-rw-r--r-- 1 root root      241 Jan  1  2006 ]
-rw-r--r-- 1 root root      730 Jan  1  2006 v4.c

[ramu]# ls | cut -d " " -f 1 4
cut: 4: No such file or directory
[ramu]# ls | cut -d " " -f 1,4
u4fork.c
v4.c
[ramu]# ls -l | cut -d " " -f 1,4
total
-rw-r--r-- root

[ramu]# ls -l u4fork.c
-rw-r--r-- 1 root root 1785 Jan  1  2006 u4fork.c
[ramu]# shutdown -y -g120 -i0
227  shutdown -y -g1 -i0
689  cat data
  690  cat> data
  691  cat data| cut -c 1
  692  cat data| cut -c 3 5 7
  693  cat data| cut -c 3,5,7
  694  cat data| cut -c 3,5,7,8
  695  cat data| cut -c [5-8],12
  705  ls| cut -d " " -f 1 4
  706  ls | cut -d " " -f 1 4
  707  ls | cut -d " " -f 1,4
  708  ls -l | cut -d " " -f 1,4
  709  ls -l u4fork.c


[ramu]# a=100
[ramu]# export a

[ramu]# mkdir ram1
[ramu]# cd ram1
[root@localhost ram1]# echo $a
100
[root@localhost ram1]# sh
sh-3.1# echo $a
100

sh-3.1# ksh
# echo $a
100

[root@localhost ram1]# csh
[root@localhost ~/ram1]# echo $a
100
[root@localhost ~/ram1]# bash
root@localhost ~]#
defining alias for the predefined commands in the linux operating system
[ramu]# alias a ls -l
now on word you give $a acts as ls -l
[ramu]# alias dayina ls -l
and now $dayina acts as ls -l  in th previously i defined ls -l for 'a' and 'dayina'
both wil work for the ls -l and 'a','dayina' acts as alias for the ls -l
note :- even though i have defined one more alias for the previously defined alias it will not overwrite insted both will work

to undefine the alias use the below command
[ramu]# unalias a
[ramu]# a
a: Command not found.    Now onwords the remaining alias dayina will work but 'a' will not work
[ramu]# dayina
total 81120
-rw-r--r-- 1 root root      241 Jan  1 05:51 ]

[ramu]# man compress   verify about the how to compress and uncompress a file ,
No manual entry for compress
[ramu]# set history=2  setting history from unlimisted to only 2
[ramu]# ls -l
[ramu]# date
Sun Jan  1 09:25:09 IST 2006
[ramu]# history
    26  9:25    date
    27  9:25    history
in the above i have played 3 commands for this only 2 commands are avaliable in the history

[ramu]# w
 09:37:28 up 43 min,  1 user,  load average: 0.02, 0.07, 0.04
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT
root     pts/0    :0.0             08:55    1.00s  0.10s  0.00s w

కామెంట్‌లు లేవు:

కామెంట్‌ను పోస్ట్ చేయండి