Simon Holywell

Text Post

Handy Linux Commands

I use most of these commands every day to simplify my terminal interactions with an Ubuntu development box.  This is more of a personal reference but thought I would share incase you find it useful.

Task Command
Get all users on the system

for user in `getent passwd | cut -d: -f1`; do id $user; done

Delete all .svn or any file name by replacing .svn in the command with your filename find ./ -name ".svn" | xargs rm -Rf
Look for enabled modules or particular environment settings in PHP

php -r 'phpinfo();' | grep 'searchkeyword'

for example php -r 'phpinfo();' | grep 'json' to find out if JSON is installed and what version of the module is available

Push a line of text into a file

to reset file content to ‘text to push’ – echo 'text to push' > /etc/file
to append to file content ‘text to push’ – echo 'text to push' >> /etc/file

Create an empty file touch filename.ext
Watch a file on the command line.  Useful for viewing logs whilst debugging. tail -f /var/log/filename.ext
use control + c to break
Break the current command Use the keyboard combination control + c
Access to MySQL Converting Microsoft Access MDB Into CSV Or MySQL In Linux
View Comments
Posted on Tuesday, May 12, 2009. Tagged with: debianlinuxsshubuntuComputing

Comments powered by Disqus

Simon Holywell

My name is Simon Holywell and I am a Zend Certified PHP Developer with experience working for Web agencies, marketing companies and corporate IT in Australia and the United Kingdom. When I am not developing I can be found riding my motorbike, skateboarding or snowboarding. More information about my work history can be found on my online CV.

Facebook
LinkedIn
Flickr
Twitter
del.icio.us

Previous Next