个人工具

“UbuntuHelp:Forum/moving”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
(新页面: {{From|https://help.ubuntu.com/community/forum/moving}} {{Languages|UbuntuHelp:forum/moving}} The how to has been pulled together in credit by darkmatter from Ubuntu Forums. The How To ha...)
 
 
(未显示同一用户的1个中间版本)
第2行: 第2行:
 
{{Languages|UbuntuHelp:forum/moving}}
 
{{Languages|UbuntuHelp:forum/moving}}
 
The how to has been pulled together in credit by darkmatter from Ubuntu Forums. The How To has been edited and published by SteveMyers.
 
The how to has been pulled together in credit by darkmatter from Ubuntu Forums. The How To has been edited and published by SteveMyers.
 
 
 
The direct steps are provided on moving a file from one directory to another by the command line, in doing so the serial.txt is being used as an example of how to move a file from one side of the HD to the other.
 
The direct steps are provided on moving a file from one directory to another by the command line, in doing so the serial.txt is being used as an example of how to move a file from one side of the HD to the other.
 
 
-------------------------------------------
 
-------------------------------------------
 
 
To move !serial.txt to math (as root - since the output you listed was from your root account), type the following in a terminal.
 
To move !serial.txt to math (as root - since the output you listed was from your root account), type the following in a terminal.
 
 
<pre><nowiki>
 
<pre><nowiki>
 
mv ~/!serial.txt ~/math
 
mv ~/!serial.txt ~/math
 
</nowiki></pre>
 
</nowiki></pre>
 
 
 
The '~' is a 'shorthand' representation for the 'home' folder of the account you are running from. For example, If the above files were on my system under my user account, I could move the .txt by the following
 
The '~' is a 'shorthand' representation for the 'home' folder of the account you are running from. For example, If the above files were on my system under my user account, I could move the .txt by the following
 
Code:
 
Code:
 
 
<pre><nowiki>
 
<pre><nowiki>
 
mv /home/darkmatter/!serial.txt /home/darkmatter/math
 
mv /home/darkmatter/!serial.txt /home/darkmatter/math
 
</nowiki></pre>
 
</nowiki></pre>
 
 
 
Running as root, and the above files were in my root directory, I would move the .txt with
 
Running as root, and the above files were in my root directory, I would move the .txt with
 
 
<pre><nowiki>
 
<pre><nowiki>
 
mv /root/!serial.txt /root/math
 
mv /root/!serial.txt /root/math
 
</nowiki></pre>
 
</nowiki></pre>
 
 
 
To save on typing, I can substitute '~' in place of the home directory. So for either of the above situations, the command would look the same:
 
To save on typing, I can substitute '~' in place of the home directory. So for either of the above situations, the command would look the same:
 
 
<pre><nowiki>
 
<pre><nowiki>
 
mv ~/!serial.txt ~/math
 
mv ~/!serial.txt ~/math
 
</nowiki></pre>
 
</nowiki></pre>
 
 
 
The same files, if in the root account, could also be moved with the sudo command from my user account, but i would need to give the full path to the file, as well as the math directory
 
The same files, if in the root account, could also be moved with the sudo command from my user account, but i would need to give the full path to the file, as well as the math directory
 
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo mv /root/!serial.txt /root/math
 
sudo mv /root/!serial.txt /root/math
 
</nowiki></pre>
 
</nowiki></pre>
 
 
 
Special Reference In a terminal, type
 
Special Reference In a terminal, type
 
 
<pre><nowiki>
 
<pre><nowiki>
 
man bash
 
man bash
 
</nowiki></pre>
 
</nowiki></pre>
 
----
 
----
[[category:CategoryForum]] [[category:CategoryDocumentation]]
+
[[category:CategoryForum]]
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2009年5月12日 (二) 16:52的最新版本

The how to has been pulled together in credit by darkmatter from Ubuntu Forums. The How To has been edited and published by SteveMyers. The direct steps are provided on moving a file from one directory to another by the command line, in doing so the serial.txt is being used as an example of how to move a file from one side of the HD to the other.


To move !serial.txt to math (as root - since the output you listed was from your root account), type the following in a terminal.

mv ~/!serial.txt ~/math

The '~' is a 'shorthand' representation for the 'home' folder of the account you are running from. For example, If the above files were on my system under my user account, I could move the .txt by the following Code:

mv /home/darkmatter/!serial.txt /home/darkmatter/math

Running as root, and the above files were in my root directory, I would move the .txt with

mv /root/!serial.txt /root/math

To save on typing, I can substitute '~' in place of the home directory. So for either of the above situations, the command would look the same:

mv ~/!serial.txt ~/math

The same files, if in the root account, could also be moved with the sudo command from my user account, but i would need to give the full path to the file, as well as the math directory

sudo mv /root/!serial.txt /root/math

Special Reference In a terminal, type

man bash