What are some things that can be done in the terminal?
April 9, 2004 8:25PM
edited January 2014
I was just wondering how to do some cool stuff the terminal.
Reply 1 of 3
April 9, 2004 11:38PM
You can run command line programs in the terminal, that's about the coolest thing about it.
The most common programs I use are:
ssh - log on to remote hosts
top - list processes/cpu usage/memory usage
ps - list processes
lsof - list open files
ftp - use command line ftp program
man - manual page for a program
rm - delete files
cd - change directory
ls - list current directory
But there are a ton of programs, just hit tab-tab to see them all (if you're in bash). You can also install more programs, fink is especially good for that.
Reply 2 of 3
April 9, 2004 11:59PM
Here are some useful commands that are rather basic.
See everything that's running (including background processes):
Check all network connections to your computer:
netstat -p tcp
Check your uptime:
Check your current system stats:
Do an incredibly fast search for some file on your hard drive (uses a cached database that can be several days old):
Find all lines in some_file that contain the word foobar:
grep foobar /path/to/some_file
Take this_file, and replace all instances of the word foo, and replace it with the word bar, saving the result to that_file:
sed this_file s/foo/bar/g > that_file
Find a command that does something:
Look up what some_command does:
If you have the developer tools installed, then you can:
Make a file invisible:
/Developer/Tools/SetFile -a V /path/to/some/file
and install all sorts of fun command line and X11 apps.
There's much more, but this should give you a start.
Edit: Oh, and there's also the text editors... pico, emacs and vi (listed in difficulty to learn). Pico is rather simple, but Emacs is more powerful. Try out the tutorial in emacs.
Reply 3 of 3
April 10, 2004 12:05AM
Ok, I have to warn people because I'm not
bad of a person. Do not do that, type in anything close to that, or even look at it for that matter. Never use sudo, su, root or type anything that increases your privileges unless you know what you are doing.