Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Rename file in directory using contents within each file Post 303042581 by nezabudka on Monday 30th of December 2019 10:41:15 PM
Old 12-30-2019
Quote:
Originally Posted by RudiC
...
and the respective lsof output (before and after (but before file closing) the mv operation) :
Code:
awk     2885 user    3r   REG   8,41      477    171 /mnt/9/file1
.
.
.
awk     2885 user    3r   REG   8,41      477    171 /mnt/9/file1 (deleted)

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.
Hi @RudiC
I'm embarrassed to ask how can I repeat this conclusion. Broke all my spears Smilie
Can't beat these elusive moments of time.
Thanks
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

SED To insert Directory Contents to file

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)
Discussion started by: NomDeGuerre
3 Replies

2. Shell Programming and Scripting

Read File and use contents to rename another

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)
Discussion started by: Shark Tek
10 Replies

3. Shell Programming and Scripting

A script that will move a file to a directory with the same name and then rename that file

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)
Discussion started by: marcozd
7 Replies

4. UNIX for Dummies Questions & Answers

Help with searching for a file in a directory and copying the contents of that file in a new file

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)
Discussion started by: zel2zel
6 Replies

5. Shell Programming and Scripting

Rename multiple file names in a directory

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)
Discussion started by: hari001
4 Replies

6. Shell Programming and Scripting

Rename last directory in a file structure

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)
Discussion started by: ramse8pc
3 Replies

7. Shell Programming and Scripting

How to read contents in each file and rename the file?

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)
Discussion started by: nanduedi
3 Replies

8. Shell Programming and Scripting

Remove or rename based on contents of file

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)
Discussion started by: cmccabe
5 Replies

9. Shell Programming and Scripting

Rename specific file extension in directory with match to another file in bash

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)
Discussion started by: cmccabe
1 Replies

10. UNIX for Beginners Questions & Answers

Rename the file name from Parent directory

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
FLS(1)							      General Commands Manual							    FLS(1)

NAME
fls - List file and directory names in a disk image. SYNOPSIS
fls [-adDFlpruvV] [-m mnt ] [-z zone ] [-f fstype ] [-s seconds ] [-i imgtype ] [-o imgoffset ] [-b dev_sector_size] image [images] [ inode ] DESCRIPTION
fls lists the files and directory names in the image and can display file names of recently deleted files for the directory using the given inode. If the inode argument is not given, the inode value for the root directory is used. For example, on an NTFS file system it would be 5 and on a Ext3 file system it would be 2. The arguments are as follows: -a Display the "." and ".." directory entries (by default it does not) -d Display deleted entries only -D Display directory entries only -f fstype The type of file system. Use '-f list' to list the supported file system types. If not given, autodetection methods are used. -F Display file (all non-directory) entries only. -l Display file details in long format. The following contents are displayed: file_type inode file_name mod_time acc_time chg_time cre_time size uid gid -m mnt Display files in time machine format so that a timeline can be created with mactime(1). The string given as mnt will be prepended to the file names as the mounting point (for example /usr). -p Display the full path for each entry. By default it denotes the directory depth on recursive runs with a '+' sign. -r Recursively display directories. This will not follow deleted directories, because it can't. -s seconds The time skew of the original system in seconds. For example, if the original system was 100 seconds slow, this value would be -100. This is only used if -l or -m are given. -i imgtype Identify the type of image file, such as raw or split. Use '-i list' to list the supported types. If not given, autodetection methods are used. -o imgoffset The sector offset where the file system starts in the image. -b dev_sector_size The size, in bytes, of the underlying device sectors. If not given, the value in the image format is used (if it exists) or 512-bytes is assumed. -u Display undeleted entries only -v Verbose output to stderr. -V Display version. -z zone The ASCII string of the time zone of the original system. For example, EST or GMT. These strings must be defined by your operating system and may vary. image [images] One (or more if split) disk or partition images whose format is given with '-i'. Once the inode has been determined, the file can be recovered using icat(1) from The Coroners Toolkit. The amount of information recovered from deleted file entries varies depending on the system. For example, on Linux, a recently deleted file can be easily recovered, while in Solaris not even the inode can be determined. If you just want to find what file name belongs to an inode, it is easier to use ffind(1). EXAMPLES
To get a list of all files and directories in an image use: # fls -r image 2 or just (if no inode is specified, the root directory inode is used): # fls -r image To get the full path of deleted files in a given directory: # fls -d -p image 29 To get the mactime output do: # fls -m /usr/local image 2 If you have a disk image and the file system starts in sector 63, use: # fls -o 63 disk-img.dd If you have a disk image that is split use: # fls -i "split" -o 63 disk-1.dd disk-2.dd disk-3.dd SEE ALSO
ffind(1), icat(1) AUTHOR
Brian Carrier <carrier at sleuthkit dot org> Send documentation updates to <doc-updates at sleuthkit dot org> FLS(1)
All times are GMT -4. The time now is 07:15 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy