Category Linux

linux eternal bash history all users secured

I use this on my unix/linux boxes for eternal bash history for all users (place in /etc/bashrc) if [ “$BASH” ]; then export HISTTIMEFORMAT=”%Y-%m-%d_%H:%M:%S ” export PROMPT_COMMAND=”${PROMPT_COMMAND:+$PROMPT_COMMAND ; }”‘echo “`date +’%y.%m.%d-%H:%M:%S:’`” $USER “(“$ORIGINAL_USER”)” “COMMAND: ” “$(history 1 | cut -c8-)”…

Linux List Free Memory Pretty Output

Who doesn’t like pretty command output? resize; echo -ne ‘\n’;echo “===========================================”;ps -eo user,%cpu,%mem,rsz,args|sort -rnk4|awk ‘BEGIN {printf “%s\t%s\t%s\t%s\t%s\n”,”USER”,”%CPU”,”%MEM”,”RSZ”,”COMMAND”}{printf “%s\t%g’%’\t%g’%’\t%d MB\t%-10s\n”,$1,$2,$3,$4/1024,$5}’|head -n30;echo “===========================================”;echo -e “\n===========================================”;vmstat -s -S M|head -n10;echo “===========================================”; Sample output: Or to see output with pid resize; echo -ne ‘\n’;echo…

install java centos

How do I install java on centos? Step 1: download the JDK or JRE from Step 2: chmod +x Step 3: Execute Package Example: [root@interweb tmp]# wget [root@interweb tmp]# mv jre-6u25-linux-x64-rpm.bin\?e\=1305390057\&h\=b1bb96445e6d1965e1c566f5279a49f2 jre-6u25-linux-x64-rpm.bin [root@interweb tmp]# chmod +x jre-6u25-linux-x64-rpm.bin [root@interweb…

setup ssh cent-os

install the server and client # yum -y install openssh-server openssh-clients Start the service: # chkconfig sshd on # service sshd start Make sure port 22 is opened: # netstat -tulpn | grep :22 source:

Red Hat Linux cheat sheet commands examples RHEL

Useful Linux Commands (Red Hat) () Revised 3/1/2000 Getting information man commandname display the manual page for a particular command named commandname man -S sectionnumber commandname display the manual page under a specific section numbered sectionnumber for the command named…