Sunday, March 22, 2009

Linux Tips

How to take the output of a command and pass it as arguments to another command ?
  • using pips
  • using xargs: $ ls /bin/b& | xargs -t dpkg-query -S
How to watch commads:
  • $ watch -n 10 'ls -la'
  • $ watch -d 'ls -la'
Using bash history:
  • $ history
  • $ ! 33
  • $ ! !
  • $ ! ls:s/CF/1
Bash: the shell
there are two types of files holding the bash settings, startup files and initialization files
  • startup files: runs for any shell that is a login shell (/etc/profile/.bash_profile, .profile, and .bash_login)
  • initialization files: runs for interactively running shells (not shell scripts) (/etc/bash.bashrc, ~/.bashrc)

sudo:
  • every use of sudo gets logged in /var/log/secure

No comments: