-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsummit2020_demo_002.txt
More file actions
131 lines (79 loc) · 3.47 KB
/
summit2020_demo_002.txt
File metadata and controls
131 lines (79 loc) · 3.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#######################################################################################
# PASS Virtual Summit 2020 - SQL Server on Linux from A to Z (Randolph West) #
# Pre-conference session (2020-11-10) #
#######################################################################################
# The scripts in this document are procured from several sources, including Microsoft #
# Docs, Wikipedia, genuinecoder.com, linuxhint.com, howtogeek.com, linux.org, #
# ss64.com, and tecmint.com. #
# No copyright is claimed or intended from these code samples #
#######################################################################################
#######################################################################################
### Part 1: Editing files with vi
#######################################################################################
vi newfile.txt
### Use the i key to insert, the <Esc> key to get out of insert mode, and :q to quit.
### If you make changes, use :w to write them, or :wq to write and quit
#######################################################################################
### Part 2: Common Linux commands
#######################################################################################
cd ~/test
ls -la
### Notice the permissions to the left of each entry
### You can use chmod and chown to change these values, but take care
# Default permissions are 644 for files, and 755 for directories
# Clear the screen:
clear
# Run a command as the super user:
sudo apt-get update
# Open the built-in user manual:
man ls
# See a snapshot of what's happening on the box:
ps
ps -aux
ps -aux | grep usr # show all but only match "usr"
# Look at what's running on the box in near real-time:
top
# Look at a groovier top:
htop
# Query the network interfaces:
ifconfig
ifconfig <pick an interface, e.g. eth0>
# Bonus: show network utilization with bandwidth monitor:
bmon
# See the date and time
date
# Disk usage:
cd ~
du -c
# Disk free space:
df # shows data in 512-KB blocks
df -h # shows data in human-readable sizes
# Show free memory:
free
# See the commands you've typed:
history
# Shuts down the computer (be very careful with this command):
sudo shutdown -r now # restarts the computer immediately
#######################################################################################
### Part 3: Download or view files online
#######################################################################################
# curl - displays the contents of a URL (uniform resource locator) by default:
curl https://pass.org
# wget - gets the contents of a URL and stores them by default:
wget https://pass.org
### Each of these tools can do the same thing with different switches
### which you will see during the SQL Server installation demo
#######################################################################################
### Part 7: Other cool tools (if there's time)
#######################################################################################
file <filename>
#######################################################################################
### Part 7: Other cool tools (if there's time)
#######################################################################################
tree
htop
bmon
top # (with t)
ps -eu | grep VirtualBox
## cd (and don't forget cd -)
## kill a process