Skip to main content

Linux commands for System Administrators

Kernel Ring Buffer: dmesg
# dmesg |more
[ 0.000000] Linux version 2.6.24-16-generic (buildd@palmer) (gcc version 4.2.3 (Ubuntu 4.2.3-2ubuntu7)) #1 SMP Thu Apr 10 13:23:42 UTC 2008 (Ubuntu 2.6.24-16.30-generic)
[ 0.000000] BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: 0000000000000000 - 000000000009e000 (usable)
[ 0.000000] BIOS-e820: 000000007edf4000 - 000000007edff000 (ACPI data)
[ 0.000000] 1134MB HIGHMEM available.
[ 0.000000] 896MB LOWMEM available.
[ 0.000000] found SMP MP-table at 000fe200
[ 0.000000] Entering add_active_range(0, 0, 519680) 0 entries of 256 used
[ 0.000000] Zone PFN ranges:
[ 0.000000] DMA 0 -> 4096
[ 0.000000] Normal 4096 -> 229376
[ 0.000000] HighMem 229376 -> 519680


List of Open Files: lsof
To view a list of all the open files.
# lsof -p 6685
To view a list of all the files open for a particular process
# lsof -p 6685
6685 is the process ID for a process (ps -u username will give process ID)

Process Tree: pstree

This will give the list of process in a tree format
# pstree
Interprocess Communication: ipcs
This will produces a list of the IPC resources currently in use:
# ipc
User Accessing Files: fuser
This command is useful to find what processes or users are currently accessing a particular files. Example, suppose you want to unmount a file system mounted at /cdrom. umount gives “device is busy.” The fuser command can help you to find which processes are accessing the device:
$ fuser -v /home/dipin
USER PID ACCESS COMMAND
/home/dipin: dipin 3297 ..c.. x-session-manag
dipin 3349 ..c.. gnome-keyring-d
dipin 3356 ..c.. metacity
dipin 3367 ..c.. gnome-panel
dipin 3369 ..c.. nautilus
dipin 3376 ..c.. vino-session
dipin 3382 ..c.. bluetooth-apple
dipin 3384 ..c.. update-notifier
dipin 3391 ..c.. nm-applet
dipin 3395 ..c.. gnome-cups-icon
dipin 3536 ..c.. firefox-bin
dipin 6516 ..c.. gnome-terminal
dipin 6518 ..c.. bash


Processes List: top
Command for “table of processes,” displays a list of processes that is refreshed every two seconds.
$ top

Tasks: 134 total, 1 running, 133 sleeping, 0 stopped, 0 zombie
Cpu(s): 4.8%us, 0.3%sy, 0.0%ni, 93.8%id, 1.1%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 2056640k total, 1642608k used, 414032k free, 24620k buffers
Swap: 3951948k total, 0k used, 3951948k free, 629144k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
6685 vishnu 20 0 764m 652m 23m S 4 32.5 4:15.57 firefox
1 root 20 0 2844 1660 520 S 0 0.1 0:01.02 init
2 root 15 -5 0 0 0 S 0 0.0 0:00.00 kthreadd
3 root RT -5 0 0 0 S 0 0.0 0:00.00 migration/0
4 root 15 -5 0 0 0 S 0 0.0 0:00.02 ksoftirqd/0


Who Is Doing What: w

This will find out who is logged onto the system and what he is doing.
# w
10:20:55 up 1:06, 2 users, load average: 0.29, 0.22, 0.14
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
dipin :0 - 09:15 ?xdm? 4:24m 0.46s x-session-manag
dipin pts/0 :0.0 10:13 1.00s 0.12s 0.00s w

Comments

Popular posts from this blog

How to install Skype on Ubuntu 10.04 Lucid Lynx

UPDATE: Skype has now been uploaded to the "partner" official Ubuntu 10.04 Lucid Lynx repository. See Install Skype in Ubuntu 10.04 Lucid Lynx from official partner repository Command Line way Get the package: For 32-bit $ wget http://www.skype.com/go/getskype-linux-beta-ubuntu-32 For 64-bit $ wget http://www.skype.com/go/getskype-linux-beta-ubuntu-64 You will need to install the following libraries. $ sudo apt-get install libqt4-dbus libqt4-network libqt4-xml libasound2 Now install skype(the file u just downloaded, may be named intrepid-ibex) $ sudo dpkg -i skype-XXXXXXXXXXXX.deb If you still get some dependency error then just type the command below $ sudo apt-get -f install this will install the dependencies and the skype. Non - Terminal Download the setup 32 -bit 64 -bit You will these packages: libqt4-dbus libqt4-network libqt4-xml . Goto Synaptic manager and install them. Now Launch the Skype install .deb file (just double click it) and follow the on screen prompts.

Howto Install BSNL wll clarity phone in Ubuntu

Hello linixians, Failed to access internet through your bsnl clarity phone.... Here is an easy way 1. Just download this executable..... bsnlclarity and save it to your home folder. 2. Connect your phone to the system with the usb cable. 3. Now at terminal type $ sudo ./bsnlclarity You will be asked for your username and password for accessing the internet enter it ..... now start surffing Ctrl+C to stop

gtalx: Howto Gtalk in ubuntu ( google talk )

Did you fail to use " gtalk in ubuntu " ... Now you can chat and talk to your gmail buddies in ubuntu... 1. check for gtk2.0 and qt4 $ sudo apt-get install libgtk2.0-dev $ sudo apt-get install libqt4-dev libogg-dev libtheora-dev $ sudo apt-get install libsdl-dev libavcodec-dev libswscale-dev $ sudo apt-get install libexpat-dev libraw1394-dev libvorbis-dev $ sudo apt-get install libgsm1-dev  libspeexdsp-dev libmediastreamer0-dev libortp-dev 2. Remove 'pulse audio sound server' Open synaptic package manager and remove pulse audio 3. "Download gtalx" from here Dowload it here 4. Extract the file.... $ tar -zxvf 0.0.4.tar.gz 5. Get into the directory.... $ cd 0.0.4 and then... $ sudo chmod u+x make $ ./make $ sudo ./make install 6. Enjoy..... Please comment about your installation(whether it was a success or not....) Take gtalx from Applications > Internet > gtalx Enter your gmail login information..and click connect...