Linux command - check system information
Lớn | Vừa | Nhỏ
# Find CPU specifications
cat /proc/cpuinfo
# Find running kernel version
uname -r
# What compiler version do I have installed
gcc -v
gcc --version
# What is the running kernel and compiler installed
cat /proc/version
# Find X server version
X -showconfig
# What pci cards are installed and what irq/port is used
cat /proc/pci
# What kernel modules are loaded
lsmod
# Memory and swap information
cat /proc/meminfo
free
An article: Tips for Optimizing Linux Memory
# How are the hard drives partitioned
fdisk -l
# How much free/used drive space
df -h
# Show disk usage by current directory and all subdirectories
du | less
# What takes up so much space on your box
# Run from the directory in question and the largest chunk shows up last
find $1 -type d | xargs du -sm | sort -g
# What is the distribution
cat /etc/.product
cat /etc/.issue
cat /etc/issue
cat /etc/issue.net
sysinfo
# For finding or locating files
find
locate
which
whereis
# Use dmesg to view the kernel ring buffer (error messages)
dmesg | less
# Watch error messages as they happen (sysklog needed)
as root, tail -f /var/log/messages (shows last 10 lines, use a number in front of f for more lines)
# What processes are running
ps -A
# Find a process by name
ps -ef | grep -i <plain text>
For example, XCDroast
ps -ef xcdroast
# See current environment list, or pipe to file
env | more
env > environmentvariablelist.txt
# Show current userid and assigned groups
id
# See all command aliases for the current user
alias
# See rpms installed on current system
rpmquery --all | less
rpmquery --all > <filename>
rpmquery --all | grep -i <plaintext>
Autospec for tarballs
RPM tools
# What directory am I using
pwd
# Get ls colors in less
ls --color=always | less -R
Look at man <command> or info <command> for the flags I used and for other options you can use for bash commands.
Source: http://www.linuxquestions.org/questions/linux-general-1/command-to-check-hardware-135433/
-------------------------------------------------------------
uname-Linux Command
uname
Print system information, print information about the machine and operating system it is run on. If no options are given, `uname' acts as if the `-s' option were given.
SYNTAX
uname [options]...
OPTIONS
`-a'
`--all'
Print all of the below information.
`-m'
`--machine'
Print the machine (hardware) type.
`-n'
`--nodename'
Print the machine's network node hostname.
`-p'
`--processor'
Print the machine's processor type
`-r'
`--release'
Print the operating system release.
`-s'
`--sysname'
Print the operating system name.
`-v'
Print the operating system version.
If multiple options or `-a' are given, the selected information is printed in this order:
SYSNAME NODENAME RELEASE OSVERSION MACHINE
The OSVERSION, at least, may well be multiple words.
For example:
uname -a
=> Linux hayley 1.0.4 #3 Thu May 12 18:06:34 1994 i486
Related Linux Bash commands:
env - Display, set, or remove environment variables
groups - Print group names a user is in
hostname - Print or set system name
id - Print user and group id's
logname - Print current login name
ps - list processes
tty - Print filename of terminal on stdin
users - Print login names of users currently logged in
who - Print who is currently logged in
whoami - Print the current user id and name (`id -un')
ERROR - Terminal Server has Exceeded the Maximum Number of Allowed Connections
Thanh Nga. Ừh. Chào em
