Posts Tagged ‘Linux’
Using Linux Ubuntu 10.04 Lynx server
A few weeks ago, I wrote a blog entry asking the community about your thoughts on Fedora/CentOS versus Debian/Ubuntu.
In the end, I decided that there was so much discussion going on about Ubuntu that I wanted to give it a try. So I’ve been using Linux Ubuntu 10.04 Lynx server. I’ve setup an instance at Amazon Web Services (AWS) Elastic Cloud Computing (EC2).
Overall, things seem pretty straight forward and there seems to be quite alot more documentation out there about how to use/configure Ubuntu. There is definitely a larger community. I’m coming from cPanel (on CentOS 5) to Ubuntu, so I’m really coming from the cPanel discussion forums/”How To” blogs to the Ubuntu discussion forums/Blogs.
Working with EC2 has been quite a steep learning curve, but there are loads more possibilities, such as the ability to detach a storage volume, shut down a virtual machine, and start up a larger, more robust virtual machine and re-attach the volume in just a few minutes with little planning or preparation.
It is a little tedious working with the sudo command however. I’ll have to admit that it is hard getting used to using it all the time.
Are there any others out there using EC2 extensively?
How to recursively set the file permissions for all .php files on a *nix box
I had a need today to change the security of all .php files in a sub-directory, which contained dozens of sub-directories.
I figured out how to do it recursively with the find command. In the example below, I set all *.php files to chmod 755.
All other files with a file extension other than .php and directories were unaffected.
$ cd /mydirectory $ find . -type f -name '*.php' -exec chmod 755 {} \;
find all large files on Centos/Red Hat/Fedora
Quick and handy way to find all files in a particular directory.
find /home/ -type f -size +5000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
The same command on Ubuntu is:
find /home/ -type f -size +5000k -exec ls -lh {} \; | awk '{ print $8 ": " $5 }'
You can replace the “5000″ above with a number of your choosing. The example above finds all files larger than 5 Megabytes.
If you just want to find a particular filename try:
find | grep searchterm
where searchterm contains the part or all of the filename that you are looking for.