CRLF tags attached upon FTP upload from a windows to Linux Server - linux

I am uploading the files in a FTP folder from Windows server to a Linux server. Files come in different extensions but can be opened using notepad or notpad++.
I am getting issues that CR & CRLF are getting attached after FTP upload to Linux from Windows.
I am uploading a file from windows in the below format
This is the file after FTP Upload to Linux server. We can see many CR and CRLF tags getting attached, which shouldn't be the case.
I need the files in the below format in Linux (With only LF tags attached)
For FTP from windows to Linux, I am using the Batch Script as below..
open XXXXXXXXXX.net
UID
PASSWORD
cd METS
cd MARVELRAIL
binary
mput E:\METS+_BULK_UPLOAD\BULK_FOLDERS\OUT\DISCH\*.*
quit
Can you help me where I am going wrong and how to beat this issue...
Thank in advance.

If you want the files to be converted to *nix line endings, do not use a binary mode, use an ascii mode.
The ascii mode is the default one, so removing binary command should be enough.
Or you can explicitly use ascii command.

Related

Jmeter with csv file in Linux for Login

Iam new to linux , i know how to run jmx files with CSV in Windows. Can any please guide how to run the jmx script with CSV for concurrant logins ??
Absolutely the same way:
Use relative path to the CSV file, not the absolute path because Linux file system is different, it doesn't have drive letters
Copy the CSV file along with the .jmx file to the same folder at the Linux machine, this way you will be able to use just filename in the CSV Data Set Config
If you need the guidance on installation of JMeter on Linux:
you will need Java Runtime Environment, check you Linux distribution documentation for Java installation details
download JMeter using your browser (or command-line tools like wget or curl)
copy the .jmx and the .csv files to the machine
run your test in command-line non-GUI mode

Windows Linux Subsystem - File permissions when edited outside bash [duplicate]

As the title suggests, if I paste a c file written somewhere else into the root directory of the Linux Subsystem, I can't compile it.
I did a test where I made two differently titled hello world programs: one in vi that I can get into from the bash interface, and one elsewhere. When I compiled the one made in vi, it worked fine. Trying to do so for the one made elsewhere (after pasting it into the root directory), however, resulted in this:
gcc: error: helloWorld2.c: Input/output error
gcc: fatal error: no input files
compilation terminated
Any help with this would be much appreciated.
Do not change Linux files using Windows apps and tools!
Assuming what you meant by "paste a C file written somewhere else into the root directory of the Linux subsystem" is that you pasted your file into %localappdata%\lxss, this is explicitly unsupported. Files natively created via Linux syscalls in this area have UNIX metadata, which files natively created with Windows tools don't have.
Use /mnt/c (and the like) to access your Windows files from Linux; don't try to modify Linux files from Windows.
Quoting from the Microsoft blog linked at the top of this answer (emphasis from the original):
Therefore, be sure to follow these two rules in order to avoid losing files, and/or corrupting your data:
DO store files in your Windows filesystem that you want to create/modify using Windows tools AND Linux tools
DO NOT create / modify Linux files from Windows apps, tools, scripts or consoles
You cannot copy (by default, who knows how Windows bash is set up!) files into the root directory! Your gcc error is say "no input files", so the copy has most likely failed. Copy the files to your home directory instead, for instance:
cp helloWorld2.c ~/
instead of:
cp helloWorld2.c /

Install4j Linux installer not working

I made installers for my application, it works on Windows and Mac, but when I try to run the .sh installer file on linux, it fails with this error:
gzip: sfx_archive.tar.gz: not in gzip format
I am sorry, but the installer file seems to be corrupted. If you downloaded that file please try it again. If you transfer that file with ftp please make sure that you are using binary mode.
How can I solve this?
Thanks.
The error message describes the probable reason:
I am sorry, but the installer file seems to be corrupted. If you
downloaded that file please try it again. If you transfer that file with
ftp please make sure that you are using binary mode.
You probably transferred it to the Linux machine in such a way that the line endings were replaced or the installer script was truncated.
This may be because you opened the file in a text viewer, which can change some aspects of the file. Try redownloading it and running it without opening it.
chmod +x install_file.sh
./install_file.sh
I imagine the problem is that you're attempting to extract sfx_archive.tar.gz using tar with the z flag, and that it's not actually gzip compressed.
I would try substituting your current tar command with the following:
tar -xvf sfx_archive.tar.gz

git compatibilty setting on windows for using linux server over windows share

I've installed the latest version from git-scm.com on my Windows 8.1 System. My Dev Server is a Linux Server, but I'm connected to this server using a windows share.
After the git initalization, I've started to "add" files to the repositiory and received this message on the windows command line, for every file:
warning: LF will be replaced by CRLF in inc/src/tpl/default.smarty.
The file will have its original line endings in your working
directory.
While installing git I selected option 1 from this options:
Checkout Windows-style, commit Unix-style line endings
Checkout as-is, commit Unix-style line endings
Checkout as-is, commit as-is
So I'm working on windows, commiting over a windows share to a linux server, and I will also push these changes to another linux server.
Now I'm a little bit unsure about this setting because I'm working on a linux server. The only windows "Thing" is my command line and that I'm editing the files using a windows share.
I would like to know, if this is the right setting for git, or if I'm doing it wrong.
Thanks
I'm not 100% clear on your setup, but here is what is happening. The files you are adding have Unix-style line endings (i.e. they end with LF). Since you picked option 1, git is just warning you that when you check these files out on your Windows box, they will have Windows-style line endings (i.e. they will end with CRLF).
Normally this is nothing to worry about, but you mention that you "will also push these changes to another linux server." If by this you mean a git push, then no worries; the line endings will be normalized to Unix-style in the repository. However, if you mean that you copy the files from your Windows box to a Linux box, then you will eventually end up copying files with Windows-style line endings to the Linux box, which you probably don't want to do. If that is the case, you are probably better off with option 3. Note that if you edit these files on your Windows box, you may even want to go option 2, so that you will always have Unix-style line endings in the repository.

uploading all files in the folder using ftp

I'm trying to copy a folder from my computer to my android phone using ftp. After I login, I try put * or put *.mp3 but it doesn't work well.
I am using command line in ubuntu linux
You want mput rather than put.

Resources