Archive for '1001 Linux Tips'

[1001+ Linux Tips] Menampilkan Seluruh Device USB Dalam Bentuk Tree

Untuk menampilkan output lsusb sebagai tree, kita bisa memberikan opsi -t :

[root@clarisa ~]# lsusb -t
Bus#  2
`-Dev#   1 Vendor 0x0000 Product 0x0000
  `-Dev#   2 Vendor 0x0e0f Product 0x0002
Bus#  1
`-Dev#   1 Vendor 0x0000 Product 0x0000

Ingin tips lainnya? anda bisa membaca Linux Tips 101 yang merupakan bagian dari 1001 Linux Tips

Selamat Mencoba!

Popularity: 3% [?]

[1001+ Linux Tips] Melihat Seluruh Device USB

Untuk melihat seluruh bus USB yang ada dikomputer kita dan device yang terkoneksi dengan USB. Untuk menggunakan fitur ini anda harus menggunakan kernel yang mendukung /proc/bus/usb, yaitu kernel 2.3.15 atau yang lebih baru.

[sumodirjo@clarisa ~]$ /sbin/lsusb
Bus 001 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 002 Device 002: ID 0e0f:0002 VMware, Inc. Virtual USB Hub

Untuk mengetahui info lebih detail mengenai device USB kita bisa memberikan opsi -v (verbose) :

[root@clarisa ~]# lsusb -v | more

Bus 001 Device 001: ID 0000:0000
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            9 Hub
  bDeviceSubClass         0 Unused
  bDeviceProtocol         1 Single TT
  bMaxPacketSize0        64
  idVendor           0x0000
  idProduct          0x0000
  bcdDevice            2.06
  iManufacturer           3 Linux 2.6.18-164.el5 ehci_hcd
  iProduct                2 EHCI Host Controller
  iSerial                 1 0000:02:03.0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           25
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      0 Full speed (or root) hub
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0002  1x 2 bytes
        bInterval              12
Hub Descriptor:
  bLength               9
  bDescriptorType      41
  nNbrPorts             6
  wHubCharacteristic 0x000a
    No power switching (usb 1.0)
    Per-port overcurrent protection
    TT think time 8 FS bits
  bPwrOn2PwrGood       10 * 2 milli seconds
  bHubContrCurrent      0 milli Ampere
  DeviceRemovable    0xc0
  PortPwrCtrlMask    0x36
 Hub Port Status:
   Port 1: 0000.0100 power
   Port 2: 0000.0100 power
   Port 3: 0000.0100 power
   Port 4: 0000.0100 power
   Port 5: 0000.0100 power
   Port 6: 0000.0100 power
...

Ingin tips lainnya? anda bisa membaca Linux Tips 101 yang merupakan bagian dari 1001 Linux Tips

Selamat mencoba!

Popularity: 4% [?]

[1001+ Linux Tips] Mencari Path Aplikasi

Untuk mengetahui path atau letak sebuah aplikasi seperti ls, mkdir dan lain sebagainya, kita bisa menggunakan perintah which dengan memberikan nama aplikasi sebagai masukan.

$ which

Sebagai contoh :

[sumodirjo@clarisa ~]$ which ls
alias ls='ls --color=tty'
        /bin/ls

[sumodirjo@clarisa ~]$ which bash
/bin/bash

[sumodirjo@clarisa ~]$ which which
alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'
        /usr/bin/which

Dapat kita lihat pada contoh diatas, kalau sebuah perintah memiliki alias, maka which juga akan menampilkan alias, dan itu terjadi karena which sudah merupakan alias di shell yang sedang berjalan. Selamat mencoba!

Popularity: 6% [?]

[1001+ Linux Tips] Menggunakan alias

alias merupakan perintah bawaan / built-in shell, berfungsi untuk menyingkat perintah command line. Dengan alias kita cukup memanggil singkatan tersebut seolah sebagai sebuah command. Jika digunakan tanpa opsi atau dengan opsi -p maka akan ditampilkan alias yang sedang digunakan :

[sumodirjo@clarisa ~]$ alias
alias l.='ls -d .* --color=tty'
alias ll='ls -l --color=tty'
alias ls='ls --color=tty'
alias vi='vim'
alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'
[sumodirjo@clarisa ~]$ alias -p
alias l.='ls -d .* --color=tty'
alias ll='ls -l --color=tty'
alias ls='ls --color=tty'
alias vi='vim'
alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'

untuk menambahkan sebuah alias kita bisa menggunakan pola sebagai berikut

	alias ='
'

sebagai contoh, kita akan menyingkat perintah clear untuk membersihkan layar dengan alias c. Kita bisa menggunakan perintah berikut :

[sumodirjo@clarisa ~]$ alias c='clear'

Kalau kita menjalankan perintah alias dengan opsi -p atau tanpa opsi, kita akan melihat c sudah didalam alias yang sedang digunakan.

[sumodirjo@clarisa ~]$ alias -p
alias c='clear'
alias l.='ls -d .* --color=tty'
alias ll='ls -l --color=tty'
alias ls='ls --color=tty'
alias vi='vim'
alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'

Sampai sini, ketika kita mengetikkan c kemudian kita enter maka efeknya sama dengan kita mengetikkan clear

Lalu bagaimana untuk menghapus atau mematikan alias, kita bisa menggunakan perintah unalias namaProgram . Sebagai contoh, jika kita ingin menghapus alias c yang sebelumnya kita buat, kita cukup menggunakan perintah

[sumodirjo@clarisa ~]$  unalias c

Untuk membuat penambahan alias permanen. anda bisa menambahkan alias pada file .bashrc yang ada didalam home direktori kita masing-masing. Selamat Mencoba!

Popularity: 6% [?]

[1001+ Linux Tips] Mengetahui Modul Perl Apa Saja Yang Terinstall di Sistem

Untuk mengetahui modul perl apa saja yang terinstall di dalam sistem Linux, gunakan perintah instmodsh

[sumodirjo@storage ]# instmodsh
Available commands are:
   l            - List all installed modules
   m    - Select a module
   q            - Quit the program
cmd?

Untuk melihat daftar modul apa saja yang terinstal, gunakan opsi l

cmd? l
Installed modules are:
   Archive::Tar
   Archive::Zip
   CPAN
   Compress::Raw::Bzip2
   Compress::Raw::Zlib
   Compress::Zlib
   Cwd
   Data::Dumper
   Digest::SHA
   ExtUtils::CBuilder
   ExtUtils::MakeMaker
   File::HomeDir
   File::Temp
   File::Which
   IO::Compress
   IO::Zlib
   IPC::Run3
   List::Util
   Module::Build
   Net
   Package::Constants
   Parse::CPAN::Meta
   Perl
   Probe::Perl
   Term::ReadKey
   Term::ReadLine
   Test::Harness
   Test::Script
   Test::Simple
   Text::Glob
   YAML
   threads
cmd?

Kita bisa melihat detail tiap modul dengan menggunakan perintah m

cmd? m Net
Available commands are:
   f [all|prog|doc]   - List installed files of a given type
   d [all|prog|doc]   - List the directories used by a module
   v                  - Validate the .packlist - check for missing files
   t         - Create a tar archive of the module
   h                  - Display module help
   q                  - Quit the module
Net cmd?

Selamat Mencoba!

Popularity: 7% [?]