特殊:Badtitle/NS100:Forum/moving:修订间差异

来自Ubuntu中文
跳到导航跳到搜索
Wikibot留言 | 贡献
新页面: {{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...
 
Wikibot留言 | 贡献
无编辑摘要
第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

2007年11月30日 (五) 17:20的版本

{{#ifexist: :Forum/moving/zh | | {{#ifexist: Forum/moving/zh | | {{#ifeq: {{#titleparts:Forum/moving|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:Forum/moving|1|-1|}} | zh | | }}

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