Search this Website

 

Ubuntu

UNIX

triml leading zeros in unix

Category: UNIX-Unix Beginner

triml leading zeros in unix

hi all,

how does one trim leading zero's in unix

thanks


Read More...

deleting core file

Category: UNIX-Unix Beginner

deleting core file??

hi,

i am using unix through exceed on my pc to gain access to some cfd programs. one of these programs crashed a couple of days ago and created a file called core, which i understand is a back up file and can be deleted immediately. however, before deleting it i rearranged some of my other files in my area, then tried to delete core. however, it would not delete and then all my other programs would not open correctly or load files. any advice?

thanks


Read More...

how to obtain list of users

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...

awksed one liner for text replacement

Category: UNIX-Unix Beginner

awk/sed one liner for text replacement

hi group,

i want to replace the occurance of a particular text in a paragraph.i tried with sed,but sed only displays the result on the screen.how can i update the changes in the original file???

the solution should be a one liner using awk and sed.


Read More...

glance quick reference

Category: UNIX-Unix Beginner


Read More...

path in prompt line

Category: UNIX-Unix Beginner

path in prompt line?

can anyone tell me what makes the current path appear in the prompt ?


Read More...

do i use grep for this

Category: UNIX-Unix Beginner

do i use grep for this?

say i have file1

1
1 1
3 4
5

and file2

1 hello i am 1
2 hello i am 2
3 hello i am 3
4 hello i am 4
5 hello i am 5

when i grep this i need this result
1 hello i am 1
1 hello i am 1
1 hello i am 1
3 hello i am 3
4 hello i am 4


Read More...

extrat data using awk

Category: UNIX-Unix Beginner

extrat data using awk

how can i extract data using awk
i have data as follow
01---------
02-----
03-----
03---
i want to extract data to the file 01.dat,02.dat and 03.dat
the field value should be the part of file name
outfile="xx"
awk -f"|" '{outfile = $1; print outfile}' x1 > $outfile
echo $outfile

this won't work because the field is not passed to the ksh.


Read More...

ls command help

Category: UNIX-Unix Beginner

ls command help

i was givin the task to clear up space in one of our directories. i was wondering if their was an ls command that i can search for a certain date (i.e. all files created in 2005) to display those files and then use a wildcard to delete all files created in a certain year. if so, this would make my life alot easier. i appreciate any help.


Read More...

basics - if condition (contains)

Category: UNIX-Unix Beginner

basics - if condition (contains)

can any body help me on how to check whether a file contains a required extension or not.

pseudo is:

if (filename contains .jpg || filename contains .gif)
--- do some thing
end if

example file names:
test1.grm.gtrx.drx.jpg
test.de.mi.jpg
test2.ds.gif
test3.gif


Read More...