Prepare for your Next Interview
This is a discussion on Unix Basic Scripts within the Unix/Linux forums, part of the Operating Systems category; Whats the difference between ll and ls command? Where can i get the set of commands in UNIX? What is a shell? If i am working on UNIX, What do ...
|
|||
|
Unix Basic Scripts
Whats the difference between ll and ls command?
Where can i get the set of commands in UNIX? What is a shell? If i am working on UNIX, What do i need to know? Can you tell me some basic scripts in unix? I know its long but urgent.. Question asked by visitor sameer |
| The Following User Says Thank You to Geek_Guest For This Useful Post: | ||
| Sponsored Links |
|
|||
|
Re: Unix Basic Scripts
there is no command called as ll.
ls displays the files in current directory. if you want set of commands in unix then press tab twice in the terminal. for in detail about a particular command you can use man command |
|
|||
|
Re: Unix Basic Scripts
Hi,
You may refer to unixguide.net for basics of UNIX. Here is an example of shell script which will show you disk space. #!/bin/ksh init() { day=`date |tr -s " " "-"|tr -s ":" "."` lpat=/home/cmabct/vinod mach=`uname -s` myn=`uname -n` mailp=/usr/sbin/sendmail ids=${lpat}/dsk_ids.txt logs=${lpat}/LOGS/dsk_${day}.txt limit=${lpat}/LOGS/tmp_dsk.txt ############################## # sub="Subject: Disk Space Status($myn) on $day" header="Filesystem kbytes used avail %used Mounted on" if [ ! -d ${lpat}/LOGS ] then mkdir -p ${lpat}/LOGS fi if [ ! -f $ids ] then return 1 fi >$logs >$limit } cmds() { case $mach in HP-UX) bdf | egrep "9[0-9]%|100%" > $limit;; SunOS) df -lkF ufs > $logs df -lkF tmpfs >> $logs cat $logs | egrep "9[0-9]%|100%" > $limit mailp=/usr/lib/sendmail;; Linux) df -h | egrep "9[0-9]%|100%" > $limit;; *) rm $logs $limit return 1 esac } creatfile() { if [ -s $limit ] then > $logs cat $ids >$logs echo "$sub\n\n">>$logs echo "$header">>$logs cat $limit >>$logs sleep 1 $mailp -t < $logs else rm $logs $limit return 1 fi } mast() { init if [ $? -ne 1 ] then cmds fi if [ $? -ne 1 ] then creatfile fi if [ $? -ne 1 ] then rm $limit fi } Thanks, Amit Shiknis |
|
|||
|
Re: Unix Basic Scripts
Hi,
You may refer to unixguide.net for basics of UNIX. Here is an example of shell script which will show you disk space. #!/bin/ksh init() { day=`date |tr -s " " "-"|tr -s ":" "."` lpat=/home/test/test mach=`uname -s` myn=`uname -n` mailp=/usr/sbin/sendmail ids=${lpat}/dsk_ids.txt logs=${lpat}/LOGS/dsk_${day}.txt limit=${lpat}/LOGS/tmp_dsk.txt ############################## # sub="Subject: Disk Space Status($myn) on $day" header="Filesystem kbytes used avail %used Mounted on" if [ ! -d ${lpat}/LOGS ] then mkdir -p ${lpat}/LOGS fi if [ ! -f $ids ] then return 1 fi >$logs >$limit } cmds() { case $mach in HP-UX) bdf | egrep "9[0-9]%|100%" > $limit;; SunOS) df -lkF ufs > $logs df -lkF tmpfs >> $logs cat $logs | egrep "9[0-9]%|100%" > $limit mailp=/usr/lib/sendmail;; Linux) df -h | egrep "9[0-9]%|100%" > $limit;; *) rm $logs $limit return 1 esac } creatfile() { if [ -s $limit ] then > $logs cat $ids >$logs echo "$sub\n\n">>$logs echo "$header">>$logs cat $limit >>$logs sleep 1 $mailp -t < $logs else rm $logs $limit return 1 fi } mast() { init if [ $? -ne 1 ] then cmds fi if [ $? -ne 1 ] then creatfile fi if [ $? -ne 1 ] then rm $limit fi } mast Thanks, Amit Shiknis |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Basic relation between AP,AR, GL and PO | Geek_Guest | Oracle Apps | 3 | 09-09-2008 03:37 PM |
| XML in Visual Basic | Lokesh M | AJAX & XML | 0 | 08-28-2007 09:55 AM |
| What are all the basic things i should know | Geek_Guest | Career Advice | 1 | 08-04-2007 02:44 AM |
| Descriptive Programming and Visual Basic Scripts | Geek_Guest | QTP | 1 | 07-11-2007 04:24 PM |
| What is ""developing procedures and scripts (UNIX/Windows/Oracle) | spd15 | Testing Issues | 1 | 04-04-2007 09:01 AM |