How Do You List Mountable Usb Devices On Linux From Terminal?

Q. I am using Damn Small Linux and would like to display a list of all connected usb storage devices and their names from terminal for example i would like to be able to figure out what my ipod would be when connected for example /dev/sda1 or whatever. Thanks in advance!

A. Actually what you want is probably a combination of "lsusb" and "dmesg | tail".

- Run lsusb before and after you plug in a USB device – it lists all the detected USB devices on the system. If you get a new device listed after you plugged in, you’re on your way to mounting the device.
- The next step is to run "dmesg | tail". The dmesg command spits out the kernel log. The tail command will filter it to show the last few lines. You are looking for something like:

sd 15:0:0:0: [sdb] Attached SCSI removable disk
sd 15:0:0:0: Attached scsi generic sg2 type 0
usb-storage: device scan complete

As you can see in the example above, I attached a removeable disk which was assigned to sdb (of course yours might be sda, sdc, etc).

With a combination of the 2 commands above, and possibly doing a "ls /dev | grep <the assigned device node from above, like sdb>" you can find what devices you have available to mount. The reason you might want to do the ls is for devices with more than one partition.

How to get the linux source code will it be available in the CD itself ?
Q. I need the linux source code for fedora, will it be available in the CD or DVD ?

A. It should be available on the installation CDs/DVDs. If not, do a yum update |grep source or go to the repositories and look for one of the src rpms manually. You can then install it (as root) with rpm -ivh.

More information on the web pages I’ve linked to. It’s been about three months since I’ve played with Fedora at all.

How programs handle regular expressions in linux?
Q. I think I might be confused with what the question is asking me. Basically I have to outline how vi, bash, and grep differ in handling regular expressions. What exactly am I looking for? As I understand it should word the same in each program, right?

What am I missing?

A. Yeah, that’s a pretty vague question.

The obvious odd one out is ‘bash’, because like all of the common shells it really doesn’t do regular expressions at all. It does something called "filename matching" (traditionally called "globbing") using patterns that look like a simpler cousin of regular expressions. For details see the "Filename Expansion" section of the ‘bash’ reference manual at http://www.gnu.org/software/bash/manual/bashref.html#Filename-Expansion, or do ‘man bash’ on your Linux system.

vi (which on Linux is really ‘vim’, a reimplementation of the real ‘vi’) matches patterns that are expressed in a way that is much closer to proper regular expression syntax than ‘bash’ but it does have some differences. If you compare the ‘vim’ pattern-matching rules at http://vimdoc.sourceforge.net/htmldoc/usr_27.html to the regexp rules in the ‘grep’ man page then you’ll see some differences. For example, the rule for expressing an optional character is different, ‘vim’ has its own way of expressing character-class matches and some common character ranges, and ‘vim’ has its own way of dealing with case-sensitivity.

‘grep’ on Linux uses real regular expressions. In fact there are two flavours of regular expression: "basic" regexps and "extended" regexps. ‘grep’ on Linux lets you use either kind, whereas on other systems ‘grep’ traditionally understood only basic regexps and a separate command ‘egrep’ understands extended regexps. The
Linux ‘grep’ man page summarises the differences between basic and extended regexps.

I hope that’s enough to get you started.

Powered by Yahoo! Answers

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>