5 useful Mac OS X command line tips you should know
Mac OS X, Tips & Tricks, Command Line
Like many other power users, I’m addicted to the Mac OS X command line, any reason at all for me to launch the terminal I take as an opportunity to learn more about the powerful backend of our favorite operating system. Here I have gathered 5 useful commands that will make your life easier when you’re working in the command line interface, so launch the Terminal and try them out! If you have any others that you think should be added to this list, feel free to post them in the comments, and be sure to check out 10 OS X Command line utilities you might not know about for more.
Delete an entire line of commands/text
Don’t repeatedly hit the delete key, all you need to do to clear your prompt is hit Control-U and your slate will be clean.
Create a nested directory structure immediately
If you need to create the directory structure /annoyingly/long/and/outrageous/directory/path/ , instead of typing mkdir annoyingly, cd annoyingly, mk long , etc etc, simply type the following: mkdir -p /annoyingly/long/and/outrageous/directory/path/ and your nested directory structure will be created in full immediately!
Clear the Terminal screen
If you have a screen full of nonsense, clearing the Terminal screen is very easy, you can either type clear or just hit Control-L and you’ll have a clean slate.
Run a process in the background
If you want to set a process to run in the background, simply put a & after it, the command will execute but you’ll still be in the same shell, allowing you to continue as usual.
Run the last executed command
Typing !! will run whatever the last command that was executed, typing !l will run the last command starting with the letter l, and so forth.
Mac Deals from the Apple Store:
Social bookmarks:
- del.icio.us | Digg it | Furl | ma.gnolia | Netscape | reddit | StumbleUpon | Yahoo MyWeb |
Comments:
Comments: 1
Comment from Sean
Time: July 8, 2008, 3:38 pm
Hey,
another way to run or rather put a started process in the background is by interrupting the current process with ctrl+z, then typing “bg” to re-activate it in the background. If you happen to need it in the foreground again, simply type “fg”. The latter one does also work for processes started in the background with “&”.


Write a comment