How to upgrade an installed RPM package
Answer:
To upgrade an installed RPM package under Red Hat/Fedora/CentOS
# rpm –Uvh package.rpm
Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.
How to upgrade an installed RPM package
Answer:
To upgrade an installed RPM package under Red Hat/Fedora/CentOS
# rpm –Uvh package.rpm
Install sysstat for basic system monitoring
Answer:
sysstat is a very useful and minimal tool for basic system resources monitoring, e.g. system load average, memory usage, I/O utilization etc.
To install in Ubuntu,
# sudo apt-get install sysstat
To configure sysstat so it run continuously (as cron)
# sudo dpkg-reconfigure sysstat
Wait sometimes and try the following commands to see the collected statistics,
E.g.
1. Check system load average
# sar -q
2. Check memory usage
# sar -r
For more options,
# man sar
Check current environment variables
Answer:
To check the current Linux's environment variables, use the set command
# set
BASH=/bin/bash
BASH_ARGC=()
BASH_ARGV=()
BASH_LINENO=()
BASH_SOURCE=()
BASH_VERSION='3.2.39(1)-release'
COLUMNS=197
...
Change to previous directory using cd command
Answer:
Using cd -, you can easily change to the previous directory
john@localhost:/usr/bin $ cd /tmp
john@localhost:/tmp $ cd -
/usr/bin
john@localhost:/usr/bin $
How to use pipe in Linux
Answer:
Pipe | is very useful when you want to redirect the output of a program as an input of another program.
The combinations of using pipe in Linux is almost unlimited.
Some common usage:
1. count the number of lines in a file
cat test.txt | wc -l
2. read a very large text file
cat large.txt | less
3. filter filename from find util
find -type f | grep foo.txt