Posts

Showing posts from April, 2016

memory | prstat -t | vmstat | top | java -XX:+PrintFlagsFinal -version

 prstat –t # prstat -t NPROC USERNAME SWAP RSS MEMORY TIME CPU 377 oracle 16G 16G 50% 133:03:55 0.1% 37 root 198M 238M 0.7% 3:48:10 0.0% ps -eo pid,pmem,vsz,rss,comm | sort -rnk2 | head

awk -F, '$6==value' | count the number of words in a file: awk '{ total = total + NF }; END { print total+0 }'

Show if column 6 contains value in the file file.csv.gz gzcat file.csv.gz | awk -F, '$6== value '

openssl file encryption | decryption

Assuming your  user  and  pass  are stored in  user.txt  and  pass.txt Encrypt with: $ openssl aes-256-cbc -salt -in user.txt -out user.txt.enc -pass file:pass.txt Decrypt with: $ openssl aes-256-cbc -d -salt -in user.txt.enc -out user.txt.dec -pass file:pass.txt In order to have more secure encryption you can try to use you own complex salt with  -S "your complex string" . However this might be sufficient for most uses.

neat graph intrface

neat graph intrface 

linux bootup sequence

linux bootup sequence 1 bios, executes mbr where bootloader sits 2 mbr reads kernel into memory 3 grub (grund unified bootloader) kernel starts Init process. 4 kernel executes the /sbin/init program. init reads inittab, executes rc.sysinit 5 init - the rc script then starts services to reach the default run level 6 run level programs - these programs are executed from /etc/rc.d/rc*.dl lilo linux. boot loader

dirs , pushd - directories

# mkdir /tmp/dir1 # mkdir /tmp/dir2 # mkdir /tmp/dir3 # mkdir /tmp/dir4 # cd /tmp/dir1 # pushd . # cd /tmp/dir2 # pushd . # cd /tmp/dir3 # pushd . # cd /tmp/dir4 # pushd . # dirs /tmp/dir4 /tmp/dir4 /tmp/dir3 /tmp/dir2 /tmp/dir1 [Note: The first directory (/tmp/dir4) of the dir command output is always the current directory and not the content from the stack.]

compgen -c To list all the commands available to you

Sample outputs: ls if then else elif fi ....

difference disown nohup and &

disown -r -------------- There's no reason to run  nohup command & disown ,  nohup  will already disown it for you. nohup  is  defined by POSIX  while  disown   is not . This means that while many shells (e.g.  bash ,  zsh ,  ksh ) have it, others (for example  tcsh ,  csh ,  dash  and  sh ) won't have it. disown  can be used  after  a command has been launched while  nohup  must be used before. As far as I can tell, the actual effect of the two commands is the same. They each have features that the other lacks (see  help disown  and  man nohup ) but their basic function is the same, yes. ------------- 154 down vote accepted Let's first look at what happens if a program is started from an interactive shell (connected to a terminal) without  &  (and without any redirection). So let's assume you've just typed  foo : The process running  foo  is created. The process inherits stdin, stdout, and stderr from the shell. Therefore it is als