Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Java Data Analysis

You're reading from   Java Data Analysis Data mining, big data analysis, NoSQL, and data visualization

Arrow left icon
Product type Paperback
Published in Sep 2017
Publisher Packt
ISBN-13 9781787285651
Length 412 pages
Edition 1st Edition
Languages
Concepts
Arrow right icon
Author (1):
Arrow left icon
John R. Hubbard John R. Hubbard
Author Profile Icon John R. Hubbard
John R. Hubbard
Arrow right icon
View More author details
Toc

Table of Contents (20) Chapters Close

Java Data Analysis
Credits
About the Author
About the Reviewers
www.PacktPub.com
Customer Feedback
Preface
1. Introduction to Data Analysis FREE CHAPTER 2. Data Preprocessing 3. Data Visualization 4. Statistics 5. Relational Databases 6. Regression Analysis 7. Classification Analysis 8. Cluster Analysis 9. Recommender Systems 10. NoSQL Databases 11. Big Data Analysis with Java Java Tools Index

The command line


On a Mac, the command line is accessed through the Terminal app (in Windows, it's called Command Prompt.) You will find the Terminal app in the Applications/Utilities/ folder. When you launch it, a Terminal window will appear, like the one in Figure A-1:

Figure A-1. Terminal window

The prompt shows the name of the computer, a colon (:), the current directory (the folder), a space, the current user, a dollar sign ($), a space, and then the prompt symbol (□).

There are several hundred commands that you can run from the Terminal window. To see a list of them all, hold the Esc key down for a second and then press Y, to answer yes to the question. Each time the listing pauses, press the space bar to see the next screen of commands. Press Q to terminate the listing.

Press Ctrl+C to abort the execution of any Terminal command. Use the up and down arrow keys to scroll through the saved list of previously executed commands (to avoid re-typing them).

Try the cal command (Figure A-2):

Figure A-2. The calendar command

It simply displays the calendar for the current month.

Most Terminal window commands are Unix commands. To view the Unix manual description (the man page) of a command, type man followed by the command. For example, to see the man page for the calendar command, enter man cal.

Whenever a response is too large to fit in the window, use the space bar or the Q key to either continue to the next screen of output or to quit that output.

The prompt string is saved in a system variable name PS1. You can change it to just about anything you want by a simple assignment statement. Here we changed it, first to "Now what?" (just for fun), and then to "\w $". The code \w means to specify the current working directory, representing the user's home directory with the tilde character (~). The current working directory in Figure A-3 is the user's home directory.

Figure A-3. Changing the Command Prompt string

The part of the computer's operating system that responds to user commands this way is called the shell and a series of interactive commands and responses like these is called a shell session.

The shell session shown in Figure A-4 illustrates the cd and ls commands. The cd command changes the current directory to the one specified in the command. So, cd hub changed the current directory from ~ (my home directory) to ~/hub, which is a subdirectory of my home directory.

Figure A-4. Listing contents and changing directories

The ls command lists the contents of the current directory. So, when I executed the ls command the first time here, it listed the 11 subdirectories that I have in my ~/hub directory. These included app, books, data, and so on.

To go back up your directory tree, use the cd .. command, or cd ../.. to go back up two levels at once. The double dot means the parent directory.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at ₹800/month. Cancel anytime
Banner background image