Categories
Laptop OsX

How To Take A ScreenShot on Mac

You can capture a Screenshot of your entire screen or just a selected portion of it. The screenshot is automatically saved to your desktop.

How to take a screenshot of your entire screen

  1. Press Shift+Command (⌘)+3.
  2. The screenshot will be saved as a .png file on your desktop

How to take a screenshot of a selected portion of your screen

how to take screenshot in mac

  1. Press Shift+Command (⌘)+4. The pointer changes to a crosshair.
  2. Move the crosshair to where you want to start the screenshot, then click and drag to select an area.
    Note: While dragging the Crosshair, you can hold Shift, Option, or Space bar to change the way the selection moves
  3. When you have selected the area that you want, release your mouse or trackpad button. To cancel, press the Esc (Escape) key before you release the button.
  4. The screenshot will be saved as a .png file on your desktop
Categories
Open Source Solutions

Git – Undo Uncommitted Changes to a Specific File

Here are the steps remove uncommited changes to a file in Git:

  • Firstly check the list of uncommited changes in your system by using the command “git status
  • To remove the changes to the file use the command: git checkout <filepath>  Make sure you use the full path as seen in the git status output
  • Execute “git status” again to make sure that the file is now clean again.
Categories
Linux

Search for Multiple Strings in Linux Command Line

Problem:  I have a text file with a lot of information, I need to pick lines of information containing a particular pattern(s) and store it in another file

Solution: Use egrep to filter out lines with required pattens and write the result in a file.

egrep is actually a short form for “grep -E”, a command used to handle pattens while searching.

For Eg.
Lets say you have a text file with a list of file names and you want to filter out only those names that are of a certian type. For the sake of this example lets assume you want to only see filenames of files ending with .mp3 or .wav or .ogg

The command you need to use is:

cat file | egrep “.mp3|.wav|.ogg” > musiclist.txt

Voila you now have a file that sorts out your music files.

Bonus: If you want to list out all the music files you have stored under a particular directory you can use the following command

ls -1R /path/to/music | egrep “.mp3|.wav|.ogg” > musiclist.txt

Reblog this post [with Zemanta]