Birmingham mumbai



Download 15,21 Mb.
Pdf ko'rish
bet167/482
Sana13.01.2022
Hajmi15,21 Mb.
#355107
1   ...   163   164   165   166   167   168   169   170   ...   482
Bog'liq
Mastering Ubuntu Server Gain expertise in the art of deploying, configuring, managing, and troubleshooting Ubuntu Server by Jay LaCroix (z-lib.org)

[
 120 
]
With the first example, we're assuming that 
file1
 is in our current working 
directory. We're grabbing that file and moving it to 
/path/to/new/directory
 
and giving it the same name of 
file1
 in that new directory. Just like with the 
cp
 
command, we could've omitted the filename at the target, since it's staying the same. 
If the file already exists at the target directory with that name, it will be overwritten. 
So, the 
mv
 command is also potentially destructive, but more so when compared to 
cp
 
since you are moving, instead of copying.
The second 
mv
 command is a bit more interesting, because in that example we're 
renaming a file. In Linux, there's no dedicated rename command, so the 
mv
 command 
is used for that purpose. In fact, 
mv
 is somewhat of a Swiss army knife due to the fact 
it serves multiple purposes. With it, you can move a file or directory, rename it, and 
also move a file to overwrite another file in a different location. It all depends on the 
source and destination paths. If the target exists, it will be overwritten. If not, the file 
will be renamed and/or moved to that path.
When managing files, you'll certainly come to a situation where you need to manage 
multiple files or directories. It's worth noting that the 
cp
 command, as well as the 
mv
 
command, can be used with multiple objects at once; for example, if you have three 
directories, such as 
dir1

dir2
, and 
dir3
, and you need to move them into a new sub-
directory. You
 could execute three 
mv
 commands to move each one separately, but 
you can also move all three with a single 
mv
 command:
mv dir1 dir2 dir3 /path/to/new/location
The same holds true with 
cp
 and with files; both 
cp
 and 
mv
 are set up to allow you to 
move or copy multiple directories or files with a single command.
Now that we know how to move files around, we should also take a look at how to 
edit them. There are many text editors available to us on the Ubuntu platform, with 
Nano and Vim being among the most common. In the next section, we'll go over the 
basics of both.

Download 15,21 Mb.

Do'stlaringiz bilan baham:
1   ...   163   164   165   166   167   168   169   170   ...   482




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish