官术网_书友最值得收藏!

Moving one file

Sometimes, you may want to move a file (or a directory) to a different location instead of copying and wasting disk space.

To do this, you can use the mv command. For example, you can move the file copycats.txt from Elliot's home directory to /tmp by running the mv copycats.txt /tmp command:

elliot@ubuntu-linux:~$ mv copycats.txt /tmp
elliot@ubuntu-linux:~$ ls
apple.txt carrot.txt cities d2 Desktop Downloads
banana.txt cats.txt d1 d3 dir1 Pictures
elliot@ubuntu-linux:~$ cd /tmp
elliot@ubuntu-linux:/tmp$ ls
apple.txt carrot.txt cats.txt copycats.txt d2
banana.txt cats2.txt cities d1 d3

Notice that copycats.txt is now gone from Elliot's home directory as it relocated to /tmp.

主站蜘蛛池模板: 兖州市| 北海市| 玉龙| 乐平市| 贺州市| 大悟县| 云霄县| 河北区| 贵南县| 揭西县| 镇赉县| 麦盖提县| 成安县| 永宁县| 浦北县| 威宁| 涟水县| 大英县| 曲阳县| 新巴尔虎左旗| 本溪市| 双桥区| 江油市| 新邵县| 河东区| 邹城市| 榆林市| 赞皇县| 铜鼓县| 泸水县| 玉龙| 民勤县| 禄丰县| 正宁县| 鸡西市| 宁安市| 和政县| 大冶市| 鄱阳县| 绿春县| 台前县|