Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Clear the terminal screen from the keyboard UNIX
Here is another shortcut (undocumented I believe) I found accidentally for use in a terminal window. Hitting Option-A will clear the screen as would the command 'clear'.

[Editor: You can also use Control-L, which is more standard]
  Post a comment  •  Comments (5)  
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[34,347 views] Email Article To a Friend View Printable Version
Counting files in a directory from the terminal UNIX
Sometimes, it's the little things. I was trying to replicate an error someone was experiencing involving a large number of files in a directory. So I made my large directory, opened a terminal, then did an "ls" on the directory. Everything scrolled by, and then I noticed that there's no total file or total size information. Size information is easy to get (type "du directory_name"), but how do you know how many files are in a directory in the terminal?

Given my basic UNIX skills, I headed to the "man" pages for "ls", but found nothing useful there. Same thing with "man du". I finally had to use a lifeline and phoned a friend ;-). The answer definitely speaks to the sometimes non-intuitive nature of UNIX, but also shows how you can pretty much make it do what you want by combining commands.

To count the number of files in a directory, enter:
cd directory_to_count
ls | wc -l
That's the "ls" directory listing command, the vertical bar (which 'pipes' the output of "ls" to the next command), and then the "wc" word count command with the "l" (lower-case L) option to count the number of lines instead of characters. The output of this command is the number of files in the directory. Subdirectories count as one entry; the files in the subdirectory are not counted.

Of course the GUI is much easier, but if you're connecting remotely via SSH, you won't have that option available!
  Post a comment  •  Comments (4)  
  • Currently 5.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (3 votes cast)
 
[25,091 views] Email Article To a Friend View Printable Version
Quick ASCII character table view UNIX
I've seen a few applications on VersionTracker to display the ASCII character set.

If you don't need a fancy GUI, open a terminal and type man ascii instead.
  Post a comment  •  Comments (2)  
  • Currently 4.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[7,634 views] Email Article To a Friend View Printable Version
SETI script and the Console app UNIX
I run the SETI@home command line program on both cpus in my OSX box. After doing this for many months I finally got sick of seeing their terminal icons in the dock, so decided to run SETI in the background and not tie up a terminal (or two) to monitor SETI output.

Read the rest of this article for an excellent tutorial on how to set up Seti to run without requiring a terminal window...
read more (169 words)   Post a comment  •  Comments (3)  
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[3,755 views] Email Article To a Friend View Printable Version
Directory list shortcuts UNIX
in the terminal, the command "ls" lists the directory contents of the directory you're in.
"ls -l" lists the directory contents in "long" format, allowing you to see each file's/directory's privileges.
"ls -la" lists the COMPLETE directory contents in "long" format, including all . files.

Shortcuts:
simply typing "l" is equivalent to "ls -l"
simply typing "ll" is equivalent to "ls -la"

[Editor: And typing "alias" will show you some other pre-defined shortcuts!]

hope this helps!

jmil
  Post a comment  •  Comments (2)  
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[3,475 views] Email Article To a Friend View Printable Version
Mac OS X Terminal Basics FAQ UNIX
I originally wrote this FAQ because I moderate the OS X General Discussion forum at MacNN, and there have been a ton of newbie UNIX questions recently. I figured I'd compile a FAQ: essentially UNIX for the Mac User -- An Introduction that would explain some fundamental concepts and would get a Mac user a little more confident about the big black deep that lurks underneath Aqua.

Trust me. I know how some people feel about this frightening new UNIX core -- I've seen it time and time again. This FAQ may get you on your way to using UNIX more, maybe, but above all I really hope it dispels some fears by spreading information about some basic topics. The known is always less feared than the unknown.

The FAQ is located here.

Enjoy!

-gzl.
  Post a comment  •  Comments (6)  
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[9,201 views] Email Article To a Friend View Printable Version
Double-click remote connectivity (with SSH) UNIX
I am lazy and don't like to type ssh me@wherever.com whenever I want to log in to a remote server to check my mail.

So, using the Terminal I created an executable file like this:
echo 'ssh myusername@server.com' > click_me
chmod 755 click_me
Then, from the Finder, get info on the file 'click_me' and set the default application to Terminal. Double-click and voila!

Even better: put the 'click_me' file in your startup applications, and your prompt will be ready and waiting at login.
  Post a comment  •  Comments (8)  
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[7,779 views] Email Article To a Friend View Printable Version
A collection of UNIX tips UNIX
I have compiled a bunch of hints about the Unix underpinnings of OS X, including how to get Sendmail running, making finger work, tons of links, and lots of other useful information.

[Editor's note: Ian has taken his web site off line, but the collection of tips has been posted in the body of this article. If you'd like to see the collection, simply read the rest of this article. There's minimal HTML markup, but there's a lot of good info here. Happy reading!]
read more (524 words)   Post a comment  •  Comments (0)  
  • Currently 3.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[35,724 views] Email Article To a Friend View Printable Version
Setting up Apache access restrictions per user UNIX
[Editor's note: .htaccess is a means of placing password protection on web sites, and pages within sites. digidoodle had been trying to get it working for each user's individual site on Mac OS X ... here's what he discovered]

I just submitted a question that has been nagging me for days about how to get .htaccess files working, and I just figured out the very simple answer.

I had been spending all my time messing with the setting in the main httpd.conf file, and then realized that in the private/etc/httpd/users directory is a small config file for each user.

This is the file where the following change needs to be made:

AllowOverride none changes to AllowOverride AuthConfig

Every other source I found on the web talked about altering httpd.conf, but changes to this will not effect the pages within any particular user folder. Hope this helps somebody else!

Nate
  Post a comment  •  Comments (5)  
  • Currently 5.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[13,092 views] Email Article To a Friend View Printable Version
Using BBEdit to work on system files UNIX
No need to learn vi or pico to edit system files, you can use the great BBEdit editor to work on system text files.

Read the rest of this article if you'd like to make it easy to open BBedit from the terminal to work on system files! Thanks to Marc L. for submiting this tidbit!
read more (150 words)   Post a comment  •  Comments (15)  
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[6,595 views] Email Article To a Friend View Printable Version