Category: UNIX-Unix Beginner
how to compare the difference between a file and a folder??
hi,
i have a .txt file which has to be compared with a folder and print the difference to some other .txt file.
i did try with the diff command..i mean
diff /tmp/aaa/bbb.txt /space/aaa/bbb/
/***bbb.txt contains all the files names which may or may not exist in the folder bbb..so i need to capture the files that does not in the folder***/
it gives me an error mesg saying..
diff : /space/aaa/bbb/ /bbb.txt : no such file or directory.
can you help me out with some other command?
thanks,
Read More...
Category: UNIX-Unix Beginner
create a calculated field from existing fields
i need to add an average field to a file. i can create it in an on-screen report and it does what i need using the awk command but i can't get it to create a new file with the additional field. here's what i'm working with:
file layout: id:lastname:firstname:grade1:grade2:grade3:grade4
i need the avg field added after grade 4.
the calculation i used in the awk statement to print the extra field was:
($4*.5+$5*.2+$6*.1+$7*.2)
i can't get this into a file though. any ideas would be greatly appreciated. thanks
Read More...
Category: UNIX-Unix Beginner
question about grep
i have 2 files, in one file is a list of hex numbers, the other is what i need matched. is it possible for me to specify to grep the list and have it go through the second file for each item in the list in the first file to match the lines? so this is like a cross-refference.
Read More...
Category: UNIX-Unix Beginner
gunzip question
unzip test.zip ==> this uncompresses and keeps the original zip file.
gunzip test.gz ==> removes the .gz file after uncompressing.
is there any switch to make the .gz file available after uncompression.
Read More...
Category: UNIX-Unix Beginner
freebsd & red hat
hi,
i'm a total new beginner to unix!
i am currently looking to move a website i own from my existing web hosts to rackspace.
my website currently runs from a server using the freebsd unix variant operating system but rackspace seem to think if i move it to them i can still run everything without a hitch with the operating system they use - red hat.
as a unix virgin i have no idea if this is viable or not?
would really appreciate your comments!
Read More...
Category: UNIX-Unix Beginner
trim leading zero in certain column in a string
i would like to know how to trim leading zero only in certain column of of a string, example:
hdhshdhdhd000012mmmm0002abc <===== before
hdhshdhdhd 12mmmm 2abc <===== after
thanks for your help.
Read More...
Category: UNIX-Unix Beginner
grep -f question
when using grep -f file1 file2
if you have multiple entries in the pattern file1 that are the same will it take the line out of file2 that matches file1 each time it comes up? if not by default can you set a flag to make this possible? or another way - can you get it to search for and match the same pattern more than once?
Read More...
Category: UNIX-Unix Beginner
redhat linux command to check version
hi all,
i need to know redhat linux version installed on a different servers.
i know uname -a or /proc/version
is any other command to know the linux version????
when we telnet to any of the linux server, the version shows very clearly like
red hat enterprise linux es release 3 (taroon update 6)
kernel 2.4.21-37.elsmp on an i686
login:
in similar way can we find same info when telnet service is not enabled?
thanks & regards,
Read More...
Category: UNIX-Unix Beginner
how to obtain list of users ?
how to obtain list of users found in /home/ and append it to a file.
Read More...