As long as a mv operation is performed on the same file system -
.
.
.
Even if the file is moved between file systems, there should not be a problem as long as the file is kept open. Even though the file and it's contents ARE moved by the mv command, the OS keeps the file readable until it is closed and unlinked. See below, using nezabudka's one liner extended by mv's -v (--verbose) option
and the respective lsof output (before and after (but before file closing) the mv operation) :
Even though attributed "deleted", the file's contents is still available and readable. Of course, once unlinked, the file can't be reopened / reused in its original location.
I am on a HP-UX machine I have a directory called "/u01/blobs" and the files look like this:
ls -1
7398
7399
7400
I need to produce a comma delimited file with the following format:
filename,location/filename
i.e:
7398,/u01/blobs/7398
7399,/u01/blobs/7399
7400,/u01/blobs/7400
What... (3 Replies)
Hello guys, thank God that I found this forum.
I hope that someone can help me because I don't have any idea on how to start it. I know that for some of you this is a very simple task but I'm not as advance on shell scripting like many people out there.
I got this file with a permanent... (10 Replies)
Hello all.
I am new to this forum (and somewhat new to UNIX / LINUX - I started using ubuntu 1 year ago).:b:
I have the following problem that I have not been able to figure out how to take care of and I was wondering if anyone could help me out.:confused:
I have all of my music stored in... (7 Replies)
Hi guys, I am a newbie here :wall:
I need a script that can search for a file in a directory and copy the contents of that file in a new file.
Please help me. :confused: Thanks in advance~ (6 Replies)
I hope some one can help me
I have multiple files in a directory with out extension like as below mentioned. But i want to change all the file names along .DDMMYYYYHHMISS format. And all files should have same DDMMYYYYHHMISS.
Scenario:
direcory name = /vol/best/srcfiles
files in a... (4 Replies)
I have to write a script to rename the every last sub-directory in a directory structure if the last sub-directory name doesn't contain "submitted".
eg:
given directory path:/u01/home/somedir
somedir can have many subdirectories and each subdirectory inturn has many subdirectories.
somedir... (3 Replies)
Hello All,
Can you help me in writing a script for reading the specific position data in a file and if that data found in that file that particular file should be renamed.
Ex: Folder : C:\\test
and Filename : CLSACK_112214.txt,CLSACK_112314.txt,CLSACK_112414.txt
Contents in the file would... (3 Replies)
I am trying to use the two files shown below to either remove or rename contents in one of those files. If in file1.txt $5 matches $5 of file2.txt and the value in $1 of file1.txt is not "No Match" then that value is substituted for all values in $5 and $1 of file2.txt. If however in $1 ... (5 Replies)
I have a specific set (all ending with .bam) of downloaded files in a directory /home/cmccabe/Desktop/NGS/API/2-15-2016. What I am trying to do is use a match to $2 in name to rename the downloaded files. To make things a more involved the date of the folder is unique and in the header of name... (1 Reply)
Hi All,
Just started learning unix and stuck into below issue.
Suppose i have folder structure as below.
Dir1/Dir2/Dir3/File1.msg
I am looking to rename the file name from File1.msg to File2.msg but from the parent Dir1
From Dir3 i can easily run the command like
mv File1.msg... (2 Replies)
Discussion started by: Gurjeet Singh
2 Replies
LEARN ABOUT HPUX
efi_cp
efi_cp(1M)efi_cp(1M)NAME
efi_cp - copy to or from EFI file
SYNOPSIS
devicefile] file1 file2
devicefile] file1 [file2]... dest-directory
devicefile] file_or_dir1 [file_or_dir2]... dest-directory
DESCRIPTION
copies files between HP-UX and EFI file systems.
The EFI file system is based on the FAT file system and used by the Itanium-based system BIOS to locate an HP-UX bootloader. See efi(4).
Without the option, copies from an HP-UX file system to the EFI volume specified by devicefile; in this case, the destination should be
relative to the root of the EFI volume specified by devicefile. Use the option to copy from an EFI file system to an HP-UX file system;
with the option, only a single regular file may be copied at a time.
With two arguments:
o If file2 does not exist, creates it and copies the contents of file1 into file2.
o If file2 exists and is a regular file, deletes the the contents of file2 and copies the contents of file1 into file2.
o If file2 exists and is a directory, creates a copy of file1 in that directory.
With more than two arguments, the final argument must be an existing directory. If any of the other arguments is a directory, you must use
the option, which specifies that the source directory and the subtree rooted there are to be copied to the destination directory.
Options
Options can be used singly or combined in any order before the file names. The space between option and argument is optional.
devicefile is the device special file of the EFI file system to be copied. Without the option, uses the device file specified in the
environment variable if it is defined. The option overrides the environment variable.
Recursively copy the subtree rooted at each source directory to
the destination directory.
Copy file1 from an EFI volume to file2 in HP-UX file system. file1 should be relative to the root of the EFI volume specified by
devicefile, not to an HP-UX file system. With the option, only a single regular file may be copied at a time.
RETURN VALUE
returns exit code 0 if the copy is successful. Otherwise it prints a diagnostic message and returns nonzero.
0 Successful completion.
>0 Error condition occurred.
EXAMPLES
All the following examples copy to or from the EFI file system on device
Copy into directory in the EFI file system on the specified device:
Copy all files in current directory into directory in the EFI file system on the specified device
Copy into directory in the EFI file system on the specified device and rename it
Copy into the EFI boot directory of the EFI file system on the specified device:
Copy into of the EFI file system on the device specified in the environment variable and rename it to
Copy from the EFI file system on the specified device into the current HP-UX directory:
Using a persistent device special file (dsf) copy from the EFI file system on the specified device into the current HP-UX directory (see
intro(7)):
AUTHOR
was developed by HP.
SEE ALSO efi_fsinit(1M), efi_ls(1M), efi_mkdir(1M), efi_rm(1M), efi_rmdir(1M), efi(4), intro(7).
Itanium(R)-based Systems Only efi_cp(1M)