All tags
files
Narrow down
Shell24
- Tip
zmv -n '(*).log' '$1.txt'zmv -n previews a bulk rename in zsh before it touches a filePreview a pattern-based bulk rename in zsh before running it.3 Dec 2026 - Tip
scp -3 alice@server-a:/var/backups/db.sql.gz bob@server-b:/srv/restore/scp -3 copies between two remote hosts through your own machineCopy a file from one server to another with scp, routed through the machine you type on3 Dec 2026 - Tip
file photo.jpg data.binfile reads the contents to tell you what files really areIdentify a file by its contents, whatever its extension claims.1 Dec 2026 - Tip
trash old-notes.txt build/The trash command in the macOS terminal moves files to the Trash, not into oblivionDeletes from the command line in a way you can still undo from Finder.30 Nov 2026 - Tip
sudo setfacl -R -d -m g:media:rwX /srv/mediaSetfacl -d sets default permissions that every new file in a folder inheritsMakes new files in a shared folder get the right ACL automatically.30 Nov 2026 - Tip
sudo cp -r /srv/site /srv/site.rcp -a keeps owner, group and permissions, plain cp -r does notCopies a folder while keeping its owners, modes, timestamps and links.30 Nov 2026 - Tip
sips -s format jpeg -s formatOptions 80 *.heic --out jpg/sips -s format jpeg converts HEIC photos to JPEG in the terminalTurns iPhone HEIC photos into JPEG files that every website accepts.30 Nov 2026 - Tip
sudo getfacl -R -p srv/data > /root/data-perms.aclGetfacl -R saves the permissions of a whole tree, and setfacl puts them backBacks up owners, modes and ACLs of a folder tree to one text file.30 Nov 2026 - Tip
cp -c ~/VMs/ubuntu.img ~/VMs/ubuntu-before-upgrade.imgcp -c copies a big file instantly on a Mac terminal using APFS clonesMakes a copy of a large file in a moment without using extra disk space.30 Nov 2026 - Tip
mklink /J "C:\Games\SaveData" "D:\Storage\SaveData"mklink /J makes a folder show up in a second placeCreates a directory junction so a folder appears under a second path.28 Nov 2026 - Tip
shred -v -u -z ~/Documents/old-secret.txtshred overwrites a file before deleting it, but the manual has a warningOverwrites a file before deleting it, plus the manual's warning about copies and file systems.28 Nov 2026 - Tip
Select-String -Pattern 'example.com' -List |Select-String -List names the files that contain a wordLists only the files in a folder tree whose text contains a pattern.28 Nov 2026 - Tip
where /r C:\Users\Public *.logwhere /r finds a file by name from the command promptFinds files by name under a folder, or shows which copy of a program is on your PATH.28 Nov 2026 - Tip
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool TRUEDSDontWriteNetworkStores stops Finder from reading .DS_Store files on SMB sharesMakes Finder skip .DS_Store files on SMB shares, which can speed up browsing.28 Nov 2026 - Tip
sudo fs_usage -w -f filesys Mailsudo fs_usage shows which files a Mac app is reading and writingLists the file system calls of one app live, so you see which files it touches.28 Nov 2026 - Tip
mkfile -v 100m /tmp/test-100m.binmkfile makes a test file of an exact size on a MacCreates a file of an exact size, optionally without allocating the disk space.28 Nov 2026 - Tip
dot_clean -m /Volumes/USBSTICKdot_clean -m removes the ._ files a Mac leaves on USB sticks and sharesCleans up the ._ metadata files macOS leaves on USB sticks and shared folders.28 Nov 2026 - Tip
cupsfilter notes.txt > notes.pdfcupsfilter turns a text file into a PDF from the Mac terminalConverts a plain text file to a PDF from the terminal, using the Mac's print system.28 Nov 2026 - Tip
sudo chown alice: report.pdfChown alice: with a trailing colon also sets the user's own groupGives a file to a user and that user's own group in one short command.27 Nov 2026 - Tip
sudo setfacl -m u:alice:rX /srv/dataSetfacl gives one extra user access without changing the groupGives one extra named user access to a folder without touching owner or group.11 Sep 2026 - Tip
stat -c '%a %U:%G %n' /etc/ssh/sshd_configstat -c prints the permissions as numbersPrints a file's permissions as an octal number with owner, group and name.18 Aug 2026 - Tip
sudo chattr +i /srv/app/settings.confChattr +i makes a file immutable, which normal permissions cannot do for rootLocks a file against any change, including by root, until the flag is removed.15 Feb 2026 - Tip
sudo chmod --reference=/etc/ssh/sshd_config /etc/ssh/sshd_config.newChmod --reference copies the permissions of another fileGives one file exactly the mode of another file.9 Feb 2026 - Tip
sudo install -m 640 -o root -g www-data app.env /etc/app/app.envInstall -m sets permissions, owner and group while it copies the fileCopies a file and sets its mode, owner and group in one command.8 Feb 2026
Other tips18
- Tip
printf 'GET /\r\n' | hexdump -CHexdump -C shows a file as hex bytes next to readable textSee the exact bytes of a file, with hex on the left and readable characters on the right.3 Dec 2026 - Tip
sha256sum -c --ignore-missing SHA256SUMSsha256sum -c --ignore-missing checks only the files you actually downloadedVerify only the downloaded files against a big checksum list, without errors for the rest.3 Dec 2026 - Tip
xmlstarlet ed -u '//item[@id="1"]/title' -v 'Changed' feed.xmlxmlstarlet ed -L updates or deletes XML nodes in the file itselfChange or delete one specific XML node in place, picked by XPath.3 Dec 2026 - Tip
f=$(mktemp --suffix=.json)Mktemp --suffix gives a temp file the extension a tool expectsCreate a unique temporary file that ends in a chosen extension3 Dec 2026 - Tip
unzip -j archive.zip -d out/unzip -j extracts files without recreating the foldersUnpack the files of a zip flat into one directory, ignoring its folder structure3 Dec 2026 - Tip
ls -vls -v lists numbered files so that 2 comes before 10Sort names with numbers in them the way a person would count.1 Dec 2026 - Tip
unzip -l site.zipunzip -p prints files inside a zip without unpacking itRead or pipe a single file from a zip archive without extracting everything.1 Dec 2026 - Tip
mv -n card2/*.jpg ~/Pictures/all/mv -n moves files without overwriting any that already existMerge files into a folder while keeping whatever is already there.1 Dec 2026 - Tip
findmnt -no OPTIONS /dev/shmMount /dev/shm with noexec for a little extra security on a serverStops programs from being run directly out of the shared memory folder.30 Nov 2026 - Tip
rm -I *.logrm -I asks once before a big delete instead of for every fileGet one sanity check before a large or recursive delete, without the endless prompts of rm -i.30 Nov 2026 - Tip
ln -sr /srv/site/shared/uploads /srv/site/current/uploadsln -sr makes a relative symlink, so the link keeps working when you move the treeCreate a symlink with a relative path without counting the dots yourself.30 Nov 2026 - Tip
cp -r --update=none /mnt/user/photos/import/* /mnt/user/photos/library/Use cp --update=none instead of cp -n, which changed behaviour twiceCopies or moves files without overwriting existing ones, with an exit status you can predict.27 Nov 2026 - Tip
ln -sf /srv/app/releases/v2 /srv/app/currentln -sfn repoints a symlink to a folder instead of creating a link inside itReplaces a symlink that points to a directory, rather than adding a link inside that directory.27 Nov 2026 - Tip
touch -r notes.orig.md notes.mdtouch -r copies the timestamp of one file onto anotherGives a file the same modification time as another file, or any date you choose.27 Nov 2026 - Tip
chmod -R u=rwX,go=rX /srv/siteUse a capital X in chmod so only directories get executeSets sensible permissions in one pass: execute only on directories and already-executable files.24 Aug 2026 - Tip
ls -l report.odt # -rw-r-----+A plus sign after the permissions in ls -l means an ACL adds more rulesShows how to spot extra access rules that ls -l hides behind a plus sign.11 Feb 2026 - Tip
chmod g=u,o= notes.txtchmod g=u gives the group the same permissions as the ownerCopies the owner's permission bits to the group and clears them for others.10 Feb 2026 - Tip
chmod 711 /tmp/demoDirectory permissions 711 let users enter a folder but not list itExplains the directory execute and read bits, and how 711 allows access without listing.6 Feb 2026
Mac9
- Tip
General: [x] Stationery padStationery pad in Get Info turns any Mac document into a templateOpen a fresh copy of a document every time, so the original stays untouched.30 Nov 2026 - Tip
Import To: pick a folder (or Other... for any location)Image Capture copies iPhone photos into any folder on your MacImport photos and videos from a phone or camera straight into a folder of your choice.30 Nov 2026 - Tip
Select the files > Control-click one > RenameFinder can rename a whole batch of files in one goRenames many selected files at once with replace, add or numbered name formats.28 Nov 2026 - Tip
Open with: pick your editor > Change AllChange All in Get Info sets the default app for a file typeMakes every file of one type open in the app you choose.28 Nov 2026 - Tip
[x] Show all filename extensionsShow every filename extension in FinderMakes Finder show the real extension of every file, like .pdf or .docx.28 Nov 2026 - Tip
drag pages from one sidebar to the other sidebarPreview merges PDFs when you drag pages between sidebarsCombine pages from several PDFs into one file with Preview, no extra software.28 Nov 2026 - Tip
Quartz Filter: Reduce File SizePreview's Reduce File Size filter shrinks a PDF that's too big to sendMake a large PDF smaller with Preview's export filter before you email or upload it.28 Nov 2026 - Tip
Format > Make Plain Text (saves as .txt)Make Plain Text in TextEdit strips all formatting from a documentTurn a rich text document in TextEdit into a plain .txt file without fonts or styles.28 Nov 2026 - Tip
Control-Command-0 turn stacks on or offControl-Command-0 tidies a messy Mac desktop into stacksGroups the files on your Mac desktop into tidy stacks by type, date or tag.28 Nov 2026
Storage5
- Tip
hexdump -C -s 512 -n 64 disk.imghexdump -s and -n look at just a slice of a big fileShow only a chosen slice of a file in hex instead of the entire thing.3 Dec 2026 - Tip
xxhsum -H64 backup.tar > backup.xxhxxhsum is a very fast checksum for spotting changed files, not for securityQuickly detect a changed or damaged file with a very fast, non-cryptographic hash.3 Dec 2026 - Tip
ls -lhS /var/logls -lhS puts the biggest files in a folder at the topSort a directory listing by size, with readable units.1 Dec 2026 - Tip
mkdir -p ~/config-exportcp --parents copies a file and rebuilds its folder path at the destinationCopies files into a target folder while keeping the directory path they came from.27 Nov 2026 - Tip
cp --reflink=always vdisk1.img vdisk1-before-update.imgcp --reflink=always makes an instant copy on Btrfs and XFS, or failsClones a big file in an instant on filesystems that support copy on write.27 Nov 2026
Media4
- Tip
behind the scenes/Finding the right score.mp4A behind the scenes folder next to a movie turns into Jellyfin extrasLists videos in certain subfolders as extras of a movie or series in Jellyfin.28 Nov 2026 - Tip
Movie (2035)/Poster, backdrop and clearlogo file names let you set Jellyfin artwork yourselfOverrides the artwork of a Jellyfin item by naming image files next to the media.28 Nov 2026 - Tip
Film (1986)/Dots in a subtitle file name tell Jellyfin the language, default and forced flagsSets language, default, forced and hearing-impaired flags of an external subtitle through its file name.28 Nov 2026 - Tip
theme.mp3A theme.mp3 next to your show plays as background music in JellyfinPlays a theme song or video in the background when you open a show in Jellyfin.28 Nov 2026
Network3
- Tip
curl -T backup.tar.gz https://example.com/uploads/curl -T uploads a file with a PUT requestUploads a local file to a URL with a PUT request, with the file name added for you.28 Nov 2026 - Tip
cp --backup=numbered nginx.conf /etc/nginx/nginx.confcp --backup=numbered keeps the file you were about to overwriteSaves every overwritten file as a numbered copy, so you can always go back.27 Nov 2026 - Tip
tailscale drive share docs /srv/docstailscale drive share turns a folder into a share your whole tailnet can openShares a folder over your tailnet as WebDAV, with access decided by your Tailscale policy file.27 Nov 2026
Docker2
- Tip
ls -ln /srv/datals -n shows owners as numbers, which explains odd permissions on shares and containersPrints UIDs and GIDs instead of names, so mismatched IDs become visible.30 Nov 2026 - Tip
docker cp mycontainer:/etc/app/config.yml ./config.ymldocker cp works on stopped containers tooCopies files out of or into a container, even a stopped one, without starting it.24 Jul 2026
Web2
- Tip
mv -T --exchange /srv/site/html /srv/site/html-newmv --exchange swaps two files or folders in one atomic stepSwaps the names of two files or directories at once, with nothing in between.27 Nov 2026 - Tip
namei -l /var/www/html/uploads/photo.jpgnamei -l shows the permissions of every folder on the way to a filePrints the owner and mode of each folder in a path to find where access stops.13 Feb 2026
Phone1
Nothing matches.