LINE 分享螢幕畫面(電腦螢幕畫面與手機螢幕畫面)

本篇記錄 LINE 分享螢幕畫面的方法,要確定 LINE 的版本是 5.23.0 以上,才有分享螢幕畫面的功能,Windows LINE 5.23.0 大約是 2020.3.16 上線,macOS LINE 5.23.0 大約是 2020.3.18 上線。

LINE 分享電腦螢幕畫面

以下為網路上找的不錯文章,

疫情應援,LINE電腦版5.23.0「分享螢幕畫面」功能全新升級!
https://www.nova.com.tw/article/ef/content/615ac9d381911

疫情應援,LINE電腦版5.23.0「分享螢幕畫面」功能全新升級!
https://official-blog-tw.line.me/archives/82467713.html

LINE共享螢幕功能教學-用LINE就能和多人即時分享電腦螢幕畫面,手機、電腦都能看。
https://www.pkstep.com/archives/57538
教學是 windows 介面,分享時如果有雙螢幕的話,會讓你選擇要分享哪一個螢幕,

LINE 分享螢幕教學大公開【適用手機、電腦版 LINE】
https://tw.imyfone.com/line/line-screen-sharing/
教學是 windows 介面,這版的畫面比較接近目前的版本

【科技新知】如何用LINE即時分享自己的「螢幕畫面」給好友?電腦/手機版都適用
https://www.jyes.com.tw/news.php?act=view&id=815
教學是 windows 介面,

LINE 分享手機螢幕畫面

LINE 分享螢幕教學大公開【適用手機、電腦版 LINE】
https://tw.imyfone.com/line/line-screen-sharing/

【科技新知】如何用LINE即時分享自己的「螢幕畫面」給好友?電腦/手機版都適用
https://www.jyes.com.tw/news.php?act=view&id=815

其它相關文章推薦
Windows 10 螢幕錄影
Ubuntu 桌面錄影軟體

Windows 10 螢幕錄影

本篇 ShengYu 介紹 Windows 10 螢幕錄影的用法與快捷鍵,以及錄完後的檔案儲存路徑在哪。

按下 Windows鍵 + G 快捷鍵就能叫出 Windows 錄影的選單,
Windows鍵 + ALT + R 進行錄影功能,再按一次則結束錄影,
Windows鍵 + Alt + Print Screen 進行螢幕截圖,

要找遊戲短片和螢幕擷取畫面的儲存路徑的話,請選取 開始 > 設定 > 遊戲 > 擷取 然後選取 開啟資料夾

以上就是 Windows 10 螢幕錄影的介紹,
如果你覺得我的文章寫得不錯、對你有幫助的話記得 Facebook 按讚支持一下!

其它參考
Windows 螢幕錄影教學:Win10 內建錄影軟體
https://tw.imyfone.com/pc-tips/screen-record-windows/
內建 Windows 10 螢幕錄影功能:用遊戲列錄製軟體教學影片
https://www.playpcesor.com/2017/09/windows-10-record-screen.html
Windows 中我的遊戲短片和螢幕擷取畫面儲存在何處?

其它相關文章推薦
Ubuntu 桌面錄影軟體
LINE 分享螢幕畫面(電腦螢幕畫面與手機螢幕畫面)

Shell Script rename prefix 重新命名加上前綴字

本篇 ShengYu 介紹 Shell Script 重新命名加上前綴字的方法。

以下示範 Shell Script 將 *.jpg 檔案重新命名都加上 NEW_ 前綴字,

1
2
3
4
for filename in *.jpg
do
mv "$filename" "NEW_${filename}"
done

寫成一行的話就變成這樣,

1
$ for filename in *.jpg; do mv "$filename" "NEW_${filename}"; done;

結果會是這樣,

1
2
xxx.jpg # 修改前
NEW_xxx.jpg # 修改後

也可以用 rename 這個指令,也有一樣的效果,

1
$ rename 's/(.*)$/NEW_$1/' *.jpg

以上就是 Shell Script rename prefix 重新命名加上前綴字介紹,
如果你覺得我的文章寫得不錯、對你有幫助的話記得 Facebook 按讚支持一下!

其它參考
How to rename with prefix/suffix?
https://stackoverflow.com/questions/208181/how-to-rename-with-prefix-suffix

其它相關文章推薦
如果你想學習 Shell Script 相關技術,可以參考看看下面的文章,
Linux rename 用法與範例
Shell Script 新手入門教學
Shell Script 四則運算,變數相加、相減、相乘、相除
Shell Script if 條件判斷
Shell Script for 迴圈
Shell Script while 迴圈
Shell Script 讀檔,讀取 txt 文字檔

Linux rename 用法與範例

本篇 ShengYu 介紹 Linux rename 的用法與範例,rename 是實用的重新命名工具,可以搭配正規表達式來使用,比起手動重新命名實在方便很多,尤其是要大量重新命名時特別有幫助,可以省下許多時間。

基本上 rename 跟 mv 跟差不多一樣功能的指令,但有些功能無法相通,所以在 macOS 下就沒有 rename 指令,就用 mv 取代即可。

rename 重新命名

將 xxx.jpg 加上 NEW_ 前綴字,使用的 rename 的指令如下,

1
2
$ rename 's/(.*)$/NEW_$1/' xxx.jpg
=> NEW_xxx.jpg

一次改大量的 jpg 副檔名的話

1
$ rename 's/(.*)$/NEW_$1/' *.jpg

另外用 shell script 也可以達成

1
$ for filename in *.jpg; do mv "$filename" "NEW_${filename}"; done;

也可以使用擴展正規表達式這樣寫

1
2
#$ mv {,NEW_}xxx.jpg
$ for filename in *.jpg; do mv {,NEW_}"$filename"; done;

把 JPEG 副檔名改成 jpg 副檔名

1
$ rename .JPEG .jpg *.JPEG

用 shell script 也可以達成

1
$ for filename in *.JPEG; do mv -i "$filename" "${filename%%.*}.jpg"; done

rename 實際案例

原先我的照片是 IMG_*.jpg 開頭,影片是 VID_*.mp4 開頭,但是這樣同時間的照片跟影片會分開檢視,這樣在編輯與分類時特別不方便,比較好的方式應該是照片跟影片一律改成 XXX_ 開頭,例如以我的 pixel 手機為例,就一律重新命名成 PXL_ 開頭,要區分照片跟影片的話用副檔名區分就可以了,

例如,我要將 IMG_ 前綴字換成 PXL_ 前綴字,

1
2
IMG_20210522_170609.jpg # 修改前
PXL_20210522_170609.jpg # 修改後

那麼就這樣使用

1
$ rename 's/IMG_(.*)$/PXL_$1/' IMG_20210522_170609.jpg

jpg 照片的話就這樣下,

1
$ rename 's/IMG_(.*)$/PXL_$1/' *.jpg

改用 shell script 就這樣寫,

1
2
3
4
for filename in $(\ls -d *.jpg)
do
mv $filename $(echo $filename | sed -e 's/IMG_/PXL_/')
done

mp4 影片的話就這樣下,

1
$ rename 's/VID_(.*)$/PXL_$1/' *.mp4

改用 shell script 就這樣寫,

1
2
3
4
for filename in $(\ls -d *.mp4)
do
mv $filename $(echo $filename | sed -e 's/VID_/PXL_/')
done

以上就是 Linux rename 用法與範例的介紹,
如果你覺得我的文章寫得不錯、對你有幫助的話記得 Facebook 按讚支持一下!

其它參考
How to rename with prefix/suffix?
https://stackoverflow.com/questions/208181/how-to-rename-with-prefix-suffix
file management - Is there a linux command like mv but with regex? - Super User
https://superuser.com/questions/70217/is-there-a-linux-command-like-mv-but-with-regex

其它相關文章推薦
Shell Script rename prefix 重新命名加上前綴字
Linux 常用指令教學懶人包
Linux cut 字串處理用法與範例
Linux sed 字串取代用法與範例
Linux grep/ack/ag 搜尋字串用法與範例
Linux du 查詢硬碟剩餘空間/資料夾容量用法與範例
Linux wget 下載檔案用法與範例

macOS 安裝 Node.js 的方法

本篇記錄一下 macOS 用 brew 安裝 Nodejs 的方法。

macOS brew 安裝 nodejs

macOS 用 brew 安裝 nodejs 的方法如下,撰寫本文當下最新是 node v18,

1
brew install node

舊版 macOS brew 安裝 nodejs

我的舊 macOS 環境為 macOS 10.13.4 以及 Xcode Version 9.1,
安裝最新的 node (v18)時會先安裝相依性套件 z3,而出現編譯錯誤,顯示需要支援 c++17 的編譯器,
只好用 brew 安裝指定舊版的 Nodejs,目前可以安裝 Node v12 / Node v14,經測試過都可以順利安裝成功,Node v16 會遇到無法辨識的編譯選項 -stdlib=libc++

1
2
3
4
brew install node@12
brew unlink node
brew link node@12 # 失敗的話換 brew link --overwrite node@12
node -v

安裝完後 node v12 的執行檔路徑在 /usr/local/Cellar/node@12/12.22.12_1/bin/nodebrew link node@12 後是將 /usr/local/bin/node 指向 /usr/local/Cellar/node@12/12.22.12_1/bin/node

如果要移除 Node v12 的話就不能用 brew uninstall node,要用

1
brew uninstall node@12

另外可以看看 https://formulae.brew.sh/formula/node 的舊版相容資訊。

以上就是 macOS 安裝 Node.js 的方法介紹,
如果你覺得我的文章寫得不錯、對你有幫助的話記得 Facebook 按讚支持一下!

其他參考
javascript - How to brew install specific version of Node? - Stack Overflow
https://stackoverflow.com/questions/44803721/how-to-brew-install-specific-version-of-node

Python SimpleHTTPServerWithUpload 上傳檔案功能

本篇 ShengYu 介紹 SimpleHTTPServerWithUpload 上傳檔案功能,之前在這篇介紹怎麼使用 Python SimpleHTTPServer 快速建立簡單網頁伺服器 http web sever,這篇是網頁伺服器加上檔案上傳的功能。

https://gist.github.com/UniIsland/3346170
但是這個版本在上傳中文檔案時結果頁面會顯示亂碼,但資料夾中上傳的中文檔案名稱是正常。原因是因為它網頁編碼問題,所以我改了一版加上 utf-8 在結果頁面就可以正常顯示中文,並加上一些空白檔案名稱的錯誤處理,以及上傳時如果檔名是空的話會顯示提示視窗。
缺點是不支援多檔上傳,這樣就不方便,有點可惜。
以下是我修改的版本,

python-SimpleHTTPServerWithUpload.py
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
#!/usr/bin/env python

"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
"""


__version__ = "0.3"
__all__ = ["SimpleHTTPRequestHandler"]
__author__ = "ShengYu"
__home_page__ = "https://shengyu7697.github.io/"

import os
import posixpath
import BaseHTTPServer
import urllib
import cgi
import shutil
import mimetypes
import re
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO


class SimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):

"""Simple HTTP request handler with GET/HEAD/POST commands.
This serves files from the current directory and any of its
subdirectories. The MIME type for files is determined by
calling the .guess_type() method. And can reveive file uploaded
by client.
The GET/HEAD/POST requests are identical except that the HEAD
request omits the actual contents of the file.
"""

server_version = "SimpleHTTPWithUpload/" + __version__

def do_GET(self):
"""Serve a GET request."""
f = self.send_head()
if f:
self.copyfile(f, self.wfile)
f.close()

def do_HEAD(self):
"""Serve a HEAD request."""
f = self.send_head()
if f:
f.close()

def do_POST(self):
"""Serve a POST request."""
r, info = self.deal_post_data()
print(str(r) + ' ' + info + ' by: %s' % (self.client_address,))
f = StringIO()
f.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n')
f.write('<html lang="en">\n')
f.write('<head>\n')
f.write('<meta charset="utf-8">\n')
f.write('</head>\n')
f.write('<title>Upload Result Page</title>\n')
f.write('<body>\n')
f.write('<h2>Upload Result Page</h2>\n')
f.write('<hr>\n')
if r:
f.write('<strong>Success:</strong> ')
else:
f.write('<strong>Failed:</strong> ')
f.write(info)
f.write('<br><a href="%s">back</a>' % self.headers['referer'])
f.write('<hr><small>Powerd By: ShengYu, check new version at ')
f.write('<a href="https://shengyu7697.github.io/SimpleHTTPServerWithUpload">')
f.write('here</a>.</small></body>\n</html>\n')
length = f.tell()
f.seek(0)
self.send_response(200)
self.send_header('Content-type', 'text/html')
self.send_header('Content-Length', str(length))
self.end_headers()
if f:
self.copyfile(f, self.wfile)
f.close()

def deal_post_data(self):
boundary = self.headers.plisttext.split('=')[1]
remainbytes = int(self.headers['content-length'])
line = self.rfile.readline()
remainbytes -= len(line)
if not boundary in line:
return (False, 'Content NOT begin with boundary')
line = self.rfile.readline()
remainbytes -= len(line)
fn = re.findall(r'Content-Disposition.*name="file"; filename="(.*)"', line)
if not fn:
return (False, 'Can\'t find out file name...')
path = self.translate_path(self.path)
fn = os.path.join(path, fn[0])
line = self.rfile.readline()
remainbytes -= len(line)
line = self.rfile.readline()
remainbytes -= len(line)
try:
out = open(fn, 'wb')
except IOError:
return (False, 'Can\'t create file to write, do you have permission to write?')

preline = self.rfile.readline()
remainbytes -= len(preline)
while remainbytes > 0:
line = self.rfile.readline()
remainbytes -= len(line)
if boundary in line:
preline = preline[0:-1]
if preline.endswith('\r'):
preline = preline[0:-1]
out.write(preline)
out.close()
return (True, 'File "%s" upload success!' % fn)
else:
out.write(preline)
preline = line
return (False, 'Unexpect Ends of data.')

def send_head(self):
"""Common code for GET and HEAD commands.
This sends the response code and MIME headers.
Return value is either a file object (which has to be copied
to the outputfile by the caller unless the command was HEAD,
and must be closed by the caller under all circumstances), or
None, in which case the caller has nothing further to do.
"""
path = self.translate_path(self.path)
f = None
if os.path.isdir(path):
if not self.path.endswith('/'):
# redirect browser - doing basically what apache does
self.send_response(301)
self.send_header('Location', self.path + '/')
self.end_headers()
return None
for index in 'index.html', 'index.htm':
index = os.path.join(path, index)
if os.path.exists(index):
path = index
break
else:
return self.list_directory(path)
ctype = self.guess_type(path)
try:
# Always read in binary mode. Opening files in text mode may cause
# newline translations, making the actual size of the content
# transmitted *less* than the content-length!
f = open(path, 'rb')
except IOError:
self.send_error(404, 'File not found')
return None
self.send_response(200)
self.send_header('Content-type', ctype)
fs = os.fstat(f.fileno())
self.send_header('Content-Length', str(fs[6]))
self.send_header('Last-Modified', self.date_time_string(fs.st_mtime))
self.end_headers()
return f

def list_directory(self, path):
"""Helper to produce a directory listing (absent index.html).
Return value is either a file object, or None (indicating an
error). In either case, the headers are sent, making the
interface the same as for send_head().
"""
try:
list = os.listdir(path)
except os.error:
self.send_error(404, 'No permission to list directory')
return None
list.sort(key=lambda a: a.lower())
f = StringIO()
displaypath = cgi.escape(urllib.unquote(self.path))
f.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">')
f.write('<html lang="en">\n')
f.write('<head>\n')
f.write('<meta charset="utf-8">\n')
f.write('</head>\n')
f.write('<title>Directory listing for %s</title>\n' % displaypath)
f.write('<body>\n')
f.write('<h2>Directory listing for %s</h2>\n' % displaypath)
f.write('<hr>\n')
f.write('<form ENCTYPE="multipart/form-data" method="post" name="my_form">\n')
f.write('<input type="file" id="file" name="file"/>\n')
f.write('<input type="button" value="upload" onclick="my_submit()"/>\n')
f.write('</form>\n')
f.write('<hr>\n<ul>\n')
for name in list:
fullname = os.path.join(path, name)
displayname = linkname = name
# Append / for directories or @ for symbolic links
if os.path.isdir(fullname):
displayname = name + "/"
linkname = name + "/"
if os.path.islink(fullname):
displayname = name + "@"
# Note: a link to a directory displays with @ and links with /
f.write('<li><a href="%s">%s</a>\n'
% (urllib.quote(linkname), cgi.escape(displayname)))
f.write('</ul>\n<hr>\n')
f.write('<script>\n'
'function validation() {\n'
' var file = document.getElementById("file").value;\n'
' if (file === "") {\n'
' alert("file is empty!");\n'
' return false;\n'
' }\n'
' return true;\n'
'}\n'
'\n'
'function my_submit() {\n'
' if (validation()) {\n'
' var x = document.getElementsByName("my_form");\n'
' x[0].submit();\n'
' }\n'
'}\n'
'</script>\n')
f.write('</body>\n</html>\n')
length = f.tell()
f.seek(0)
self.send_response(200)
self.send_header('Content-type', 'text/html')
self.send_header('Content-Length', str(length))
self.end_headers()
return f

def translate_path(self, path):
"""Translate a /-separated PATH to the local filename syntax.
Components that mean special things to the local file system
(e.g. drive or directory names) are ignored. (XXX They should
probably be diagnosed.)
"""
# abandon query parameters
path = path.split('?',1)[0]
path = path.split('#',1)[0]
path = posixpath.normpath(urllib.unquote(path))
words = path.split('/')
words = filter(None, words)
path = os.getcwd()
for word in words:
drive, word = os.path.splitdrive(word)
head, word = os.path.split(word)
if word in (os.curdir, os.pardir): continue
path = os.path.join(path, word)
return path

def copyfile(self, source, outputfile):
"""Copy all data between two file objects.
The SOURCE argument is a file object open for reading
(or anything with a read() method) and the DESTINATION
argument is a file object open for writing (or
anything with a write() method).
The only reason for overriding this would be to change
the block size or perhaps to replace newlines by CRLF
-- note however that this the default server uses this
to copy binary data as well.
"""
shutil.copyfileobj(source, outputfile)

def guess_type(self, path):
"""Guess the type of a file.
Argument is a PATH (a filename).
Return value is a string of the form type/subtype,
usable for a MIME Content-type header.
The default implementation looks the file's extension
up in the table self.extensions_map, using application/octet-stream
as a default; however it would be permissible (if
slow) to look inside the data to make a better guess.
"""

base, ext = posixpath.splitext(path)
if ext in self.extensions_map:
return self.extensions_map[ext]
ext = ext.lower()
if ext in self.extensions_map:
return self.extensions_map[ext]
else:
return self.extensions_map['']

if not mimetypes.inited:
mimetypes.init() # try to read system mime.types
extensions_map = mimetypes.types_map.copy()
extensions_map.update({
'': 'application/octet-stream', # Default
'.py': 'text/plain',
'.c': 'text/plain',
'.h': 'text/plain',
})


def test(HandlerClass = SimpleHTTPRequestHandler,
ServerClass = BaseHTTPServer.HTTPServer):
BaseHTTPServer.test(HandlerClass, ServerClass)

if __name__ == '__main__':
test()

加上 utf-8 的方法也很簡單,就是在 head 之前加上 <meta charset="utf-8">,如下所示,

1
2
3
4
5
6
7
8
9
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
</head>
<title>Hello</title>
<body>
</body>
</html>

uploadserver

另外一個版本是使用 uploadserver(pypi 專頁連結),這個版本的優點是一次可以上傳多個檔案,跟支援 curl 指令上傳。

安裝的指令如下,

1
python3 -m pip install --user uploadserver

要使用的話就這樣輸入指令,

1
python3 -m uploadserver

然後要上傳的話要到 http://ip:8000/upload 頁面再選擇檔案上傳。

以上就是 Python SimpleHTTPServerWithUpload 上傳檔案功能的介紹,
如果你覺得我的文章寫得不錯、對你有幫助的話記得 Facebook 按讚支持一下!

其它相關文章推薦
Python 新手入門教學懶人包
Python http web server 快速建立網頁伺服器

adb 查詢 Android SDK 版本號 (adb shell getprop)

本篇介紹如何使用 adb 指令查詢 Android SDK 版本號,想要知道 Android 裝置是使用哪個 Android SDK 版本的話,有很多種方法,這篇要介紹用 adb 指令來達成 Android SDK 版本查詢。

adb 指令查詢 Android SDK 版本號使用方式如下,

1
adb shell getprop ro.build.version.sdk

以上就是 adb 查詢 Android SDK 版本號 (adb shell getprop)的介紹,
如果你覺得我的文章寫得不錯、對你有幫助的話記得 Facebook 按讚支持一下!

其它相關推薦文章
Android adb 基本用法教學
adb 查詢 Android 版本號 (adb shell getprop)
Android adb logcat 基本用法教學
Android adb forward 通訊埠轉發用法教學

adb 查詢 Android 版本號 (adb shell getprop)

本篇介紹如何使用 adb 指令查詢 Android 版本號,想要知道 Android 裝置是使用哪個版本的話,有很多種方法,這篇要介紹用 adb 指令來達成 Android 版本查詢。

adb 指令查詢 Android 版本號使用方式如下,

1
adb shell getprop ro.build.version.release

範例結果如下,結果顯示是 Android 10,也就是開發代號 Android Q,

1
2
$ adb shell getprop ro.build.version.release
10

以上就是 adb 查詢 Android 版本號 (adb shell getprop)的介紹,
如果你覺得我的文章寫得不錯、對你有幫助的話記得 Facebook 按讚支持一下!

其它相關推薦文章
Android adb 基本用法教學
adb 查詢 Android SDK 版本號 (adb shell getprop)
Android adb logcat 基本用法教學
Android adb forward 通訊埠轉發用法教學

Visual Studio Code 關閉存檔自動排版的2種方式

本篇介紹 Visual Studio Code 關閉存檔自動排版 format,關閉 Visual Studio Code 存檔自動排版有兩種方式,

VS Code 關閉存檔自動排版的方法分為這兩種方式,

  • 從 UI 介面關閉存檔自動排版
  • 從 setting.json 設定檔關閉存檔自動排版

從 UI 介面關閉存檔自動排版

Ctrl + , 快捷鍵打開設定 setting,macOS 快捷鍵是 Cmd + ,

選擇 Text Editor > Formatting,將 Format On Save 取消勾選,這樣就不會存檔自動排版了,中文介面的話是選擇 文字編輯器 > 格式化

從 setting.json 設定檔關閉存檔自動排版

從 setting.json 設定檔關閉存檔自動排版的方法就是在 setting.json 加上 "editor.formatOnSave": false 就是存檔時不進行自動排版,可以另外使用 Alt + Shift + F 手動執行自動排版,

setting.json
1
2
3
{
"editor.formatOnSave": false
}

以上就是 Visual Studio Code 關閉存檔自動排版的2種方式介紹,
如果你覺得我的文章寫得不錯、對你有幫助的話記得 Facebook 按讚支持一下!

其他參考
visual studio code - VSCode - Disable ALL Auto Formatting on Save - Stack Overflow
https://stackoverflow.com/questions/61827206/vscode-disable-all-auto-formatting-on-save
https://linuxpip.org/vscode-format-on-save/

Linux tar 用法與範例

本篇 ShengYu 介紹 Linux tar 的用法與範例。

以下 Linux tar 的內容將分為這幾部份,

  • Linux tar 打包
  • Linux tar 打包壓縮

Linux tar 打包

tar 打包(無壓縮),單純打包無壓縮,優點是速度快,相對的容量大小幾乎跟原本的一樣,例如:將 aaa 資料夾打包成 aaa.tar

1
tar cvf aaa.tar aaa/

tar 解壓縮,例如:將 aaa.tar 解壓縮

1
tar xvf aaa.tar

Linux tar 打包壓縮

tar 打包(gz壓縮),單純打包無壓縮,優點是壓縮後檔案較原本的小,相對的壓縮與解壓縮需花費時間,例如:將 aaa 資料夾打包成 aaa.tar.gz

1
tar zcvf aaa.tar.gz aaa/

tar 解壓縮,例如:將 aaa.tar.gz 解壓縮

1
tar xvf aaa.tar.gz

以上就是 Linux tar 用法與範例的介紹,
如果你覺得我的文章寫得不錯、對你有幫助的話記得 Facebook 按讚支持一下!

其它相關文章推薦
Linux 常用指令教學懶人包
Linux cut 字串處理用法與範例
Linux sed 字串取代用法與範例
Linux grep/ack/ag 搜尋字串用法與範例
Linux du 查詢硬碟剩餘空間/資料夾容量用法與範例
Linux wget 下載檔案用法與範例