Showing posts with label unix. Show all posts
Showing posts with label unix. Show all posts

Thursday, 20 March 2008

Unix Aliases

Absolutely awesome. If you have a command you use over and over again, chuck it in a login script and give it an alias.

When using the bash shell, include aliases in ~/.bash_login (create the file if it doesn't exist already). Some useful aliases I've already added in macOS are the following:
  • alias ll='ls -la'
  • alias clr='clear'
  • alias here='open -a finder .'

The last one is really cool. It opens a finder window at the current terminal location.

Wednesday, 19 March 2008

Unix pipes and other commands

Pipes "|"are really cool. They redirect output from one command and pass it as input into the next command. A useful command to use in this situation is grep which pattern matches line by line and displays that line if the match succeeds, but grep -v inverts how the command works, and displays every line that doesn't match the pattern, making it useful as a filter...very cool.

Monday, 17 March 2008

Apache settings

Main files: httpd.conf and .htaccess. The first sets some site-wide settings. It seems to be similar to web.config in .NET. .htaccess works on a per-directory basis.