Monday, March 25, 2013

How would you go about this linux task?

Q. 1. I must grep through executable scripts, but they don't end in .doc or .exe tag

2. the grep signature will be "rcp" other remote commands so I can change them secure commands like "scp"

Is there any way I could do this in Linux and using Perl?

A. find . -type f -perm /u+x -exec grep -l -w rcp {} \;

Find regular files starting at the current directory which are executable by the owner. When found grep on whole words of "rcp", but display only the file names.

If you really want to replace "rcp" with "scp" in all cases (not recommended because that is too sweeping), then add a sed loop. Something like this:

find . -type f -perm /u+x -exec grep -l -w rcp {} \; | while read NAME; do cat $NAME | sed -e 's/rcp /scp /g' > .tmp.$$ ; mv .tmp.$$ $NAME; done

Be SURE to test that thoroughly before trying that last bit.

How do I turn my Ubuntu/Linux PC into a server for my Windows 7 PC?
Q. Is this a good idea? Will my Windows PC get extra protection since I will be going on the Internet using the Ubuntu as a server, as an intermediary? How difficult is it to do this?

A. This question is pretty poorly designed. There is no "Server for windows" in Linux. You can do several things with linux and connect/use them from windows though. You can make linux a firewall and router, connect it to your cable/dsl modem so you can have multiple computers use your internet connection at one time. You can run web, ftp, and other servers for files and web pages. You can also run Samba which allows you to access and store files on the linux hard driver over the network. linux also makes a GREAT extension to your windows environment using things like xdmcp, rdp, ssh, scp. if you do not know what any of these terms are, google is your buddy. You can also set up a web proxy using linux and this could definitely be used to increase your web browsing security in windows by blocking malicious web sites. Pretty much anything you want to do with Linux is limited by you and your willingness to learn.

Nothing is simple click and go in linux. You have to be willing to experiemnt, read, and learn.

How do you transfer files from the command line in Red Hat Linux?
Q. I'm trying to transfer files from a Fedora Core to the host server, which is a Red Hat v 8. How do I do it from the command line?

A. Well there are several ways to do this. They depend on what servers are running on the host machine. If you can ssh to the host server, then the best way is "scp <filename> <host machine>:<filename>". If this is not setup you can try ftp or one of the disk sharing protocols like Samba or NFS.

Nec Projector Review

Plastic Shed Reviews

Ati Graphic Reviews

Nurse Uniforms Reviews

Cabochons Reviews

Inflatable Water Slides Reviews

Barcode Scanner Reviews

No comments:

Post a Comment