Sponsored Content
Full Discussion: mv directories question
Top Forums UNIX for Dummies Questions & Answers mv directories question Post 302389774 by Scrutinizer on Monday 25th of January 2010 08:09:37 PM
Old 01-25-2010
Unless a directory pre-existed in you home directory , the effect will likely have been that your original file was renamed to (a file with) the same name as your intended target directory.

So with "targetdirname" being the new name of the wrongfully renamed file:
Code:
mv targetdirname originalfilename

should suffice to reverse the operation and rename it back to originalfilename.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

check if multiple directories exist else create missing directories

Hi , I 'm trying to check if multiple directories exist on a server, if not create the missing ones and print " creating missing directory. how to write this in a simple script, I have made my code complex if ; then taskStatus="Schema extract directory exists, checking if SQL,Count and... (7 Replies)
Discussion started by: ramky79
7 Replies

2. Shell Programming and Scripting

Script for parsing directories one level and finding directories older than n days

Hello all, Here's the deal...I have one directory with many subdirs and files. What I want to find out is who is keeping old files and directories...say files and dirs that they didn't use since a number of n days, only one level under the initial dir. Output to a file. A script for... (5 Replies)
Discussion started by: ejianu
5 Replies

3. Programming

question about empty directories in unix system

how is it possible for a directory to be empty and still have a size greater than 0 in bytes... i made a shell script that shows info about all files/directories and this is what came up the last one is the size, here its showing 1024 in the for loop i did something like for h in * .*; do ... (4 Replies)
Discussion started by: omega666
4 Replies

4. Shell Programming and Scripting

question on blackslashes and slashes in directories

Since I'm usually on windows I've came across different shells like Cygwin, Hamilton, and MKS. I've been working in csh most of the time, so porting scripts from one shell to another can be fairly annoying and confusing. When specifying a directory I noticed that certain shells do not recognize... (1 Reply)
Discussion started by: vas28r13
1 Replies

5. UNIX for Dummies Questions & Answers

Using grep command to find the pattern of text in all directories and sub-directories.

Hi all, Using grep command, i want to find the pattern of text in all directories and sub-directories. e.g: if i want to search for a pattern named "parmeter", i used the command grep -i "param" ../* is this correct? (1 Reply)
Discussion started by: vinothrajan55
1 Replies

6. Shell Programming and Scripting

How to list all the files, directories and sub-directories in the current path except one directory?

Can anyone come up with a unix command that lists all the files, directories and sub-directories in the current directory except a folder called log.? Thank you in advance. (7 Replies)
Discussion started by: Manjunath B
7 Replies

7. UNIX for Dummies Questions & Answers

List the directories, having given pattern in the directories name, sorted by creation date

It is for HP-Unix B.11.31. Requirement: 1. List the directories, having given pattern in the directories name, sorted by creation date. Example: Directories with name "pkg32*" or "pkg33*" 2. On the output of 1. list the directories by creation date as sort order, with creation date... (2 Replies)
Discussion started by: Siva SQL
2 Replies

8. UNIX for Dummies Questions & Answers

Linux question on directories..

Hi, First server every thing is working but keeps crashing so to be on the safe side created second server and moved all the files. But I notice there is a " dot " at the end. See below. Not sure what that means. Also getting 403 on Apache. Please see below. Thanks you so much. ls -l... (4 Replies)
Discussion started by: samnyc
4 Replies

9. Solaris

Giving read write permission to user for specific directories and sub directories.

I have searched this quite a long time but couldn't find the right method for me to use. I need to assign read write permission to the user for specific directories and it's sub directories and files. I do not want to use ACL. This is for Solaris. Please help. (1 Reply)
Discussion started by: blinkingdan
1 Replies
VOP_RENAME(9)						   BSD Kernel Developer's Manual					     VOP_RENAME(9)

NAME
VOP_RENAME -- rename a file SYNOPSIS
#include <sys/param.h> #include <sys/vnode.h> int VOP_RENAME(struct vnode *fdvp, struct vnode *fvp, struct componentname *fcnp, struct vnode *tdvp, struct vnode *tvp, struct componentname *tcnp); DESCRIPTION
This renames a file and possibly changes its parent directory. If the destination object exists, it will be removed first. Its arguments are: fdvp The vnode of the old parent directory. fvp The vnode of the file to be renamed. fcnp Pathname information about the file's current name. tdvp The vnode of the new parent directory. tvp The vnode of the target file (if it exists). tcnp Pathname information about the file's new name. LOCKS
The source directory and file are unlocked but are expected to have their ref count bumped on entry. The VOP routine is expected to vrele(9) both prior to returning. The destination directory and file are locked as well as having their ref count bumped. The VOP routine is expected to vput(9) both prior to returning. ERRORS
[EPERM] The file is immutable. [EXDEV] It is not possible to rename a file between different file systems. [EINVAL] An attempt was made to rename . or .., or to perform an operation which would break the directory tree structure. [ENOTDIR] An attempt was made to rename a directory to a file or vice versa. [ENOTEMPTY] An attempt was made to remove a directory which is not empty. SEE ALSO
vnode(9) AUTHORS
This manual page was written by Doug Rabson. BSD
July 24, 1996 BSD
All times are GMT -4. The time now is 08:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy