7 Ways To More Info

| No TrackBacks

tylko jogina brak // where the yogi is?
There are a bunch of cool little commands beginning with 'ls' that can tell you a lot about your system. Most of the information you get from the commands can be ferreted out in the /proc filesystem, but these are easier to remember and focused on the problem at hand. Commands like:

lsblk

Quick listing of mounted drives. There are lots of informational options you can give it. I'm partial to this version had have made an alias for it:

$ lsblk -o name,fstype,mountpoint
NAME   FSTYPE MOUNTPOINT
sda           
├─sda1 ext3   /backup
├─sda2 ext3   
└─sda3 ntfs   /mediax
sdb           
├─sdb1 ntfs   
├─sdb2 ext4   /
└─sdb3 ext4   /home
sdc           
├─sdc1 vfat   
├─sdc2 swap   [SWAP]
├─sdc3 ext4   
└─sdc4 ext4   /oldsys
sr0           

lscpu

For a quick listing of cpu information, turn to lscpu:

$ lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                4
On-line CPU(s) list:   0-3
Thread(s) per core:    1
Core(s) per socket:    4
Socket(s):             1
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 42
Model name:            Intel(R) Core(TM) i5-2500K CPU @ 3.30GHz
Stepping:              7
CPU MHz:               1782.000
BogoMIPS:              6587.00
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              6144K
NUMA node0 CPU(s):     0-3

lslocks

Lists filesystem locks currently in place. If you're having a problem deleting a file because it is locked, you can use this command to figure out which program has it locked, so you can kill it and try again.

$ lslocks 
COMMAND           PID  TYPE   SIZE MODE  M      START                 END PATH
chrome           2208 POSIX   6.3M WRITE 0 1073741824          1073742335 /home/
steam            1834 POSIX   216B WRITE 0          0                   0 /home/
steam            1834 POSIX   2.3K WRITE 0          0                   0 /home/
chrome           2208 POSIX    30K WRITE 0 1073741824          1073742335 /home/
firefox          2004 POSIX     0B WRITE 0          0                   0 /home/
firefox          2004 POSIX   512K READ  0 1073741826          1073742335 /home/
[...]

lsmod

Simply and quickly shows you the kernel modules loaded:

$ lsmod
Module                  Size  Used by
arc4                    2000  0 
ecb                     2073  0 
md4                     3497  0 
md5                     2313  3 
hmac                    2921  3 
nls_utf8                1320  3 
cifs                  340742  6 
fscache                46067  1 cifs
w83627ehf              32907  0 
hwmon_vid               3260  1 w83627ehf
fuse                   74541  3 
x86_pkg_temp_thermal     6959  0 
intel_powerclamp        8802  0 
coretemp                6326  0 
kvm_intel             129393  0 
kvm                   379223  1 kvm_intel
crc32_pclmul            3019  0 
[...]

lsof

Really useful and dense report of all files currently open on your system. This comes in really handy as a developer, as it shows you all the various network sockets your program is using, what files it has opened, and lots more.

$ lsof
COMMAND    PID  TID     USER   FD      TYPE             DEVICE SIZE/OFF       NODE NAME
dropbox    380      jdarnold  cwd       DIR               8,18     4096          2 /
dropbox    380      jdarnold  rtd       DIR               8,18     4096          2 /
dropbox    380      jdarnold  txt       REG               8,18 18072842     800462 /opt/dropbox/dropbox
dropbox    380      jdarnold  mem       REG               8,18    22960     133891 /usr/lib/libnss_dns-2.18.so
dropbox    380      jdarnold  mem       REG               8,18   274440     799402 /opt/dropbox/wx._combo.so
dropbox    380      jdarnold  mem       REG               8,18    51808     133881 /usr/lib/libnss_files-2.18.so
dropbox    380      jdarnold  mem       REG               8,18    31992     799467 /opt/dropbox/libpopt.so.0
[...]

lspci

In-depth listing of all the cards on your system's PCI bus. Easy way to figure out what your graphics card is, for instance:

$ lspci|grep -i nv
01:00.0 VGA compatible controller: NVIDIA Corporation GF114 [GeForce GTX 560 Ti] (rev a1)

lsusb

Much like lspci, only it shows you the various USB devices that are plugged in. This comes in handy when you plug a USB device in and you're wondering if the system noticed it.

$ lsusb
Bus 006 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 006 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 047f:d955 Plantronics, Inc. 
Bus 001 Device 002: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 004: ID 12cf:0186  
Bus 005 Device 003: ID 045e:00db Microsoft Corp. Natural Ergonomic Keyboard 4000 V1.0
Bus 005 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Enhanced by Zemanta

No TrackBacks

TrackBack URL: http://linux.amazingdev.com/cgi-bin/mt/mt-tb.cgi/559

About this Entry

This page contains a single entry by Jonathan published on September 28, 2013 9:44 AM.

chvt magic was the previous entry in this blog.

Dancing Back is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.