Useful Commands/Low Level IO

From Fundamental Ramen
< Useful Commands
Revision as of 01:37, 17 September 2026 by Tacoball (talk | contribs) (Created page with "= File System = {| class="wikitable" ! Purpose || Command |- | list with color and suffix for dir and link | <syntaxhighlight lang="bash">ls -FG</syntaxhighlight> |- | list add hidden files only '''single quote is necessary''' | <syntaxhighlight lang="bash">find . -name '.*'</syntaxhighlight> |- | delete dist directory recursively except README.md and itself. | <syntaxhighlight lang="bash"> find ../../assets/swagger/support ! -path *swagger/support ! -name 'README.md' -d...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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