How to Show hidden files on Mac OS X?

Standard

Unlike Microsoft Windows, by default OS X hides system files from end users. There is a perfectly reasonable explanation for this. Some of the files which are hidden, are important and damaging them could prevent your system from booting all together.

To do this all you need to do is:

  1. Open Finder
  2. Open the Utilities folder
  3. Open a terminal window
  4. Copy and paste the following line in:
    SUDO defaults write com.apple.Finder AppleShowAllFiles YES; killall Finder
  5. Press return
  6. Enter your administrator password when prompted
  7. Press return

You should find the finder window will disappear, along with the icons on your desktop. However, if you now launch a new finder instance you will now be able to see any hidden files or folders. Once you are done, perform the steps above however, replace the terminal command in step 4 with:

SUDO defaults write com.apple.Finder AppleShowAllFiles NO; killall Finder

If the above is not working for you, you may want to try switching YES/NO to TRUE/FALSE .. Beware that this is case-sensitive!

defaults write com.apple.Finder AppleShowAllFiles TRUE

If you are experiencing issues using the examples above, please post a comment using the comments system below.

How to manipulate files in Linux

Standard

Make a Directory:

$ mkdir dirname
$ mkdir dirname1 dirname2
$ mkdir -p dir1/dir2/dir3

Copy Files:

$ cp file file2

You can also copy multiple files into one directory with a single command:

$ cp file1 file2 file3 dir1

Moving or Renaming Files:

$ mv file file2

To move the file into another directory:

$ mv file dir1

If you want to rename the file to file2 and move it into another directory, you probably already figured out the command:

$ mv file dir1/file2

Deleting Files and Directories:

$ rm file

You can also delete more files at once:

$ rm file1 file2