terminal trickshttp://www.maclife.com/taxonomy/term/8853/all
enHow to Hide and Rename Files in Terminal http://www.maclife.com/article/howtos/how_hide_and_rename_files_terminal
<!--paging_filter--><p>One helpful reader sent in a batch of Terminal tricks for renaming files and hiding them. Read on to learn more!</p><p>First, using the mv command, you can rename files in Terminal. For instance, if you wanted to rename filename.png to file_1.png, I would type the following command into Terminal:</p><p>&nbsp;</p><pre>mv filename.png file_1.png</pre><p>&nbsp;</p><p>You can also hide files and folders using the chflags hidden command, like this:</p><p>&nbsp;</p><pre>chflags hidden file.png</pre><p>&nbsp;</p><p>If you wanted to open that hidden file, then you can use the open command, like this:</p><p>&nbsp;</p><pre>open file.png</pre><p>&nbsp;</p><p>Or, you could open all files with the same file type in that folder by issuing this command with an asterisk (also called a wildcard):</p><p>&nbsp;</p><pre>open *.png</pre><p>&nbsp;</p><p style="text-align: center;"><img src="/files/u307916/2012/05/ask/terminal_tricks.jpg" width="620" height="404" /></p><p style="text-align: center;"><strong>Easily open your hidden files through Terminal with the open command.</strong></p><p>&nbsp;Remember that if you want to make a hidden file or folder visible, you can issue the following command:</p><p>&nbsp;</p><pre>chflags nohidden file_1.png</pre><p>&nbsp;</p>http://www.maclife.com/article/howtos/how_hide_and_rename_files_terminal#commentsTerminalterminal tricksMacHow-TosFri, 18 May 2012 19:39:00 +0000Cory Cohon 13617 at http://www.maclife.comTerminal 101: Track and Kill Processeshttp://www.maclife.com/article/columns/terminal_101_track_and_kill_processes
<!--paging_filter--><p><img src="/files/u12635/terminal_101_teaser_0.png" width="150" height="150" class="graphic-right" /></p><p><em>Every Monday, we'll show you how to do something new and simple with Apple's built-in command line application. You don't need any fancy software, or a knowledge of coding to do any of these. All you need is a keyboard to type 'em out!</em></p><p>Activity Monitor is one of OS X's many helpful built-in tools to help you figure out what applications are over-utilizing your Mac's processing power. It also gives you a glimpse into what applications are doing in the background and which ones are hogging up all of the resources. Today, we'll teach you how to do this in Terminal. And once you've mastered today's command, consider enabling <a href="http://www.maclife.com/article/howtos/how_enable_ssh_your_mac" target="_blank">SSH</a> to remotely monitor your Mac's activity.</p><h3>View Your Processes</h3><p>Open Terminal, type in&nbsp;<em>top</em>, and press the enter key.You'll be presented with a real-time look at everything going on with your Mac's inner components.&nbsp;<br /><a class="thickbox" href="/files/u12635/terminal_top_1.png"><img src="/files/u12635/terminal_top_1.png" width="620" height="432" class="thickbox" /></a><br />At the top of the window (show in red), you'll see how many applications are running, which are stuck in a "busy" state, which are "sleeping", and how many threads are currently being occupied. Also shown here is your CPU (processor) usage, including the percent being used up by you, by the system, and what's sitting idle.<br /><br />The next section (shown in green) is devoted to memory usage (both physical memory and virtual memory). The last section (shown in blue) shows network information (packets being sent in and out) and hard drive information (the amount of data being read and written).<br /><br />The bottom part of the view (shown in yellow) will show you processing currently being executed on your system. You will be able to see the PID (Process ID), the command or application being run, the percentage load on the CPU by the app, the execution time, how many threads are being used by the applications, and more.</p><h3>Kill a Process</h3><p><a class="thickbox" href="/files/u12635/terminal_top_2.png"><img src="/files/u12635/terminal_top_2.png" width="620" height="432" class="thickbox" /></a></p><p>If you spot an application that is hogging up all of the resources from your Mac, you may want to stop it from running (or “kill the process", as it’s often referred to). This may be an unresponsive application, or perhaps an application that you started running and then forgot about. Either way, you can stop the process by entering the following command into a new Terminal window:</p><pre>kill -9 PID</pre><p>Replace PID in the above command with the process ID of the process that you’d like to stop running (this can be obtained by running the <em>top</em> command again). After pressing enter, the application will stop running. <br /><br />If you don’t have sufficient privileges to stop the running application, you may need to place “<em>sudo</em>” in front of the above command (so, it would read “<em>sudo kill -9 PID</em>”). When doing this, you will be prompted to enter your administrator password before the application will quit.<br /><br /><em>Cory Bohon is a freelance technology writer, indie Mac and iOS developer, and amateur photographer. Follow this article's author, <a href="http://twitter.com/coryb/" target="_blank">Cory Bohon on Twitter</a>.</em></p>http://www.maclife.com/article/columns/terminal_101_track_and_kill_processes#commentsColumnsMacprocessesTerminalTerminal 101terminal tricksTipstoptricksMacMon, 27 Feb 2012 20:31:24 +0000Cory Bohon13398 at http://www.maclife.comTerminal 101: Burning Discs http://www.maclife.com/article/howtos/terminal_101_burning_discs
<!--paging_filter--><p>Welcome to our new weekly column, Terminal 101, where we'll show you how to do something new and simple with Apple's built-in command line application. You don't need any fancy software, or a knowledge of coding to do any of these. All you need is a keyboard to type 'em out! This week, we'll show you how to burn, erase, and eject stuck discs with Terminal. Read on!</p><h3>Burning Discs with drutil</h3><p><a class="thickbox" href="/files/u12635/drutil_1.png"><img src="/files/u12635/drutil_1.png" width="620" height="426" class="thickbox" /></a></p><p>You can quickly and easily burn data discs sing the drutil command. Simply insert a blank disc into your Mac, open Terminal, and type the following command: <br /><br /></p><pre>drutil burn </pre><p><br />Next, drag a single folder containing the files that you wish to burn into the Terminal window. You will see the path to the folder typed into Terminal for you. Press Enter to begin the burning process. <br /><br />Terminal will notify you when it's finished with the operation.</p><h3>Erasing Discs with drutil</h3><p><a class="thickbox" href="/files/u12635/drutil_2.png"><img src="/files/u12635/drutil_2.png" width="620" height="426" class="thickbox" /></a></p><p>If you have a rewritable disc (Usually labeled CD-RW, DVD-RW, etc.), then you can erase it through the Terminal. Type the following command to erase your disc: <br /><br /></p><pre>drutil bulkerase quick</pre><p><br />Using this command will perform a "quick" erase, but you can also use "full" instead to perform a full erase, which will take longer to complete. Press enter after entering the command to begin the erasing process. You will see the erase progress in the Terminal window.</p><h3>Ejecting Discs with drutil</h3><p><a class="thickbox" href="/files/u12635/drutil_3.png"><img src="/files/u12635/drutil_3.png" width="620" height="426" class="thickbox" /></a></p><p>You can also eject discs right from the Terminal using the following command: <br /><br /></p><pre>drutil eject </pre><p><br />This command can be helpful if you have a disc in your Mac that refuses to be ejected by issuing commands in the Finder.<br /><br /></p><p><em><br />Cory Bohon is a freelance technology writer, indie Mac and iOS developer, and amateur photographer. Follow this article's author, <a href="http://twitter.com/coryb/" target="_blank">Cory Bohon on Twitter</a>.</em></p>http://www.maclife.com/article/howtos/terminal_101_burning_discs#commentsburnburnercdColumnsdiscdiskDVDTerminalTerminal 101Terminal Hacksterminal tricksMacHow-TosMon, 13 Feb 2012 21:57:19 +0000Cory Bohon13271 at http://www.maclife.com4 Terminal Tricks for Customizing your OS X Dock http://www.maclife.com/article/features/4_terminal_tricks_customizing_your_os_x_dock
<!--paging_filter--><p>You can easily utilize apps like <a href="http://www.bresink.com/osx/TinkerTool.html" target="_self">TinkerToo</a>l and <a href="http://www.apple.com/downloads/macosx/system_disk_utilities/macpilot.html" target="_blank">MacPilot</a> to customize your Dock, or you can be a real superstar and use a couple of Terminal tricks. There are a ton of Dock tricks you can do, but here are four that are practical and easy to do. Follow along to learn how to pin your dock to one size, get super enlarged icons, turn your 3D Dock into a 2D Dock and disable Dashboard -- once a for all!</p><h3>1. Turn Your 3D Dock into a 2D Dock</h3><p><a class="thickbox" href="/files/u12635/dock_1.png"><img src="/files/u12635/dock_1.png" width="620" height="35" class="thickbox" /></a></p><p><strong>Recognize this? It's the Dock style that normally appears when you pin it to the left or right.</strong><br /><br />Open Terminal and type in the following two commands: <br /><br /><code>defaults write com.apple.dock no-glass -boolean YES<br /><br />killall Dock</code><br /><br />The dock will now look 2D.&nbsp; If you want your reflective Dock back, just replace the “YES” in the above statement with a “NO” and re-run the two commands.<br /><br /></p><h3>2. Pin Your Dock to the Left or Right</h3><p><a class="thickbox" href="/files/u12635/dock_2.png"><img src="/files/u12635/dock_2.png" width="620" height="24" class="thickbox" /></a></p><p><strong>Using the end string, you can pin your Dock to the right-hand side of the screen.</strong><br /><br />You can pin your Dock to the left, right, or middle of the screen. To pin it to the left-hand side of the screen, type the following two commands: <br /><br /><code>defaults write com.apple.dock pinning -string start<br /><br />killall Dock </code><br /><br />Replace “start” in the above statement with “end” to pin the Dock to the right-hand side of the screen, or “middle” to return to the default middle of the screen position. <br /><br /></p><h3>3. Disable Dashboard</h3><p>For many, Dashboard is not a tool they use very often. You can disable it by typing in the following two commands in Terminal: <br /><br /><code>defaults write com.apple.dashboard mcx-disabled -boolean YES<br /><br />killall dock </code><br /><br />After doing that, you will no longer be able to activate Dashboard. But if for some reason you want to re-enable it, just replace the “YES” above with “NO” and re-run the two commands in Terminal. <br /><br /></p><h3>4. Increase Dock Magnification Past Allowable Size</h3><p><a class="thickbox" href="/files/u12635/dock_4.png"><img src="/files/u12635/dock_4.png" width="620" height="202" class="thickbox" /></a></p><p><strong>Admittedly, it's not very practical.</strong><br /><br />Apple has allowed a maximum maginification size of 128 pixels for their Dock magnification size. However, the following Terminal trick will increase that size to 256 pixels instead: <br /><br /><code>defaults write com.apple.dock largesize -float 256.000000 <br /><br />killall Dock </code><br /><br />To change the size back to the Apple-allowed maximum, replace “256” in the above statement with “128” and re-run the two commands. You can then adjust the size in System Preferences &gt; Dock.</p><p>&nbsp;</p><p><em>Follow this article's author, <a href="http://twitter.com/coryb" target="_blank">Cory Bohon on Twitter</a></em>.</p>http://www.maclife.com/article/features/4_terminal_tricks_customizing_your_os_x_dock#commentsCustomizationdockhacksMacTerminalterminal tricksTipstrickstweaksFeaturesMacHow-TosTue, 28 Jun 2011 20:10:05 +0000Cory Bohon11493 at http://www.maclife.com