Tuesday 27 November 2012


List of commands determine system info/resources/partitions/process in Ubuntu Linux

Following lists frequently-used commands to determine ubuntu info,resources,partitions,network,process and so on.First,open terminal fromApplications/Accessories/Terminal and type the commands.
System infomation
uname -a
#kernel/operating system/CPU info in brief.
head -n 1 /etc/issue
#see the ubuntu version,same tocat /etc/issue
hostname
#hostname
lspci -tv 
#list all PCI devices
lsusb -tv
#list all USB devices
lsmod
#list loaded kernel modes
env
#environment variable
Resources
free -m
#see the usage of memory and swap
df -h
#the usage of partitions
du -sh 
#see the size of the directory in M.
grep MemTotal /proc/meminfo
#total size of RAM
grep MemFree /proc/meminfo
#free size of RAM
uptime 
#system running time,users,load average
cat /proc/loadavg
#load average
Disk and Partition
mount | column -t
#mount info about partitions
fdisk -l
#list all partitions,need root permission
swapon -s
#list all swap partitions
hdparm -i /dev/sda
#list disk info (only for IDE)
Network
ifconfig
#list IP informations
route -n 
#list route tables
netstat -lntp
#list listening ports
netstat -antp
#list established links
Process
ps -ef
#list all processes
top
#list processes and usage of system resource
User
id username
#list the user info.
last 
#list login record
cut -d: -f1 /etc/passwd 
#list all users
cut -d: -f1 /etc/group
#list all groups
crontab -l 
#list scheduled tasks of current user
Service
chkconfig --list
#list all services
chkconfig --list | grep on
#list all running services

0 comments:

Post a Comment