BigOncleSam

SysAdmin Guide

Jul 23rd, 2018
289
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.02 KB | None | 0 0
  1. # Dell tools
  2. omreport
  3. omreport processors
  4.  
  5. # Kill users processes
  6. su - username -c 'kill -9 -1'
  7.  
  8. AWK QUICK COLUMNS
  9.  
  10. Most of the time when you use awk from the command line,
  11. you're doing something simple like this:
  12.  
  13. ps -ef | grep netscape | awk '{print $2}'
  14.  
  15. To save typing, use this script when you only want to
  16. use awk to print out one or more columns:
  17.  
  18. ------------------- CUT HERE ---------------------------
  19. #!/bin/ksh
  20. # awkc - print out one or more columns
  21.  
  22. p=\$$( echo $1 | sed 's/,/,\$/g' )
  23. shift
  24. eval "awk '{ print $p }'" $*
  25.  
  26. # eof
  27. ------------------- CUT HERE ---------------------------
  28.  
  29. Now you can do things like:
  30. ps -ef | awkc 2,1
  31. or
  32. awkc 1,2,3 /var/adm/messages*
  33.  
  34. Retirer ^M
  35. :%s/^V^M//g
  36.  
  37. # Modules Kernel
  38. lsmod
  39. modprobe
  40.  
  41. # bash curl-piped args
  42. curl -sSL https://raw.githubusercontent.com/ronggang/transmission-web-control/master/release/install-tr-control.sh | bash -s auto
  43.  
  44. # grub rescue
  45. echo "init=/bin/sh" >> /boot/cmdline.txt
  46. mount -o remount, rw /
  47. passwd root
  48. sync
  49. exec /sbin/init
Advertisement
Comments
  • User was banned
Add Comment
Please, Sign In to add comment