Jump to content



Welcome to AstaHost - Dear Guest , Please Register here to get Your own website. - Ask a Question / Express Opinion / Reply w/o Sign-Up!

Toggle shoutbox Shoutbox Open the Shoutbox in a popup

@  yordan : (19 June 2013 - 02:28 PM) Long Life To Asta New Era
@  agyat : (19 June 2013 - 01:58 PM) New Era Start At Asta Or Asta Start In New Era. :unsure:
@  yordan : (16 June 2013 - 05:41 PM) You're Welcome, Agyat!
@  agyat : (16 June 2013 - 07:38 AM) Thanks Yordan...
@  velma : (16 June 2013 - 12:06 AM) I Have Asked Opa To Check For A Backup.. He'll Let Me Know Soon :)
@  velma : (16 June 2013 - 12:05 AM) T_T It Seems That Someone Has Deleted That Topic Since I Found The Url Of The Topic But It Gives Me An Error
@  yordan : (15 June 2013 - 10:31 PM) @velma : It's A Tuto On How To Create A Login Program.
@  yordan : (15 June 2013 - 10:31 PM) Happy Birthday To Youuuuuu Agyat!
@  yordan : (15 June 2013 - 10:31 PM) Ba$
@  agyat : (15 June 2013 - 04:41 PM) :(
@  agyat : (15 June 2013 - 04:41 PM) Where The Hall I Were? 15Th Is Almost At End And No-One Wished Me "happy Birthday"!!!
@  velma : (14 June 2013 - 10:39 AM) Which Tutorial Is He Searching For?
@  velma : (14 June 2013 - 10:38 AM) Which Tutorial Is He Searching For?
@  yordan : (14 June 2013 - 07:47 AM) Ok, Have A Look Tomorrow.
@  yordan : (13 June 2013 - 03:19 PM) @velma, Can You Have A Look At Feelay's Problem? Seems That His Tutorial Is Not Searchable Today.
@  Feelay : (13 June 2013 - 08:11 AM) Oh, Haha
@  velma : (12 June 2013 - 05:39 PM) T_T Lately My Levels Of Procrastination..... **sigh**
@  velma : (12 June 2013 - 05:38 PM) I'll Do It Later
@  velma : (12 June 2013 - 05:38 PM) Procrastinators.. People Who Keep Saying "i'll Do This In A Bit"
@  Feelay : (12 June 2013 - 02:05 PM) Deal Punishments To What?

Replying to How To Copy File & Folders From Linux To Windows?.


Post Options

    • Can't make it out? Click here to generate a new image

  or Cancel


Topic Summary

yordan

Posted 23 December 2010 - 01:24 PM

Hm, then i think my file is corrupted and another copy of that file also.

Your original file is probably not corrupted, simply the wanted modifications have not been made.

Dirk Wolfgang Glomp

Posted 22 December 2010 - 11:14 PM

No, the ">/tmp/trtmp" redirects the editing "sed" command to the single file named /tmp/trtmp, and the "mv /tmp/trtmp" will probably raise a syntax error, probably something like :

Regards
Yordan

Hm, then i think my file is corrupted and another copy of that file also.
The next days i try to contact my nephews for to clear this. Many thanks for your feedback.

Dirk

yordan

Posted 22 December 2010 - 01:18 PM

I guess the red marked redirection command here("<$i >/tmp/trtmp && mv /tmp/trtmp") include also the filename for the mv-command?

No, the ">/tmp/trtmp" redirects the editing "sed" command to the single file named /tmp/trtmp, and the "mv /tmp/trtmp" will probably raise a syntax error, probably something like :

Usage: mv [-I] [-i | -f] [-E{force|ignore|warn}] [--] src target
or: mv [-I] [-i | -f] [-E{force|ignore|warn}] [--] src1 ... srcN directory

Regards
Yordan

Dirk Wolfgang Glomp

Posted 22 December 2010 - 09:31 AM

Hi yordan,

Hi, Dirk,
I would like to know if I am slightly tired today, or if there is a small mistake in your script. I feel something being missing in your "mv" syntax.
I would have said :

mv /tmp/trtmp $i
Else, I would not see how the changes could be permanently written to the concerned text file.
Regards
Yordan

Personaly i am not realy familar with Linux, so i became i little help from my nephews. He send me this example for to remove all CRs in textfiles.
I guess the red marked redirection command here("<$i >/tmp/trtmp && mv /tmp/trtmp") include also the filename for the mv-command?

Dirk

yordan

Posted 22 December 2010 - 08:40 AM

for i in `find -type f`; do tr -d '\r' <$i >/tmp/trtmp && mv /tmp/trtmp


Hi, Dirk,
I would like to know if I am slightly tired today, or if there is a small mistake in your script. I feel something being missing in your "mv" syntax.
I would have said :
mv /tmp/trtmp $i
Else, I would not see how the changes could be permanently written to the concerned text file.
Regards
Yordan

Dirk Wolfgang Glomp

Posted 22 December 2010 - 06:53 AM

Many face problem while transfering file from Linux to windows and Vise versa.

My solution for this is "winscp405". Winscp is a windows freeware tool used to copy file from & to Linux machine.

To get this tool just google for " winscp405" tool and download this small package and install.

Enjoy working with Linux and windows :P

I like it to copy files with Winscp from Windows to a different PC that run Linux with a ssh-server.
Additional i use Putty to login and to telecontrol some Linux-PCs.

But there is a little different between text-files that comes from Windows and text-files that comes from Linux.
If we save a text-file with Notepad, then it contains "carriage return"-bytes at the end of every line.
A text-file saved with a Linux editor contains only "linefeed"-bytes.

For to remove "carriage return"-bytes from a text-file on a Linux-PC i use this script:
#!/bin/sh
 for i in `find -type f`; do tr -d '\r' <$i >/tmp/trtmp && mv /tmp/trtmp
Additional i have written a little aplications for to run under DOS/Windows for to remove "carriage return"-bytes from smaller text-files(<64KB).
;  Sourcecode for MASM 5
   .MODEL SMALL
.386
  CODE SEGMENT use16 'CODE'
 assume cs:CODE,ds:DATEN,ss:STAPEL
 org 100h

START: mov	  ax, DATEN
		  mov	  ds, ax
		  mov	  bx, ss		   ; zunächst die beiden Segmentadressen
		  mov	  ax, es		   ; voneinander abziehen. Das ergibt die
		  sub	  bx, ax		   ; Anzahl der Paragraphen vom PSP bis
									; zum Anfang des Stack
		  mov	  ax, sp		   ; da sich der Stackpointer am Ende des
		  add	  ax, 0Fh		  ; Stacksegments befindet, gibt sein
		  shr	  ax, 4			; Inhalt die Länge des Stacks an
		  add	  bx, ax		   ; zur bisherigen Länge hinzuaddieren
		  mov	  ah, 4Ah		  ; neue Größe an das DOS übergeben
		  int	21h

		  mov	  bx, 1000h		; 64 KB anfordern/reservieren
		  mov	  ah, 48h		  ; anfordern/reservieren:  BX = Anzahl/16
		  int	21h
		  jc  NOSPACE			   ; keine 64 KB		= Fehler !
		  mov	  [FILSEG], ax	   ; Segment des File's
		  mov	  fs, ax
;----------------------------------------------------------------------------
		  mov	  ah, 62h		  ; Segment des PSP's ermitteln
		  int	21h
		  mov	  ds, bx		   ; PSP-Segment nach DS
		  mov	  es, bx
		  mov	  di, 80h		  ; Länge Kommandozeile
		  mov	  cl, [di]		 ; nach CL
		  cmp	  cl, 2
		  jna NOPARA
		  cld					   ; aufwärts zählen
		  inc	  di
		  mov	  al, 20h
		  repe scasb				; erste Leerzeichen überspringen
		  dec	  di			   ; ein zurück
		  mov	  bp, di

SUCHCR:   cmp	 BYTE PTR[di], 0Dh
		  jz  short FOUND
		  inc	  di
		  jmp SUCHCR
;------------------------------------
FOUND:	mov	 WORD PTR[di], 2400h; hinter filenamen: 0,"$"
		  mov	  ax, fs
		  mov	  cx, es
		  mov	  fs, cx
		  mov	  es, ax
;----------------------------------------------------------------------------
		  mov	  dx, bp		   ; Zeiger auf 1.ASCII
		  mov	  ax, 3D02h		; Datei öffnen: lesen/schreiben   (OPEN)
		  int	21h
		  jc  NOFILE				; File nicht gefunden = Fehler !
		  mov	  bx, ax

		  mov	  ax, DATEN
		  mov	  ds, ax
		  xor	  dx, dx		   ;  low  auf Anfang stellen
		  xor	  cx, cx		   ;  high auf Anfang stellen
		  mov	  ax, 4202h		; Länge holen: vom Ende		  (LSEEK)
		  int	21h
		  and	  dx, dx		   ;  High-word = null ?
		  jnz TOBIG				 ; nein zurück
		  mov	  [FILEN], ax		; Anzahl retten

		  mov	  dx, 1			; low	holen
		  xor	  cx, cx		   ; high   holen
		  mov	  ax, 4200h		; Zeiger positionieren: vom Anfang(LSEEK)
		  int	21h				;   nochmal wegen DOS-Fehler
		  xor	  dx, dx		   ; low	holen
		  xor	  cx, cx		   ; high   holen
		  mov	  ax, 4200h		; Zeiger positionieren: vom Anfang(LSEEK)
		  int	21h

		  mov	  cx, [FILEN]	 ; Anzahl zu ladender Byte's
		  mov	  ds, [FILSEG]
		  mov	  ah, 3Fh		  ; Datei lesen u. Zeiger bewegen   (READ)
		  int	21h
		  mov	  cx, ax
		  mov	  ah, 3Eh		  ; Datei schließen				(CLOSE)
		  int	21h
;----------------------------------------------------------------------------
		  mov	  ax, DATEN
		  mov	  ds, ax
		  xor	   si, si
		  mov	 [FILEN], cx

SUCHE:	cmp	  si, cx		   ;  Ende des File erreicht ?
		  ja  short ZMA
		  cmp	 BYTE PTR es:[si], 0Dh
		  jz  short SCHR
		  inc	  si
		  jmp  short SUCHE
;------------------------------------
SCHR:	 dec	 WORD PTR[FILEN]
		  sub	  cx, si
		  mov	  di, si
		  inc	  si
		  mov	  ds, [FILSEG]
		  dec	  cx
		  mov	  dx, si
		  rep movsb

		  mov	  ax, DATEN
		  mov	  ds, ax
		  mov	  si, dx
		  mov	  cx, [FILEN]
		  jmp  short SUCHE
;----------------------------------------------------------------------------
ZMA:	  mov	  ax, fs
		  mov	  dx, 82h
		  xor	  cx, cx
		  mov	  ds, ax
		  mov	  ah, 3Ch		  ;  Datei erstellen (CREATE)
		  int	21h
		  mov	  bx, ax

		  mov	  ax, DATEN
		  mov	  ds, ax
		  xor	  dx, dx
		  mov	  cx, [FILEN]
		  mov	  ds, [FILSEG]
		  mov	  ah, 40h		  ;  Datei beschreiben			 (WRITE)
		  int	21h
;----------------------------------------------------------------------------
NBACK:	mov	  ah, 3Eh		  ; Datei schließen				(CLOSE)
		  int	21h

BACKE:	mov	  ax, 4C00h
		  int	21h
;---------------------------------------------------------------------------
 NOSPACE:  mov	  dx, OFFSET ERRTEXT
		  mov	  ah, 9
		  int	21h
		  jmp  short BACKE
;------------------------------------
NOPARA:   mov	  ax, DATEN
		  mov	  ds, ax
		  mov	  dx, OFFSET PARERR
		  mov	  ah, 9
		  int	21h
		  jmp  short BACKE
;------------------------------------
NOFILE:   mov	  ax, DATEN
		  mov	  ds, ax
		  mov	  dx, OFFSET FILERR
		  mov	  ah, 9
		  int	21h
		  mov	  ax, fs
		  mov	  ds, ax
		  mov	  dx, bp
		  mov	  ah, 9
		  int	21h
		  jmp  short BACKE
;------------------------------------
TOBIG:	mov	  dx, OFFSET BIGERR
		  mov	  ah, 9
		  int	21h
		  jmp  short NBACK
  CODE ends
;---------------------------------------------------------------------------
   DATEN SEGMENT use32 'DATA'

FILSEG	DW 0FFFFh				 ; Segment des File`s

FILEN	 DW 0FFFFh				 ; Anzahl der geladenen Byte`s

FILERR	DB 0Dh, 0Ah
		  DB "FEHLER ! File auf (angegebenen) Laufwerk/Pfad nicht gefunden = $"

PARERR	DB 0Dh, 0Ah
		  DB "FEHLER ! Kein Filename als Parameter angehängt/übergeben !$"

ERRTEXT   DB 0Dh, 0Ah
		  DB "FEHLER ! Zu wenig Arbeits-Speicher vorhanden !"
		  DB 0Dh, 0Ah, 0Dh, 0Ah
		  DB "Das Programm benötigt zur Ausführung, ca. 64 KB freien Arbeits-Speicher !"
		  DB "$"

BIGERR	DB 0Dh, 0Ah
		  DB "FEHLER ! File ist größer als 64KB !$"
  DATEN ends
;---------------------------------------------------------------------------
   STAPEL SEGMENT use16 STACK 'STACK'
	   DB 20h dup (0FFh)
  STAPEL ends
;---------------------------------------------------------------------------
  end
Dirk

derekchoi2

Posted 21 December 2010 - 04:31 PM

you talking about on same computer or different?

if same, i use a flash drive, or for some of the larger files, ill use my external hard-drive. another method is to use an online backup service to "backup" the file, then download from the other partition. directly mounting and copying files is also available, as linux has support for ntfs partitions without any extra programs. on windows you will have to install another program, something along th

if different, i usually prefer transferring directly, so i transfer files over ftp, sometimes also over online backup services such as dropbox. this is basically the same as the methods used if the operating systems are on the same machine, but without the direct mounting and copying and adding the method of ftp.

good luck with things!

starscream

Posted 21 December 2010 - 02:57 PM

But sometimes when I copy some file or folder from USB to windows drive using ubuntu.Then sometimes I am able to find that file in both operating systems.

By any chance you're working with system files or hidden files. If hidden files are set to not viewable i winodws then not matter which file is that will not be viewable. Also some system files can't be copied or edited so that could be one more reason. As far as i know, this could be the reason for not able to copy or view the files in USB drive.

Posted 22 November 2010 - 07:40 AM

samba from command promptHow To Copy File & Folders From Linux To Windows?.

how can I run samba from command prompt.  each time I do it says CMD does not support UNC path as current directories.

-question by Ankit

 


Posted 12 November 2009 - 07:55 PM

How to find what files are located on a partitionHow To Copy File & Folders From Linux To Windows?.

Hi,

I needed to clean up some of the files in Linux parition /dev/sda3. When I run du -f it shows that /dev/sda3 is full and its the root(/). How can I find out what other folders and files on this partition?

Thanks in advance,

Ram. 

 


Review the complete topic (launches new window)