Showing posts with label Unix Commands. Show all posts
Showing posts with label Unix Commands. Show all posts

Sunday, December 09, 2007

Listing USB devices on Fedora 7

lsusb command can list all usb devices found,
I had Fedora core 7(moonshine) installed and i did not find the command,

I had to install usbutils which brings the command:

[root@linuxbox ~]# yum -y install usbutils
Installed: usbutils.i386 0:0.71-2.1
Complete!

[root@linuxbox ~]# lsusb
Bus 004 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 001: ID 0000:0000
Bus 001 Device 004: ID 07a6:8511 ADMtek, Inc. ADM8511 Pegasus II Ethernet
Bus 001 Device 003: ID 046d:c016 Logitech, Inc. M-UV69a Optical Wheel Mouse

[root@linuxbox ~]# lsusb -d 07a6:8511 -v <--- gives details
Bus 001 Device 004: ID 07a6:8511 ADMtek, Inc. ADM8511 Pegasus II Ethernet
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 8
idVendor 0x07a6 ADMtek, Inc.
idProduct 0x8511 ADM8511 Pegasus II Ethernet
bcdDevice 1.01
iManufacturer 1 ADMtek
iProduct 2 USB To LAN Converter
iSerial 3 0001
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 39
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xa0
Remote Wakeup
MaxPower 160mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 3
bInterfaceClass 0 (Defined at Interface level)
bInterfaceSubClass 0
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83 EP 3 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 1

SSH Tips

Pointing to some SSH tips given in Linux Magazine:

$ssh -T user@hostname

If you connect to a host this way, it will disable pseudo-tty allocation
and a command like w will not show your connection. Better add
`bash -i' , as below.
$ssh -T user@hostname /bin/bash -i


With the below command the IP address of the system you connect to wont be
logged into known_hosts file, usually its in /root/.ssh/known_hosts.

$ssh -o UserknownHostsFile=/dev/null -T user@hostname /bin/bash -i

Monday, November 19, 2007

Linux keyboard shortcuts.

Linux has many keyboard shortcuts. Knowing them makes using Linux much easier.

Console/terminal

  • Ctrl-Alt-Delete - shuts down computer
  • Alt-Fn (F1, F2, F3,…) - switch to n-th console
  • Alt-Left or Alt-Right - switch to next/previous virtual terminal
  • Scroll Lock - locks terminal input/output - allows to read console contents when output is going too fast. To unlock, press Scroll Lock once again.
    Alternatively, Scroll Lock can be enabled using Ctrl-S and disabled with Ctrl-Q. Try last shortcut if your console hangs for unknown reason - it happened to me many times that I’ve locked it accidentaly by pressing CTRL-S.
  • Shift-Page Up and Shift-Page Down - scrolls console buffer up/down. Works also when Scroll Lock is enabled. After changing the terminal (Alt-Fn) buffer contents is erased and it is impossible to scroll it.
  • Ctrl-L - screen refresh
  • Ctrl-C or Ctrl-Backslash - kills current task
  • Ctrl-D - stands for EOF (End-of-file). If you type it on en empty command line, it will quit bash. This is so much faster than typing exit
  • Ctrl-Z - pause process. Use commands: bg to run in background or fg to run in foreground.



Bash & command-line

  • Ctrl-A - moves cursor to beginning of command line.
  • Ctrl-E - moves cursor to end of command line.
  • Ctrl-K - clears command line from cursor position to end of line.
  • Ctrl-U - clears command line from cursor position to beginning of line.
  • Ctrl-W - clears word to the left
  • Ctrl-Y - will paste in anything that was deleted by Ctrl-U or Ctrl-K or Ctrl-W
  • Tab - command-line autocompletion. Automatically completes current command line.
    If autocompletion script is enabled, then also options and applications parameters are autocompleted.
  • Ctrl-R - followed by characters will do a incremental search of the previous command history


Kernel shortcuts

Following shortcuts must be enabled in kernel, they also must be enabled using proc interface (echo 1 > /proc/sys/kernel/sysrq).

  • Alt-SysRQ-S - sync all mounted filesystem. Data in buffers is immediately written to disks.
  • Alt-SysRQ-U - remounts mounted filesystems read-only
  • Alt-SysRQ-B - performs immediate reboot. Don’t do it without syncing and unmounting as it can cause massive filesystem corruption
  • Alt-SysRQ-S, then Alt-SysRQ-U, then Alt-SysRQ-B - attempts to sync all mounted filesystems, remounts them read-only and immediately reboots computer. Fastest way to reboot Linux.
  • Alt-SysRQ-H - prints out list of other SysRQ functions.


X-Windows shortcuts

  • Ctrl-Alt-Plus or Ctrl-Alt-Minus- changes screen resolution (higher/lower). Only if X-Windows server is configured for multiple resolutions.
  • Ctrl-Alt-Backspace - kill X-server. Running applications will be terminated.
  • Ctrl-Alt-Escape - xkill - click an application to kill it.
  • Ctrl-Shift-Num Lock will turn the keypad on the keyboard into the mouse, so you can control the mouse from keyboard. Keys / and * on the numpad select left mouse click and right mouse click respectively. Mouse click is done by 5 on the numpad.
  • Ctrl-Alt-Fn (F1, F2, F3,…) - switches to n-th text console.


KDE shortcuts

  • Ctrl-Alt-Shift-Page Down - direct shutdown
  • Ctrl-Alt-Shift-Page Up - direct reboot
  • Alt-F2 - Starts the run command box. Type a application executable to launch it, folder name to open it, filename to use an appropriate program to launch it, url to go to it in konqueror and any of the numerous web shortcuts(gg, wp) defined by konqueror to activate them.

Do you know any other shortcuts that are worth to know?