Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Rename the file name from Parent directory Post 302997077 by Gurjeet Singh on Sunday 7th of May 2017 03:11:57 PM
Old 05-07-2017
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.

Code:
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

Code:
mv File1.msg File2.msg

.


But can i can run from parent directory if i already know the directory Path.

Any help would be much appreciated

Thanks
Gurjeet

Last edited by Scrutinizer; 05-07-2017 at 04:47 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

full path of a file situated either in parent's dir. or parent's parent dir. so on...

hi experts(novice people can stay away as it is no child's game), i am developing a script which works like recycle bin of windows. the problem i am facing is that when ever i am trying to delete a file which is situated in parent directory or parent's parent directory i am unable to... (1 Reply)
Discussion started by: yahoo!
1 Replies

2. Shell Programming and Scripting

Rename a file after the name of its parent dir

Started a thread in beginners but I thought someone from this forum may have an idea as well. Thanks! EDITED BY REBORG (3 Replies)
Discussion started by: robotsbite
3 Replies

3. Shell Programming and Scripting

Get parent directory of a file

In shell how would I get the parent directory of a file. E.g. I feed this in: /path/to/textfile.txt And get just: /path/to Thanks (2 Replies)
Discussion started by: pcwiz
2 Replies

4. AIX

Parent directory seems to disappear if child fails rename

If I have a file/folder that a user does not have permission to and I try to rename it, it removes the entire parent folder. At that point it is only visible in a ls. (Not a ls -l, file, more, cd). It happens on every filesystem. This is Aix 5.3 $ cd test $ ls -la total 0 drwxr-xr-x 2 root ... (4 Replies)
Discussion started by: scriptr2be
4 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

Traverse file structure from top and rename the immediate parent

Hello All, I am trying to write a script to:- 1. Traverse entire file system, look for directories which has .git directory in it 2. Rename the immediate parent directory to <orignal_name.git> 3. Traverse new file structure and look for all directories with <original_name>.git 4. cd to... (2 Replies)
Discussion started by: sahil_jammu
2 Replies

7. 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

8. Shell Programming and Scripting

Parent Child directory and file details

Kindly help below command details in UNIX. 1.What is the Unix command to see parent and child directory details starting from root directory in tree structure using LS-LRT or any other way 2.What is the Unix command to see parent and child directory details starting from root directory in... (2 Replies)
Discussion started by: skp
2 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

Sourcing file from parent directory bash

"Debian 9 64x - LXDE" I try to source a file from my parent directory: #!/bin/bash #source.bash . ../links.bash but i get "file not found". I tried . "../links.bash" and . '../links.bash'. I got on all methods the same result. If i use the absolute path it works, but i don't want to... (4 Replies)
Discussion started by: int3g3r
4 Replies
RAIDFILE.CONF(5)						    Box Backup							  RAIDFILE.CONF(5)

NAME
raidfile.conf - Userland RAID for Box Backup SYNOPSIS
/etc/box/raidfile.conf DESCRIPTION
The raidfile.conf is usually generated by raidfile-config(8) but may be manually edited if the store locations move or if more than one disc set is required. discX Specifies a set of discs. SetNumber The set number of the RAID disc, referenced by each account. BlockSize The block size of the file system (usually 2048). Under BSD with FFS, set this to your file system's fragment size (most likely an 8th of the block size). Dir0 The first directory in the RAID array. Dir1 The second directory in the RAID array. If you do not wish to use the built-in RAID functionality, this field should be set to the same as Dir0. You should not use the built-in RAID if you have a hardware RAID solution or if you're using another type of software RAID (like md on Linux). Dir2 The third directory in the RAID array. The same notes that apply to Dir2 also apply to Dir3. FILES
/etc/box/raidfile.conf SEE ALSO
raidfile-config(8), bbstored.conf(5) AUTHORS
Ben Summers Per Thomsen James O'Gorman Box Backup 0.11 10/28/2011 RAIDFILE.CONF(5)
All times are GMT -4. The time now is 03:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy