Advertisement
albatrossdigital

basic command line

Nov 15th, 2011
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. # disk free
  2. df -h
  3.  
  4. # free memory
  5. free -m
  6.  
  7. # unblock from firewall
  8. nano /etc/csf/csf.deny # find ip and comment out
  9. csf -r
  10.  
  11. # recursively download a dir via ftp
  12. wget -r ftp://user:pass@server.com/
  13.  
  14. # transfer dirs over ssh
  15. scp (see tutorials)
  16.  
  17. # show processes, kill a specific process
  18. ps aux
  19. kill <pid>
  20.  
  21. # directory sizes
  22. du -h --max-depth=1 . | sort -n -r
  23.  
  24. # find big files
  25. find /etc -size +100k -size -150k
  26.  
  27. # search and replace over dirs
  28. sed -r 's/thisip/thatip/g'
  29. find ./ -type f -exec sed -i 's/apple/orange/g' {} \;
  30.  
  31.  
  32. # fix locales
  33. sudo dpkg-reconfigure locales
  34.  
  35. # rsync (from remote server)
  36. rsync -avz thegeekstuff@192.168.200.10:/var/lib/rpm /root/temp
  37.  
  38. #some permission stuff from https://wiki.archlinux.org/index.php/Chmod
  39.  
  40. # hit directories (recursively) in a folder "/" after directory is IMPORTANT
  41. find directory/ -type d -print0 | xargs -0 chmod 755
  42.  
  43. # hit files (recursively) in a folder "/" after directory is IMPORTANT
  44. find directory/ -type f -print0 | xargs -0 chmod 644
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement