Create a directory tree in Linux
Answer:
To create a directory tree, no matter if parent directories exist or not, e.g. /data/project/backup
# mkdir -p /data/project/backup
Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.
Create a directory tree in Linux
Answer:
To create a directory tree, no matter if parent directories exist or not, e.g. /data/project/backup
# mkdir -p /data/project/backup
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 $