0

I'm new to Ubuntu, so please forgive me.

I need to install a SHOUTcast server on the machine. Currently, I have the file "sc_serv2_linux_x64_11_29_2013.tar.gz" on a flash drive. How can I copy the file and extract it?

I already tried other methods I read, but none worked.

1 Answers1

0

Method 1:

The file is on your USB stick. I suppose you plugged it into your computer. So you need first to know the name of your USB stick. For this, run this command on Terminal:

ls /media

This will give display the name of your USB stick, for example: usb1234

To copy your file, run this command on your Terminal:

cp /media/usb1234/sc_serv2_linux_x64_11_29_2013.tar.gz .

This will copy sc_serv2_linux_x64_11_29_2013.tar.gz to where you are running the commands on Terminal (continue reading above).

tar -xzvf sc_serv2_linux_x64_11_29_2013.tar.gz

Running man tar on Terminal will give you the explanation of the options xzvf above:

 -x, --extract, --get
       extract files from an archive

 -z, --gzip, --gunzip --ungzip

 -v, --verbose
       verbosely list files processed

 -f, --file ARCHIVE
       use archive file or device ARCHIVE

This will extract the file above in the same folder where you opened the Terminal. By default, when you open Terminal you are on /home/your_user_session

If you do not know where you are then just type on Terminal:

pwd

Method 2:

The simplest way: if you are running Ubuntu 12.04 and over, then as soon as you plug your USB stick into the computer, it will be opened and you will find yourself within it, in which case you can view the data of your USB stick and copy what you want using the mouse :)

If it is not opened by default then be sure you plugged it correctly and click on the file browser where you will see the name of your USB stick displayed as above:

enter image description here

Click on the USB stick name and copy your file wherever you want. Then right click using the mouse on your file and click on Extract Here.

Method 3:

If sudo fdisk -l shows the presence of a USB stick but you can not access it then you have to mount it:

sudo mkdir /media/external

That creates the mount point in /media called /external in our case (you can choose an other name)

sudo mount -t vfat /dev/sdb1 /media/external -o uid=1000,gid=1000,utf8,dmask=027,fmask=137

That will mount the drie.

After you finish, you have to unmount the device by running:

sudo umount /dev/sdb1

Or:

sudo umount /media/external

Source.

Begueradj

  • I see that extracts the files, but where does it get extracted? – foo_bar_kiba Jul 01 '15 at 04:54
  • @tried42long Check my edit and you will find the answer to the question you asked –  Jul 01 '15 at 04:58
  • Thanks for the detailed reply, begueradj. I'm running commands on purely a command line(no UI whatsoever). I tried "ls /media", but only a "cdrom" appeared. I also used "lsblk" and my device is named sdd1 under sdd and there's also no entry on the "MOUNTPOINT" column. – foo_bar_kiba Jul 01 '15 at 05:28
  • if you see only CDROM after running ls /media then this means your USB stick is simply not recognized yet. So unplug it and plug it back again via the same entry, or a different one. @tried42long –  Jul 01 '15 at 05:30
  • I realized I need to mount sdd1 to /media. Is this correct? – foo_bar_kiba Jul 01 '15 at 05:33
  • @tried42long what Ubuntu version are you running ? Mounting the USB stick is an other option if lsblk shows the presence of the USB stick but you can not access it yet, yes –  Jul 01 '15 at 05:37
  • My displays show Ubuntu 12.04.5. LTS. What's the created directory inside media for(Can I just mount it to media)? Is it for good practice or something else? – foo_bar_kiba Jul 01 '15 at 06:27
  • @tried42long the folder inside media is called the mount point. It means the content of your USB stick will be displayed within it. –  Jul 01 '15 at 06:31