So, you are in a situation where you have no idea what version of Ubuntu is installed (perhaps the display has been radically altered), so long as you can get terminal access, finding out is very simple. Open a terminal, this can most always be done with CTL+ALT+T, unless someone changed that too. In your terminal issue the command "lsb_release -a", as shown here:
As you can see, the output contains the version!
On occasion I need to know the gritty details of a USB device attached to Linux. Fortunately this is fairly trivial once you know what tools to use and how to use them. This is just some quick notes (namely for myself) as I don't do this often enough to remember all of the details.
Using lsusb (or lsusb -v for USB descriptor information) is as simple as the command, so I only mention it for awareness.
Depending on the information that might be needed, lsusb and/or udevinfo can be used. Note however, under Ubuntu udevinfo is udevadm (and info can be passed as an argument). In my case I have attached a USB FLASH drive to the Ubuntu host. Running dmesg will print the kernel message buffer and at the end I should see that it connected. In my case it has attached as a SCSI drive [sdb] and the device node should have been created /dev/sdb. More information on drive naming in Linux can be found at:
Now we can use the path of the device node as input to udevadm info as follows (and output for my example):
Specifically, I am looking for the device path:
Now we can start with the specified device and let udevadm walk up the chain of parent devices listing out usefull details for each in the chain. This not only gives us the details of what it is connected, but how it is connected and the details of what it is connected to. The following command will list the chain for the example device from above (output is not listed for brevity):
Compiling code in Linux will will produce a .ccache folder in the users home directory, used by the program ccache. Often times this folder can grow to be quite large and should be regularly cleaned. To clean the ccache issue the following command to instruct ccache to clean its cache.
To produce a patch from the command line in Linux, it is important to have both the original and modified folders setup at the same directory level. For example, two folders "/home/user/OriginalFolder" and "/home/user/ModifiedFolder". We will first change into the folder that contains the folders that we are patching, for our example this would be as follows:
Now to produce a patch named "MyPatch.patch" we would issue the following command:
The patch will now contain all of the difference information and act as an instruction on how to produce ModfiedFolder from the OriginalFolder. If we want to apply this patch (say for example to the "OriginalFolder", we would first need to change in to the path of the source that we are going to patch and apply the patch as follows:
If you now compare the "OriginalFolder" to the "ModifiedFolder" there should be no differences. Congratulations, you have just created and applied your first patch.
“Live as if you were to die tomorrow. Learn as if you were to live forever.”