Useful Commands: Difference between revisions

From Fundamental Ramen
Jump to navigation Jump to search
Line 92: Line 92:
mount -t tmpfs -o size=2G tmpfs /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
dd if=/dev/zero of=/usr/local/ramdisk/fill.bin bs=1m count=2048
</syntaxhighlight>
|}
= Remote File System =
{| class="wikitable"
! Tool || Example
|-
| Samba (Linux) ||
<syntaxhighlight lang="bash">
sudo mount -t smbfs {remote} {local} -o \
  iocharset=utf8, \
  user={user}%{password}, \
  uid=`id -u {local user}`, \
  gid=`id -u {local group}`
</syntaxhighlight>
|-
| Samba (MacOS) ||
<syntaxhighlight 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
</syntaxhighlight>
|-
| Samba (FreeBSD) ||
<syntaxhighlight 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
</syntaxhighlight>
</syntaxhighlight>
|}
|}

Revision as of 01:32, 17 September 2026

https://www.diskpart.com/articles/delete-hidden-partition-on-usb-drive-7201.html

Overview

Services Networking OS Hardware Packages File System Data

Trouble shooting

Purpose Command
Verify $PATH by line.
echo $PATH | tr ':' '\n'
echo $PATH | tr ':' '\n' | grep 'snap'

File System

Purpose Command
list with color and suffix for dir and link
ls -FG
list add hidden files only single quote is necessary
find . -name '.*'
delete dist directory recursively except README.md and itself.
find ../../assets/swagger/support ! -path *swagger/support ! -name 'README.md' -delete
delete files that filename leads by - or --
rm -- -X --exclude-from
Set file mtime
2013-09-01 00:00:00
touch -t 201309010000 FILENAME
create ramdisk for Linux (cannot set size)
mount -t ramfs ramfs /usr/local/ramdisk
create ramdisk for Linux/BSD
mount -t tmpfs -o size=128m tmpfs /usr/local/ramdisk
Test I/O performance of 1G write with 4K block
dd if=/dev/zero of=100k.bin bs=4k count=262144
Create file with 100K size
dd if=/dev/zero of=100k.bin bs=1k count=100
Create file with 1M size
No warning on disk full
dd if=/dev/zero of=10m.bin bs=1m count=10
Simulate memory consumption (RAM+SWAP)
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