|
|
| (62 intermediate revisions by the same user not shown) |
| Line 1: |
Line 1: |
| https://www.diskpart.com/articles/delete-hidden-partition-on-usb-drive-7201.html
| | = Overview = |
|
| |
|
| = File System =
| |
| {| class="wikitable" | | {| class="wikitable" |
| ! 情境 || 指令 | | ! style="width:200px;" | 🌐 Networking |
| | ! style="width:200px;" | 💻 OS |
| | ! style="width:200px;" | 🛠️ Hardware |
| |- | | |- |
| | (查) 變彩色,加上後綴,目錄以 / 結尾,連結以 @ 結尾 | | | valign="top" | |
| | <source lang="bash">ls -FG</source> | | * [[Useful Commands/Networking|Networking]] |
| | * [[Useful Commands/Security|Security]]: ssh, socat |
| | | valign="top" | |
| | * [[Useful Commands/Service Management|Service Management]] |
| | * [[Useful Commands/System Management|System Management]] |
| | * [[Useful Commands/System Status|System Status]] |
| | * [[Useful Commands/Windows only|Windows only]] |
| | * [[Useful Commands/MacOS only|MacOS only]] |
| | | valign="top" | |
| | * [[Useful Commands/Hardware|Hardware]] |
| |- | | |- |
| | (查) 在目前的目錄下搜尋所有隱藏檔,'''注意要有單引號'''
| | ! 📦 Packages |
| | <source lang="bash">find . -name '.*'</source>
| | ! 📁 File System |
| | ! 📊 Data |
| |- | | |- |
| | delete dist directory recursively except README.md and itself. | | | valign="top" | |
| | <source lang="bash">find dist -not -path dist -not -path dist/README.md -delete</source>
| | * [[Useful Commands/Package Management|Package Management]] |
| |- | | * [[Useful Commands/Package Compilation|Package Compilation]] |
| | 刪除檔名 - 或是 -- 開頭的檔案 | | | | valign="top" | |
| | <source lang="bash">rm -- -X --exclude-from</source>
| | * [[Git]] |
| |-
| | * [[Useful Commands/File Processing|File Processing]] |
| | 變更檔案時間為<br/>2013 年 9 月 1 號 00:00:00 | | * [[Useful Commands/Compression|Compression]] |
| | <source lang="bash">touch -t 201309010000 檔案名稱</source> | | * [[Useful Commands/Remote File Access|Remote File Access]] |
| |- | | * [[Useful Commands/Low Level IO|Low Level IO]] |
| | Linux 環境產生 Ramdisk (無法指定大小)
| | | valign="top" | |
| | <source lang="bash">mount -t ramfs ramfs /usr/local/ramdisk</source>
| | * [[Useful Commands/Text Processing|Text Processing]] |
| |- | | * [[Useful Commands/Date & Time|Date & Time]] |
| | Linux/BSD 環境產生 Ramdisk (配置 128M) | | * [[Useful Commands/Arithmetic|Arithmetic]] |
| | <source lang="bash">mount -t tmpfs -o size=128m tmpfs /usr/local/ramdisk</source>
| |
| |- | |
| | 產生 100K 的檔案 | |
| | <source lang="bash">dd if=/dev/zero of=100k.bin bs=1k count=100</source> | |
| |- | |
| | 產生 10M 的檔案<br/>空間將會塞爆時,不會有警告訊息 | |
| | <source lang="bash">dd if=/dev/zero of=10m.bin bs=1m count=10</source>
| |
| |- | |
| | 故意消耗系統記憶體 (RAM+SWAP) | |
| | <source lang="bash">
| |
| mkdir /usr/local/ramdisk
| |
| mount -t tmpfs -o size=2G tmpfs /usr/local/ramdisk
| |
| dd if=/dev/zero of=/usr/local/ramdisk/fill.bin bs=1m count=2048
| |
| </source>
| |
| |} | | |} |
|
| |
|
| = Remote File System = | | = Trouble shooting = |
| {| class="wikitable"
| |
| ! Tool || Example
| |
| |-
| |
| | Samba (Linux) ||
| |
| <source lang="bash">
| |
| sudo mount -t smbfs {remote} {local} -o \
| |
| iocharset=utf8, \
| |
| user={user}%{password}, \
| |
| uid=`id -u {local user}`, \
| |
| gid=`id -u {local group}`
| |
| </source>
| |
| |-
| |
| | Samba (MacOS) ||
| |
| <source lang="bash">
| |
| mount_smbfs //'{group};{user}':{password}@{remote}/{shared dir} {local dir}
| |
| smbutil view //Guest@192.168.91.65
| |
| smbutil view //'WORKGROUP;Administrator':12345@192.168.1.2 # for Windows 2K3
| |
| </source>
| |
| |-
| |
| | Samba (FreeBSD) ||
| |
| <source lang="bash">
| |
| mount -t smbfs -o '-N' //raymondwu@RaymondWu-PC/TikaSamples /var/tika/samples # Using ~/.nsmbrc
| |
| mount_smbfs -I 192.168.91.65 //raymondwu@RaymondWu-PC/TikaSamples /var/tika/samples
| |
| smbutil view -I 192.168.91.65 //raymondwu@RaymondWu-PC
| |
| </source>
| |
| |}
| |
|
| |
|
| = Compression =
| |
| {| class="wikitable" | | {| class="wikitable" |
| ! Tool || Example | | ! 🎯 Purpose || ⌨️ Command |
| |-
| |
| | zip ||
| |
| <source lang="bash">
| |
| zip -r front-end.zip index.html static/
| |
| unzip -l front-end.zip
| |
| unzip -p front-end.zip index.html
| |
| </source>
| |
| |- | | |- |
| | tar || | | | Verify $PATH by line. || |
| <source lang="bash"> | | <syntaxhighlight lang="bash"> |
| tar --exclude=".*" -zcvf ~/solr-4.3.0.tgz solr-4.3.0
| | echo $PATH | tr ':' '\n' |
| tar -C /usr/local --exclude '.*' -zcvf tika-1.4-pxx.tgz tika
| | echo $PATH | tr ':' '\n' | grep 'snap' |
| </source>
| | </syntaxhighlight> |
| |- | |
| | gzip || | |
| <source lang="bash">
| |
| gzip -k taiwan-taco.map
| |
| gzip -l taiwan-taco.map.gz
| |
| compressed uncompressed ratio uncompressed_name
| |
| 25400590 38204880 33.5% taiwan-taco.map
| |
| </source>
| |
| |-
| |
| | xz ||
| |
| <source lang="bash">
| |
| xz -zk hd-20190227.csv
| |
| xz -vt hd-20190227.csv.xz
| |
| hd-20190227.csv.xz (1/1)
| |
| 100 % 344.1 KiB / 1,458.1 KiB = 0.236
| |
| </source>
| |
| |-
| |
| | dd ||
| |
| <source lang="bash">
| |
| # Make an ISO image.
| |
| df -h
| |
| umount /dev/disk2
| |
| dd if=/dev/disk2 of=Win7.iso bs=2048 count=1000
| |
| file Win7.iso
| |
| Win7.iso: ISO 9660 CD-ROM filesystem data 'GRMCULFRER_TW_DVD ' (bootable)
| |
| kill -USR1 {pid of dd}
| |
| </source> | |
| |} | | |} |
|
| |
| = Other Topics =
| |
| * [[Useful Commands/Hardware|Hardware]]
| |
| * [[Useful Commands/File Processing|File Processing]]
| |
| * [[Useful Commands/Text Processing|Text Processing]]
| |
| * [[Useful Commands/Networking|Networking]]
| |
| * [[Useful Commands/Date & Time|Date & Time]]
| |
| * [[Useful Commands/Service Management|Service Management]]
| |
| * [[Useful Commands/Package Management|Package Management]]
| |
| * [[Useful Commands/Package Compilation|Package Compilation]]
| |
| * [[Useful Commands/System Management|System Management]]
| |
| * [[Useful Commands/System Status|System Status]]
| |
| * [[Useful Commands/Arithmetic|Arithemetic]]
| |
| * [[Useful Commands/Security|Security]]: ssh, socat
| |
| * [[Useful Commands/MacOS only|MacOS only]]
| |
| * [[Useful Commands/Windows only|Windows only]]
| |