How to find, look or search for a specific file in linux

| No Comments »

A common problem for those aren’t aware of using linux are locating certain files(this is when troubleshooting, or simply doing steps from a guide)

Problem: I’m looking for a file in linux! How do I find this?

Answer: You can easily find a file by using the find command:

find / -name “httpd.conf” -print

Note: the -print option will print out the location of the name, / represents what location to start.

If you are interested in knowing more about the find command, look no further than the following link: http://www.ling.ohio-state.edu/~kyoon/tts/unix-help/unix-find-command-examples.htm


Unix Super Tip: How to CHMOD all your files recursively

| No Comments »

Problem: How do I set permissions to my files and/or directories without manually setting them up individually?

Note: You may need administrator privileges for these to work, if that’s the case simply add a sudo before typing the commands below.

If you want to chmod all your directories:

find . -type d -exec chmod 755 {} \;

and for files:

find . -type f -exec chmod 644 {} \;

That’s it!


Unix Super Tip: Easy Access to your files and directories by creating symbolic links(shortcuts)

| No Comments »

The directory structure of Mac and Linux(both are UNIX) tends to get really _really_ long. But don’t worry, by using the ln -s, or Symbolic Link command in the terminal(unix shell), creating “shortcuts” to your folders or files is now a breeze.

ln -s   Here’s an example: ln -s /Library/Python/2.5/ /shortcuts/PYTHON  

The effect: cd /shortcuts/PYTHON is now the same as cd /Library/Python/2.5/, removing a shortcut is similar to removing a file: rm /shortcuts/PYTHONthat’s it!