2. Linux?
• Linux is a Unix-like and mostly POSIX-compliant computer operating system (OS)
assembled under the model of free and open-source software development and distribution.
(Wikipedia)
2
www.xcodepro.com
Initial release: October 5, 1991
Linus Torvalds, principal author of the Linux kernel
Linux can support many users
Linux is a multitasking operating system
3. Linux Kernel
• The Linux kernel is a Unix-like computer operating system kernel. The Linux operating
system is based on it. (Wikipedia)
• You can find the Latest Stable Kernel from the following link.
https://kernel.org
www.xcodepro.com
3
4. Linux Distributions
• 10 of the most popular free and open-source Linux Distributions
• CentOS
• Debian
• Ubuntu
• Arch Linux
• Linux Mint
• Fedora
• openSUSE
• Kubuntu
• Mageia
• Scientific Linux
www.xcodepro.com
4
5. Connect to Machine
• Use Putty to Connect to a Linux Machine on Windows
• Download and Install PuTTY - a free SSH and telnet client
• http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
• Launch the client
• Configure your connection by filling out Host Name (IP address of your machine), Port (22), set
connection type to SSH, and then click Open. If there any warning, click on ‘yes’.
• Enter your user name and password
www.xcodepro.com
5
6. Connect to Machine
• Use Terminal to Connect to a Linux Machine on Mac
• Go to Applications Utilities, and open Terminal.
• To establish an SSH connection, enter the following command at the Terminal Prompt
• ssh username@IPaddress (Ex. ssh root@192.0.2.0)
• ‘Are you sure you want to continue connecting (yes/no)?’Type yes and press Enter key
• Enter the user’s password for your Machine
www.xcodepro.com
6
7. Linux Commands
• Learn some basic Linux commands to make your daily life easier
www.xcodepro.com
7
1. pwd
2. passwd
3. ls
4. chgrp
5. chmod
6. chown
7. ln
8. cp
9. mv
10. rm
11. mkdir
12. rmdir
13. du
14. free
15. man
16. sudo
17. vi
18. cat
19. tail
20. head
21. less
8. Linux Commands
• This guide is created for the Data Scientists who are very new to Linux
www.xcodepro.com
8
22. echo
23. sort
24. find
25. grep
26. top
27. ps
28. kill
29. diff
30. join
31. touch
32. expr
33. test
34. wget
35. tar
36. bunzip2
37. bzip2
38. zip
39. unzip
40. gunzip
41. gzip
42. shutdown
11. 3. ls
• List the names of files
www.xcodepro.com
11
12. 4. chgrp
• Changes the group association of the files and directories
• chgrp [OPTION]... GROUP FILE...
www.xcodepro.com
12
13. 5. chmod
• Changes the access mode or permissions of a file
• chmod [options] mode file-list
www.xcodepro.com
13
u User (Owner)
g Group
o Other
a All
r Sets read permission
w Sets write permission
x Sets execute permission
14. 6. chown
• Change a owner of a file and/or the group the file is associated with
• chown [options] owner:group file-list
www.xcodepro.com
14
15. 7. ln
• Makes a link to a file or directory
www.xcodepro.com
15
23. 15. man
• Displays documentation for utilities
• Man [option] command
www.xcodepro.com
23
24. 16. sudo
• sudo allows a permitted user to execute a command as the superuser or another user, as
specified by the security policy.
www.xcodepro.com
24
26. 18. cat
• Concatenate file(s), or standard input, to standard output.
www.xcodepro.com
26
27. 19. tail
• Print the last 10 lines of each FILE to standard output.
www.xcodepro.com
27
28. 20. head
• Print the first 10 lines of each FILE to standard output.
www.xcodepro.com
28
29. 21. less
• less is a filter for paging which allows backward movement in the file as well as forward.
movement.
• Less /proc/cpuinfo
www.xcodepro.com
29
30. 22. echo
• Echo the STRING(s) to standard output.
www.xcodepro.com
30
41. 33. test
• Check file types and compare values
www.xcodepro.com
41
42. 34. wget
• The non-interactive network downloader.
www.xcodepro.com
42
43. 35. tar
• Saves many files together into a single tape or disk archive, and can restore individual files
from the archive.
• Create archive.tar from files foo and bar
• tar -cf archive.tar foo bar
• List all files in archive.tar verbosely
• tar -tvf archive.tar
• Extract all files from archive.tar
• tar -xf archive.tar
www.xcodepro.com
43
44. 36. bzip2
• bzip2 compresses files using the Burrows-Wheeler block sorting text compression algo‐
rithm, and Huffman coding.
• bzip2 file1 file2 file3
www.xcodepro.com
44
45. 37. bunzip2
• bunzip2 (or bzip2 -d) decompresses all specified files. Files which were not created by
bzip2 will be detected and ignored, and a warning issued.
www.xcodepro.com
45