Where is the usb directory (CLI)?

I know how to ‘yank’ (copy) lines in a file using vim. But how do I copy it into a usb drive? I thought of looking in /media but the particular directory doesn’t appear.

Where is the usb directory?

izaak86 wrote:

>
> I know how to ‘yank’ (copy) lines in a file using vim. But how do I copy
> it into a usb drive? I thought of looking in /media but the particular
> directory doesn’t appear.
>
> Where is the usb directory?
>
>
try the mount command

Alan

If I am working from a terminal session, and I want to copy files onto a USB stick, what I typically do is something like the following

  • before plugging in the usb stick, in the terminal as regular user ‘oldcpu’ I type:
mkdir stick

such that the directory /home/oldcpu/mkdir is created
.

  • then also before plugging in the USB stick I check to see what drives/partitions are recognized by typing:
su -c 'fdisk -l'

Note that is ‘dash lower-case-L’ at the end.

  • then I plug in the USB stick.
  • then I type again
su -c 'fdisk -l'

and look to see what has changed. Lets say from that I see the USB memory stick’s partition is identified as /dev/sdb1

  • then I type:
su -c 'mount -t vfat -o rw,users,uid=oldcpu /dev/sdb1 /home/oldcpu/stick'

and enter root password when prompted for a password. Note you need to change ‘oldcpu’ to your ‘username (what ever it is)’ and you need to change ‘sdb1’ to what ever your USB stick is identified as;
.

  • and then anything I copy to the directory /home/oldcpu/stick will be copied to the USB stick.
  • and when I am done copying I close any sessions accessing that directory, and I unmount the memory stick by typing:
su -c 'umount /dev/sdb1'

enter root password when prompted for a password. Note that is “umount” and NOT “unmount”
*]and then I remove the USB stick

That was mighty helpful. Thanks!

By the way, is there any guide/wikis I could study for being proficient in scripting, just for ease of future tasks like this. Thanks again.

izaak86 wrote:
> That was mighty helpful. Thanks!
>
> By the way, is there any guide/wikis I could study for being proficient
> in scripting, just for ease of future tasks like this. Thanks again.
>
>
http://tldp.org/guides.html

and, in http://rute.2038bug.com/ see Chapter 7 Shell Scripting

but note that Rute User’s Tutorial and Exposition is a text book of
sorts which is designed to be read/studied from page one…each
succeeding page assumes you have understood and can use correctly all
previously introduced material…

so, by starting in chapter 7 you will have missed a LOT of what is
going on…for a full understanding of Linux and scripting, i’d
suggest you begin on page one and read/study/learn with patience…

lots of stuff there.


DenverD
CAVEAT: http://is.gd/bpoMD [posted via NNTP w/openSUSE 10.3]

Great! Thanks a lot DenverD.