My little cheatsheet for all those line commands I can't always remember:
find . -name \*.html -print Find the names of all files, starting at the present directory (.) that end in '.html'
find . -name \*.html -print | xargs grep "texts" Find the names of all files, starting at the present directory (.) that end in '.html'. Next pipe that list of names (xargs), GREPing each one for the given text string.
ls -laR Directory listing of all files, done recursively
ls -laF | grep / Directory listing of directories only
tar cvf (file name) .
tar xvf (file name)
file (name) to find out what kind of file it is
cp -r cfdocs ../basetest/cfdocs Copy whole subdirectory
touch (file name) To update file access parms
which (program name) To find which copy of a program will execute
more with / (search) After the first screen full of MORE output, type '/' followed by a search string to get where you want to be.
passwd -d (userID) Reset password to 'prompt for new' at logon
find . ! -user siteadm -exec chown siteadm {} \; Find all files not owned by 'siteadm' and change the ownership of them to 'siteadm'
find . ! -perm -g+w -exec chmod g+w {} \; Find all files without the grup write privilege and set them to group write
ps -ef | grep defunct Locate hung processes in the system
Administrivia: |
doc ID: http://www.botos.com/unix.html
Copyright © 1996-2004 Michael Botos. revised: 08/06/2004 Your comments on presentation style, technical content, and anything else relating to the Web are always welcome. Send them to me at |