Jump to content

************UNIX COMMANDS HELP****************************


Recommended Posts

Posted

[quote author=Musugu_Veerudu link=topic=213338.msg2617064#msg2617064 date=1310879959]
ls -ltr |grep "Jul 14 " |grep .dbf |awk '{print $9}' >> zip_dbf.log

aah zip_dbf.log file ni open chesi .. aah file lo gzip command ni starting of every line lo enclose chesi .. aah file ni execute chesey

starting of 1st line lo gzip ni ela pettaalo telsa using vi command ?
[/quote]

yeah now I got both of ur points..


first command lo vachina resulting files annitini oka log file loki Rappiunchi..


aa files annitiki okeysaari gzip command ni append chesi ..

save the file as .sh

and just run that file as a shell script..


kool man,... that was so simple rather than combining a set of commands...

Posted

[quote author=OM link=topic=213338.msg2617070#msg2617070 date=1310880046]
jul 14th files  lo malli .dbf files seperate cheyyali antey it works out..
[/quote]

but already existing files in current directory  kaaleduga baa..just aa folder zip ayyindi ante....naaku all july 14 th naa unna files anni in the existing directory itself zip kaavali baa.

.

Posted

[quote author=Musugu_Veerudu link=topic=213338.msg2617064#msg2617064 date=1310879959]
ls -ltr |grep "Jul 14 " |grep .dbf |awk '{print $9}' >> zip_dbf.log

aah zip_dbf.log file ni open chesi .. aah file lo gzip command ni starting of every line lo enclose chesi .. aah file ni execute chesey

starting of 1st line lo gzip ni ela pettaalo telsa using vi command ?
[/quote]

Yeah, below one might also work anukunta

Just small script as follows

#! /usr/bin/ksh
# gzip july 14 .dbf files

for DBF in `ls -ltr | grep "Jul 14 " | grep .dbf |awk '{print $9}'`
do
  gzip -f -9 $DBF
done

Posted

[quote author=SOURYAM link=topic=213338.msg2617116#msg2617116 date=1310880753]
but already existing files in current directory  kaaleduga baa..just aa folder zip ayyindi ante....naaku all july 14 th naa unna files anni in the existing directory itself zip kaavali baa.

.


[/quote]

oh neeku prati individual file ni zip cheyyali kada...

Ohmy bad,, I was thinking about zipping the whole set of files into a single folder.. and tar it.. I am sory for that ,,
coming to ur point here..

so if u got that log file as ACP mentioned with the command you ran

ls -ltr |grep "Jul 14 " |grep .dbf |awk '{print $9}' >> zip_dbf.l og

get into that log file using the vi.. editor..

vi zip_dbf.log

enter i (allows you to enter some content into that log file)

now go to the start of the each file name and include gzip infront of each file name

now save the file after you include gzip infront of all the lines..  by  entering

Press "esc"

now type  :wq


now press enter

now check the content of the saved file by a cat command

and then just run the file from the command prompt,,


and make sure you got all the files that needed to be zipped in that .log file..



Posted

nice thread nice thread nice thread nice thread nice thread

Posted

[quote author=SOURYAM link=topic=213338.msg2617116#msg2617116 date=1310880753]
but already existing files in current directory  kaaleduga baa..just aa folder zip ayyindi ante....naaku all july 14 th naa unna files anni in the existing directory itself zip kaavali baa.

.
[/quote]

idi try cheyu all .dbf files of july 14 zip ayithavi

[quote author=celebrate link=topic=213338.msg2617129#msg2617129 date=1310881157]
Yeah, below one might also work anukunta

Just small script as follows

#! /usr/bin/ksh
# gzip july 14 .dbf files

for DBF in `ls -ltr *.dbf | grep "Jul 14 " | awk '{print $9}'`
do
  gzip -f -9 $DBF
done
[/quote]

Posted

[quote author=OM link=topic=213338.msg2617136#msg2617136 date=1310881267]
oh neeku prati individual file ni zip cheyyali kada...

Ohmy bad,, I was thinking about zipping the whole set of files into a single folder.. and tar it.. I am sory for that ,,
coming to ur point here..

so if u got that log file as ACP mentioned with the command you ran

ls -ltr |grep "Jul 14 " |grep .dbf |awk '{print $9}' >> zip_dbf.l og

get into that log file using the vi.. editor..

vi zip_dbf.log

enter i (allows you to enter some content into that log file)

now go to the start of the each file name and include gzip infront of each file name

now save the file after you include gzip infront of all the lines..  by  entering

Press "esc"

now type  :wq


now press enter

now check the content of the saved file by a cat command

and then just run the file from the command prompt,,


and make sure you got all the files that needed to be zipped in that .log file..
[/quote]

Thanks baa..issue solve ayyindi..ayine .log file ela execute ayuutndoi aba..

file  ni .sh ga save chesi execute chesanu..gzip ayyyi ba.a..

Posted

[quote author=Bondu_Babu link=topic=213338.msg2617144#msg2617144 date=1310881489]
nice thread nice thread nice thread nice thread nice thread
[/quote]niku use authundhi  &D_@@

×
×
  • Create New...