Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hey first post and going to start off with a noob question: How do I make it so I can do an:
Code:
"wget http://blahblah.blah.com"
...with my own file?
I have tried to upload a .tar file to multiple hosting sites such as drop.io and dropbox that don't make you insert a captcha before you get to dl the file. When I do an "wget URL" it downloads a weird file that doesn't remotely resemble the file I uploaded.
I am thinking the best way to overcome this problem is to host a file on one of my servers and just wget the path name? there's got to be some easier way that that?!
The reason I ask is to partially avoid another problem that maybe you guys could help me with. I have been writing some shell scripts to do various commands on my debian seedbox - mainly just creating users and directories among other things. I use Notepad++ in Windows and when I copy and paste into xtern via nano editor the spacing gets all messed up. It looks like it doesn't recognize new lines, looks something like this:
Code:
#comment a command;
When it should be like this:
Code:
#comment
a command;
How can I overcome this? In notepad I tried going to Edit/EOL Conversion/UNIX format but no dice.
Is this one of those "the answer is here, find it yourself" response...or are you just providing a possible source of information? Because I can't find an answer to neither of my questions there!
The reason I ask is to partially avoid another problem that maybe you guys could help me with. I have been writing some shell scripts to do various commands on my debian seedbox - mainly just creating users and directories among other things. I use Notepad++ in Windows and when I copy and paste into xtern via nano editor the spacing gets all messed up. It looks like it doesn't recognize new lines, looks something like this:
Code:
#comment a command;
When it should be like this:
Code:
#comment
a command;
How can I overcome this? In notepad I tried going to Edit/EOL Conversion/UNIX format but no dice.
Any help would be much appreciated!
Can't help on the apt-get part as I use SUSE which uses RPM.
For the editing, why are you using notepad++ which is a windows program to edit linux files? Just curious. Whay you might try is copying the entire file to linux and run the command "dos2unix" on it, then the file would have the correct formatting to paste into nano.
i have read briefly about this dos2unix command...do i need to install it first?
but it still goes back to the original problem. i cant access a custom file by me without first downloading it to the box through an wget command because it wont let me FTP with root (i dont have a user created yet, because that is what my script will be doing for me).
also, im assuming when you say suse uses RPM, that means its just a different command of wget? if so, the fact that you don't use the wget command shouldn't matter as it is still the same concept right?
EDIT: just realized I have been saying apt-get when it should be wget
Is this one of those "the answer is here, find it yourself" response...or are you just providing a possible source of information? Because I can't find an answer to neither of my questions there!
I think that you COULD find information about "how to compile".
Is there anyway to get Notepad++ to handle linux files? I thought that is what the EOL setting was for, but guess not.
I know nothing about "notepad". Sorry.
Quote:
will woof work if it's not over the network? because my linux box is half way across the world
What do you mean by "not over the network" if your linux box is distant, you are already using "the network"? woof works over any network: LAN, Internet, it doesn't care.
If you have a firewall between your LAN and the internet, then you'll have to open the port woof is using, and forward it to the PC woof is running on. Then the distant computer just connects to it, by connecting to your modem/router which forwards the request to the PC running woof.
It is simple, and "just works". Try it on your LAN first, then branch out.
I use Notepad++ in Windows and when I copy and paste into xtern via nano editor the spacing gets all messed up. It looks like it doesn't recognize new lines, looks something like this:
Code:
#comment a command;
When it should be like this:
Code:
#comment
a command;
How can I overcome this? In notepad I tried going to Edit/EOL Conversion/UNIX format but no dice.
Any help would be much appreciated!
I use Notepad++ for college and run it using wine(crossover) in linux at home just fine. There is also a setting (Settings -> Preferences -> New Document/Default Directory tab) to set the format to either mac, unix or windows. You could try setting it to unix and see if that sorts out the problem.
@Phunkymunky - I think you are talking about EOL Conversion right? I have it set to unix already, that fixed the wierd characters for the spaces but isn't working for the new line problems
about woof - I will look into this. when you said network, for some reason i thought it could only be done over LAN
@schneidz - are you saying there is an easy way to transfer a file from your computer to a server via SSH (such as putty)?
thanks for all your help guys, i think i am in the right direction thanks to you all. it looks like i have the info on how to get a file on my remote server easily through the use of woof, but still am wondering how to easily copy code from a windows environment into a unix.
much the same way that ssh deprecates telnet due to security, scp deprecates ftp.
when i used to use windows, i had winscp for an scp client.
as for your text file conversions, can you please paste an example of what you are seeing so the rest of us can get a clue of what you are talking about. try running it thru od so we know what charecters are problematic like so:
You are running into the Windows vs Unix newline problem. Particularly if you are using ssh, I would suggest looking at using a text editor such as "vi". (Initially @$#%%$ then better than anything else)
The different newline conventions often cause text files that have been transferred between systems of different types to be displayed incorrectly. For example, files originating on Unix or Apple Macintosh systems may appear as a single long line on some Windows programs. Conversely, when viewing a file originating from a Windows computer on a Unix system, the extra CR may be displayed as ^M at the end of each line or as a second line break.
The problem can be hard to spot if some programs handle the foreign newlines properly while others do not. For example, a compiler may fail with obscure syntax errors even though the source file looks correct when displayed on the console or in an editor. On a Unix system, the command cat -v myfile.txt will send the file to stdout (normally the terminal) and make the ^M visible, which can be useful for debugging. Modern text editors generally recognize all flavours of CR / LF newlines and allow the user to convert between the different standards. Web browsers are usually also capable of displaying text files and websites which use different types of newlines.
...
Conversion utilities
...
On many Unix systems, the dos2unix (sometimes named fromdos or d2u) and unix2dos (sometimes named todos or u2d) utilities are used to translate between ASCII CR+LF (DOS/Windows) and LF (Unix) newlines. Different versions of these commands vary slightly in their syntax. However, the tr command is available on virtually every Unix-like system and is used to perform arbitrary replacement operations on single characters. A DOS/Windows text file can be converted to Unix format by simply removing all ASCII CR characters with
tr -d '\r' < inputfile > outputfile
or, if the text has only CRs, by converting CRs to LFs with
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.