159 Posted Topics

Member Avatar for gian10890

Hello gian! There are lots of ways to do what you're looking for. Perhaps the simplest way, when the pattern you need to replace is so consistent, is to use the 'sed' command. In your script you could replace that part of the filename with something like this: [code] echo …

Member Avatar for JeoSaurus
0
178
Member Avatar for starfruit

Hi Starfruit! It really depends on which distribution you're using. Most modern distributions have a package manager that will easily set up a default apache installation for you with very little (if any) configuration required. Which Linux distribution are you using?

Member Avatar for JeoSaurus
0
120
Member Avatar for Elandir

If you just want TCP info from netstat, you can do [icode]netstat -at[/icode], or [icode]netstat -au[/icode] for UDP. You can also get some good information from [icode]lsof -i[/icode] A little late, but I hope this helps!

Member Avatar for Elandir
0
210
Member Avatar for mirasravi

Hi mirasravi! I'm not *exactly* sure what you're looking for, but personally I like to use as few commands as possible for something like this. That being said, your curl example seems like the most efficient. I'm not sure about the syntax though. I think it should be something like …

Member Avatar for mirasravi
0
241
Member Avatar for sparkle85

>> Can someone help me understand why "tail -f" it stops writing into myfile.txt Does the log file get rotated at some point? If so, tail is still referencing the OLD version, even though it's been renamed. I've done something similar using tail -f, but also running a monitoring script …

Member Avatar for JeoSaurus
0
165
Member Avatar for Dream2code

I like the stat/diff idea! Do you need to know what files have changed, or just IF they have changed? I have a script that monitors a directory for changes, and then rsyncs it with another server, does some logging, etc... if any changes occur. To check for changes I …

Member Avatar for Dan08
0
156
Member Avatar for aswin_agarwal

Hi Asin! I think what Aia meant was that this forum is a great place to go for help with something that you're working on, but it's not the best place to post a set of requirements and say "write me a script!". If you want somebody to do all …

Member Avatar for thekashyap
0
89
Member Avatar for discovery-power

"cd .." is good for moving up a directory, but you should also know that you can get ANYWHERE in the filesystem if you know the full path! :) You can use RELATIVE paths or ABSOLUTE paths. Relative paths are relative to your current working directory. [code] Example of relative …

Member Avatar for JeoSaurus
0
133
Member Avatar for gubbu

Howdy Gubbu! I'm not sure I understand the end result you're looking for in this script. Is the purpose to see how long it takes to create the gzip file, or to compare time stamps between two different gzip files? Thanks! -G

Member Avatar for JeoSaurus
0
103
Member Avatar for crazysoul13

BTW, wget also takes input from a file, so if you had a list of URLs in a file, you could use 'wget -i' Check out the wget man page for some of the other options you can use. It has great capabilities for mirroring sites and things, which is …

Member Avatar for JeoSaurus
0
103
Member Avatar for dimitar.dk

Here's an example of something I'm using to monitor an application log for a specific error. I'll put some generic variables in :) [code] #!/bin/bash # Set some variables here logfile="/path/to/logfile" pattern="this.is.an.error" email="user@example.com" # read each new line as it gets written # to the log file tail -fn0 $logfile …

Member Avatar for JeoSaurus
0
141
Member Avatar for modesto916

Nice issue9! I'd probably use 'seq' to generate those numbers personally. Something like this: [icode]seq 1 254[/icode] To generate a list of IPs like in issue's example: [icode]for i in $(seq 1 254); do echo "192.168.0.$i"; done[/icode] You've probably got a solution by now, but I hope this helps somebody! …

Member Avatar for JeoSaurus
0
119
Member Avatar for kenshin88

Hello kenshin, how far have you gotten with this? Anything you can do with grep, you can probably do with awk! For example: [code] grep -y hello filename # is equal to: grep -i hello filename # which is equal to: awk '/hello/i' filename [/code] Hope this gets you going …

Member Avatar for JeoSaurus
0
140
Member Avatar for johndoe444

It was probably a permissions issue. Did you create the .ssh directory manually? If you check the system logs, you'll probably find an error about permissions on the .ssh directory (just a guess). -G

Member Avatar for JeoSaurus
0
101
Member Avatar for sri4shell

Sure! I don't have any examples in front of me, but the Oracle command line client is sqlplus. There are others, but I think sqlplus is the one that ships with Oracle. You should be able to script something that uses sqlplus to get what you need from the database …

Member Avatar for scripter.online
0
417
Member Avatar for milindras

Hi! I hope you've already found an answer to this, but if not, this thread might help: [URL="http://www.linuxquestions.org/questions/linux-networking-3/dns-rndc-service-errror-229950/"]http://www.linuxquestions.org/questions/linux-networking-3/dns-rndc-service-errror-229950/[/URL]

Member Avatar for tracedinesh
0
1K
Member Avatar for josh2

Hi! It's most likely filtered by your ISP. They generally do this to help prevent old, unpatched Windows machines that are directly connected to the internet from being cracked. In general, this isn't a great idea. If you absolutely have to access these files over the internet, I'd recommend using …

Member Avatar for DimaYasny
0
2K
Member Avatar for towelee
Member Avatar for DimaYasny
0
86
Member Avatar for bipinbaglung

Check out tinycore! ([url]http://www.tinycorelinux.com/[/url]) Or P.U.D. Linux! It's based on Ubuntu. SLAX also runs great from a pen drive! For the record, I've run the standard xubuntu on a 2GB stick with no problem, but it was a little cramped for space. I fixed that by setting it up to …

Member Avatar for JeoSaurus
0
178
Member Avatar for shyamalaa

That's really odd... It works OK on my system: [icode] $ sed -f DBACheck.sql.sed DBACheck.sql select granted_role from sys.dba_role_privs where grantee='SYSTEM'; [/icode] What version of sed are you using? ([icode]sed --version[/icode]) -G

Member Avatar for shyamalaa
0
286
Member Avatar for scottyscotty19

Hmm... Is that the whole script? I'm not seeing the "users" function called anywhere, or even a terminating "}" for the function :) -G

Member Avatar for scottyscotty19
0
127
Member Avatar for blueman

Hi! That sounds interesting, but I think we're a little unclear about the details. You mention... "create a menu which will add users doing this in Bash" ...and... "then adding a list of users again using bash" Do you mean that the script should be able to present a menu …

Member Avatar for JeoSaurus
0
99
Member Avatar for Thinka

Debian is the ORIGINAL "picnic in the park"!!! Apt is the greatest invention ever! Okay, but seriously. If you want to stick with Debian, which I support completely, look into ndiswrapper. Typically, the hard part of getting a wireless adapter to work in Linux is getting the right driver installed. …

Member Avatar for rm_daniweb
0
165
Member Avatar for achevchenko

It's all about what you're comfortable with! Linux can be point-and-click, or you can do it all at command line. I'll also say that if you're running Linux as a web server (with php/mysql/whatever) with light to medium traffic, hardware specs aren't really an issue (I mention this since you …

Member Avatar for jbennet
0
225
Member Avatar for ibi001

My advice? Try them ALL! At least the mainstream ones. Most everything else is based on one of the mainstream distros. It's all a matter of preference. I started out with RedHat and rpm dependencies drove me nuts... Found Debian a few years later and fell in love with their …

Member Avatar for Selwyn
0
216
Member Avatar for Beastmanh

Hi Mike, That's certainly an odd problem... Let's compare the output of these commands: $ date "+%a %d %b %Y %X %Z"; hwclock; ntpdate pool.ntp.org That'll tell us if there are any differences between the system clock and the hardware clock, and give us a baseline from ntp. Do you …

Member Avatar for jbennet
0
166
Member Avatar for cam875

BillBrown hit it on the head. It's really all about preference. I started out working with RedHat servers, and then experimented with every different distribution I could get my hands on until I discovered the beauty and elegance that I like to call "apt" (the package manager used by Debian …

Member Avatar for jbennet
0
230
Member Avatar for Mujzeptu

Check out "read"! It will take the user input and do whatever you want with it. [code] read -p "what is your name? " name echo "Nice to meet you $name" [/code] Hope that helps! -G

Member Avatar for JeoSaurus
0
152
Member Avatar for axn

Looks like you need to enclose your $line|sed in both cases! Try this: [code] for line in $(ls *.new); do file1="${line}" file2="$(echo ${line} | sed 's/\(.*\)..../\1/')" diff ${file1} ${file2} done [/code] Hope it helps! -G

Member Avatar for JeoSaurus
0
145
Member Avatar for trinitybrown

vim all the way! If it's configured with syntax hilighting and search hilighting, and you can get used to the commands, it's the best ever for command line html/php/any scripting language you can think of. There are some great quick reference materials out there. This isn't the easiest one to …

Member Avatar for John A
0
113
Member Avatar for ckcy2005

Do you use the temporary file for anything in the meantime? I'm biased against temporary files when they can be avoided, personally... Why not stuff it all into a variable and then stuff it into a file when it's done, or just write directly to the destination file? Here's an …

Member Avatar for JeoSaurus
0
143
Member Avatar for packet

Okay, I needed something to get my mind off work for a few minutes, so here's a quick script I wrote using both of the suggestions above from chris5126 and omrsafetyo. I didn't translate the date, I used the date command to format the date without colons. Here goes, hope …

Member Avatar for JeoSaurus
0
163
Member Avatar for macuhail

Hi! The problem is that you're not providing a database name! Try this: [icode] mysql -uusername -ppassword database_name ... [/icode] Hope that helps! -G EDIT: And to clarify that error you're getting, since you're surrounding your "-e" with single quotes (' '), and you have single quotes inside the string, …

Member Avatar for macuhail
0
88
Member Avatar for chris5126

Wow, that's a lot of pipes! I would do it something like this: [code] awk '{TotCPU += $1}{TotMem += $2}END{print "Total CPU= " TotCPU "\nTotal Mem= "TotMem}' test.list [/code] Kinda ugly all in one line, but here it is broken down a little: [code] awk '\ {TotCPU += $1}\ {TotMem …

Member Avatar for JeoSaurus
0
184
Member Avatar for shwick

Here's a silly question... Have you tried forcing your NIC on the Windows box to run in 'full duplex' mode? The speed problem is only when going up from the Windows box to the Linux box right? Everything's fine when going from the Windows box to the Linux box? That …

Member Avatar for shwick
0
667
Member Avatar for shwick

One thing to remember about 'sudo su' is that it's not a 'login shell' by default. If you use 'sudo su -l' ('sudo su -' for short) then you'll inherit all of the root user's environment variables, like the path and such. Just curious though, why would you need to …

Member Avatar for jbennet
0
3K
Member Avatar for serkan sendur

It's just a text file right? What flavor of Unix are you using? You'll probably want to use "vi" or "emacs". If you're not familiar with either of those, you'll probably want to google for some references. Neither of them can really be summed up :) -G

Member Avatar for JeoSaurus
0
98
Member Avatar for markascovel

Here ya go! [url]http://archives.fedoraproject.org/pub/archive/fedora/linux/core/1/i386/iso/[/url] -G

Member Avatar for jbennet
0
104
Member Avatar for ajay23

Hi Ajay! I'm not that familiar with Java, so are the System.out messages what gets printed on the command line? If' so, you'll want to run your java app like this: [icode]./java-app >> log.txt[/icode] Seems like I read a similar post, and someone was having trouble getting the error messages …

Member Avatar for eggi
0
69
Member Avatar for ashikin_8119

Try using the built in exec command! Also, not sure if that's exactly what you're typing, but you'll need to give "find" a few more arguments... [icode]find . -iname *.dat -prune -exec ls -ltr {}\;[/icode] What this does, bit by bit: find - the command! . - the starting point, …

Member Avatar for JeoSaurus
0
184
Member Avatar for shwick

Hi Shwick! I'm not exactly sure what you're trying to do with the usermod command there. If it's giving you the usage, then you've likely got a syntax error somewhere. What's the end result you've got in mind here? On the sudo issue, the "sudo" password is always going to …

Member Avatar for JeoSaurus
0
107
Member Avatar for Robert72

I think you're looking for read -p I have some examples, but running to a meeting... If you still need help, I'll post it later! -G

Member Avatar for JeoSaurus
0
155
Member Avatar for shwick

Doesn't tripwire write a to a report file by default? Maybe you could get the results you're looking for by running tripwire and then parsing the report? Otherwise, I think you're just missing some quotes to hold everything together ;) Try this! [code] #!/bin/sh -e tripwire=/usr/sbin/tripwire [ -x $tripwire ] …

Member Avatar for shwick
0
137
Member Avatar for ananthxp
Member Avatar for ananthxp
0
76
Member Avatar for Jaoqua

Hi Jaoqua! How have you tried so far? Depending on how the file is formatted (are there spaces in some of the commands you want to run?) it should be as simple as: [icode] for i in $(cat /path/to/file); do $i; done [/icode] If there are spaces in the command …

Member Avatar for eggi
0
86
Member Avatar for lmrd

That's an interesting one... is the pattern for each one the same as your example? If so, you could do something like: [code] TEST=(A028) ; echo -n ${TEST:2:4}${TEST:0:2} [/code] Maybe? I dunno... -G

Member Avatar for mittelgeek
0
139
Member Avatar for gargg321

Are you sure you don't just have to run the .bin file? I've seem some software packaged as .bin or .run. These are usually install scripts that extract their own rpms (or binaries, or source, or whatever) and install them.

Member Avatar for BillBrown
0
266
Member Avatar for phynias

Hi Manik, you might want to start a new thread, since this was was solved back in March :) If this isn't what you're looking for, please start a new thread with more details. From what you've given us so far, it sounds like you just need to do something …

Member Avatar for manik007
0
129
Member Avatar for bmead

If all that's in that directory is the sym links to the files that you want to tail, try something like this: [icode] for i in $(ls /path/to/directory); do tail -n 21 $i; done [/icode] Let us know how it goes! If we're missing the gist of what you're trying …

Member Avatar for bmead
0
107
Member Avatar for rast1979

Hi Rast, To do this with find, try the -cmin switch: [code] -cmin n File’s status was last changed n minutes ago. [/code] EDIT: Or you might be looking for this one: [code] -mmin n File’s data was last modified n minutes ago. [/code] (I got this from the man …

Member Avatar for rast1979
0
133

The End.