

(Naturally, this can be escaped with Ctrl-C too.) 8. For example, let’s caffeinate for 10 minutes (600 seconds): caffeinate -u -t 600 To caffeinate for a period of time use caffeinate -u -t. To disable your Mac from falling asleep, just type: caffeinate So if you want it to end up in the Downloads, change directory there before downloading: cd ~/Downloads/ If you don’t want to use the browser to download a file, the command line can help.īefore downloading with command line, notice that the downloaded file will end up in the directory where you currently are. Download Files from the Internet via Command Line The syntax is: ditto įor example, if you have a folder called folder1 and you want to create a new folder, folder2, and copy-paste the contents of folder1 there, just type: ditto folder1 folder2 6. Use ditto to copy and paste files from a folder to another. To hide these files back, run the above commands by replacing TRUE with FALSE. Do not delete anything you are not sure you want to delete.

There is likely a reason why they are hidden by default. To show hidden files and folders, type these two commands: defaults write AppleShowAllFiles -bool TRUEīe careful with the hidden files. To execute the suggested command, hit enter. As you type, the command line keeps suggesting a command that matches what you’ve typed.letters you remember from the command you’re searching for). To find earlier commands from your command line’s history: It’s is a time saver when there is a complex command you’ve run some time ago and you cannot remember/find it. View your command line’s command history by typing history in the command line: history 3. Now type in surf and opens up in the default browser. Save the file and restart the command line window.Ĥ. Create a new alias surf by adding the following into the.

To create an alias surf for this command:Ģ. To open up via the command line you need to use open syntax: open With the command line, you can create an alias for a command.Īs an example, let’s create an alias surf that opens up. List the Contents of a Folder and Its Subfolders View Contents of a File Without Opening It

