- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: mv command
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2015 12:28 PM
05-12-2015 12:28 PM
mv command
#pwd
#/tmp
#ls -ltr
-rwx-rwx-rwx. data.zip
#mv data.zip /log
From the above command what will happen. Please explain
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2015 12:31 PM
05-12-2015 12:31 PM
Re: mv command
mv log /tmp
Or
mv log /tmp/
From the above command which one is correct
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2015 01:00 PM
05-12-2015 01:00 PM
Re: mv command
Your first question:
>>>> #mv data.zip /log
>>>> From the above command what will happen. Please explain
Well, the simple explanation is that the data.zip file will be moved from the /tmp directory to the /log directory.
Without know **exactly** how the 'mv' code is written, the file is likely copied from the current location to the new location and once the copy is verified the file is removed from the original location.
Your second question:
>>>> mv log /tmp
>>>> Or
>>>> mv log /tmp/
>>>> From the above command which one is correct
It doesn't matter. Either one will do the same thing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2015 07:54 PM
05-12-2015 07:54 PM
Re: mv command
From the command not create log directory in /. it will create log file. In /
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2015 11:11 PM
05-12-2015 11:11 PM
Re: mv command
> From the command not create log directory in /. it will create log file. In /
Everything's complicated. A command like:
mv path1/name1 path2/name2
can do different things, depending on what path2/name2 is. If
path2/name2 is an existing directory, then the file at path1/name1 will
be moved into that directory, becoming "path2/name2/name1".
If path2/name2 does not exist, then the file at path1/name1 will be
moved to a file at "path2/name2". (And if path2/name2 is an existing
regular file, then it will be overwritten.)
If you want the file "data.zip" to be moved into the _directory_
"/log", and you don't know if the directory "/log" exists, then you
might be happier with a command like:
mv data.zip /log/data.zip
or:
mv data.zip /log/
either of which makes it clear that "/log" is expected to be a
directory. And these commands should fail if "/log" is not a directory.
> mv log /tmp
> Or
> mv log /tmp/
> From the above command which one is correct [?]
Sadly, that's not enough information. The result depends on whether
"/tmp" is a directory. The second one is probably what you want, but
the first can work if "/tmp" is a directory.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2015 11:26 PM
05-12-2015 11:26 PM
Re: mv command
I want to move data.zip file to /tmp/log
#pwd
#/tmp
#ls -ltr
-rwx-rwx-rwx. data.zip
#mv data.zip /log
But I unfortunately u missed to put tmp in the above command
So any impact happen from the above command
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2015 09:58 AM
05-13-2015 09:58 AM
Re: mv command
> So any impact happen from the above command
Is that a question? If so, then using a question mark ("?") can be
helpful.
Define "impact"? Which "the above command"? If you moved a file
into the wrong place, then you should be able to move it from there into
the right place.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2015 10:58 AM
05-14-2015 10:58 AM
Re: mv command
impact?
Well if /log is suppost be on a different file system and is not mounted. You risk filling the / file system depending on the size of the file being moved.
If there is no /log at all. Then you likely to create a file called "log" in the / file system.