Linux Commands for Beginners 23 - Transferring Files with scp — Transcript
Full transcript
- 0:00[Music]
- 0:20hello once again everybody this is Jay
- 0:23with another linux commands for
- 0:25beginners video and in this video we're
- 0:28going to take a look at transferring
- 0:30files from one Linux machine to another
- 0:33so you will need two linux instances for
- 0:37this video it doesn't matter if they're
- 0:39both virtual machines one physical one
- 0:41virtual both cloud instances one cloud
- 0:43instance um it really doesn't matter so
- 0:46long as you have two Linux machines to
- 0:49work from and then I'll show you
- 0:50examples of copying files from one
- 0:52server to the other we're going to use
- 0:55the secure copy protocol or SCP to
- 0:58achieve that in this video so let's go
- 1:00ahead and get started
- 1:02so here on my terminal I have a shell
- 1:06open from my local workstation or my
- 1:09local laptop you can see my customize
- 1:11prompt with a cute little unicorn right
- 1:13here and this is where my local files
- 1:16are that I'm going to copy to another
- 1:18instance it doesn't really matter what
- 1:21you copy I'm going to show you a few
- 1:23examples here but you can go ahead and
- 1:26use whatever files you'd like so I
- 1:28recently recorded a video on retropie
- 1:30which is a very awesome distribution and
- 1:33also application that you can run on
- 1:36your Linux installation on a laptop or a
- 1:38desktop to play some retro games and I
- 1:41have all those files still on my laptop
- 1:43so I'm going to use those as an example
- 1:45again it doesn't really matter what you
- 1:47use so if I list storage on my home
- 1:48directory here I have all kinds of
- 1:52folders here and the one I'm interested
- 1:54in is this retropie folder I'm going to
- 1:57go ahead and go in there and you can see
- 2:01I have a roms directory inside there I
- 2:07have a bunch of folders for various
- 2:10emulated games that are supported by
- 2:13retropie I'm going to use NES as an
- 2:16example so if I go into the NES folder I
- 2:21have a bunch of files here so I've made
- 2:25my text really big here so some of these
- 2:28names are going to be wrapped I'm sorry
- 2:29about that but the name of these games
- 2:32doesn't really matter be
- 2:33because the type of content doesn't
- 2:35really matter the whole point is to show
- 2:37you guys how to transfer files it
- 2:39doesn't really matter what files you use
- 2:41those files are just what I have
- 2:43available at the time so as an example
- 2:45I'm going to copy this file and I'll
- 2:48just do an LS against it
- 2:50a game called Yoshi for the NES we see
- 2:56that file is right here it's 257
- 2:58kilobytes that's the file that I'm going
- 3:01to transfer now over here in another tab
- 3:03I have an Ubuntu instance on Linode
- 3:06again it doesn't matter where it is you
- 3:08just need to have access to it if I do
- 3:10IP space a my IP address for this
- 3:14instance is going to be this one right
- 3:16here I'm going to need to know that to
- 3:20copy a file or a folder over to this
- 3:23instance now currently I have nothing so
- 3:27if I go back here to my local instance
- 3:29what I'm going to do is SCP secure copy
- 3:34protocol and that comes from the SSH
- 3:37package so if you have the SSH client
- 3:39installed you should already have that
- 3:41installed as well so you should already
- 3:43have this command the file that I want
- 3:45to copy again is Yoshi NES and I want to
- 3:49copy it too I'll put in the username and
- 3:50then at that's the IP address and I'll
- 3:53put a colon slash home slash J so may
- 3:57break this down for you SCP secure copy
- 4:00protocol that's the tool we're going to
- 4:03use to transfer the file the file we
- 4:05want to transfer is this one Yoshi NES
- 4:08the user we want to use for this
- 4:12transfer is my user J at the IP address
- 4:16of the server that's going to receive
- 4:18the file colon and then the path on that
- 4:21server where the file is going to
- 4:23ultimately be copied to I'll press Enter
- 4:27it's going to ask for my password which
- 4:29I'll put in and it copied it over since
- 4:34NES files are very small then of course
- 4:37that's going to copy pretty quick so if
- 4:39I go back over here to my server you can
- 4:42see that I do have that file here Yoshi
- 4:44dot and yes
- 4:46that is present that was not there
- 4:48before back here at the local session
- 4:52I'm going to recall that command again
- 4:55there it is and now here I'm going to
- 4:57remove the file you see that it's not
- 5:00there anymore I'm gonna copy it back but
- 5:05what I'm going to do is I'm going to
- 5:07shorten this down a little bit I'm going
- 5:09to leave off my name at and just have
- 5:11the IP address because if you are logged
- 5:14in as the user you want to copy the file
- 5:16with you don't need to include the
- 5:18username you only need to include the
- 5:20username if the user on the other end is
- 5:22different than the user on your local
- 5:24session so in this case I just need the
- 5:27IP address and what I can also do is I
- 5:29could take off the path so I'm not even
- 5:31going to tell it where I want to copy
- 5:33the file to so let's just see what
- 5:34happens if I leave the path off of the
- 5:36command put in the password again and it
- 5:41copied it so let's see what happened my
- 5:44working directory is slash home slash J
- 5:47and there's the file so how did it know
- 5:49to copy it to that directory to my home
- 5:51directory well actually if you don't
- 5:55give it a path that is going to assume
- 5:58your home directory is where you want to
- 6:01put it so you only actually need to
- 6:03include a path if where you want to
- 6:05transfer the file is in a different
- 6:07location than your home directory now
- 6:10I'm going to go back a directory here
- 6:12and I want to copy the entire NES
- 6:16directory over to that other server so
- 6:18here's what I'm gonna do SCP I'm gonna
- 6:21use - R for recursive because I want to
- 6:24copy everything underneath a particular
- 6:26folder and that's the folder I want to
- 6:29copy the NES folder and again I want to
- 6:32copy it to this IP address I'm not going
- 6:34to put my user name here again because
- 6:36I'm logged in as the same user and I'm
- 6:38going to use a colon because you know
- 6:40we'll just put it in the home directory
- 6:42I'm not going to designate a place so
- 6:43I'll press Enter
- 6:44type the password and it's going to copy
- 6:48everything over there and as I go I
- 6:53could do I could go into the NES
- 6:54directory which is now there
- 6:57you can see that it's basically going to
- 7:00have a bunch of files that's going to
- 7:02change a bit as ILS as it copies
- 7:04additional files it's not necessarily
- 7:06going to go in alphabetical order but it
- 7:09is copying everything over there as you
- 7:11can see is copying my entire NES ROM
- 7:14library over to that other server as you
- 7:18can see here they're all present and
- 7:21again that was the NES directory that I
- 7:25copied over I'll go back here and what
- 7:29I'm gonna do is go back to my home
- 7:31directory so now I'm in my home
- 7:34directory now one thing you should know
- 7:36is that SCP also works in Reverse
- 7:38believe it or not so I could do SCP I'll
- 7:42type the IP address and I did copy the
- 7:46Yoshi
- 7:46NES file into my home directory on the
- 7:49other server as you can see if I do LS
- 7:52well actually it's still here you see
- 7:54Yoshi NES and here what we're going to
- 7:58do is try to copy the file from that
- 8:00server over to my local workstation so
- 8:03I'll put a period which is basically the
- 8:06current working directory I just want to
- 8:08copy it where I am right now and I'll
- 8:10press Enter put in the password and it
- 8:16actually copied the Yoshida NES file
- 8:18from the remote end to the local end so
- 8:21it actually works in Reverse as well so
- 8:24that's basically it there's more you can
- 8:26do with the SCP command there's other
- 8:28options I can give you but I'll leave it
- 8:30up to you to check the man page for
- 8:32example you could designate a port for
- 8:35the other side SSH runs on port 22 which
- 8:38is assumed if you don't designate a pork
- 8:41if the ssh server is running on a
- 8:43different port on the server itself
- 8:45you'll have to designate that i'll leave
- 8:47it up to you to check the main page to
- 8:48find out what option you would use to
- 8:50achieve that but i basically showed you
- 8:53how to copy a file and a folder from one
- 8:56instance to another i hope that was
- 8:58helpful for you guys I know it might be
- 9:00strange to copy rom files but it's what
- 9:03I had I just wanted to show you guys how
- 9:05that process worked and in the next
- 9:07video I'm going to show you basically
- 9:09the same exact thing again
- 9:11but we're going to use the arcing
- 9:13command to achieve this which is another
- 9:16method of copying files from one Linux
- 9:19instance to another and I should have
- 9:21that uploaded very soon so stay tuned
- 9:24thanks for checking out my video I
- 9:27really appreciate it if you found it
- 9:28useful click that like button and if you
- 9:31haven't already done so make sure you
- 9:33subscribe so you'll see the latest
- 9:35content as soon as it becomes available
- 9:37if you want to help me out there's links
- 9:39down below for my patreon page as well
- 9:42as links for purchasing my Linux books
- 9:45and also my affiliate store which has a
- 9:47listing of Linux compatible hardware
- 9:49that I've actually tested personally
- 9:52thanks again for watching and I'll see
- 9:54you in the next video
About this transcript
This page contains the full transcript of Linux Commands for Beginners 23 - Transferring Files with scp by Learn Linux TV, generated from the public captions YouTube serves with the video. The transcript has 1,691 words across 222 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.