WelcomeUser Guide
ToSPrivacyCanary
DonateBugsLicense

©2025 Poal.co

841

A thread for documenting and sharing useful Linux commands.

A thread for documenting and sharing useful Linux commands.

(post is archived)

[–] 4 pts

This command can be used to scan and fix both Windows and Linux as well as USB file systems.

fsck -c -v -y -f /dev/[DISK_NAME]

"cvyf"

f - Force scan disk.

a/y - Auto fix; y better/more compatible.

v - Verbose/extra text.

c - Check for bad blocks (does not work w. non EXT file systems I think).

(All parameters are case sensitive as Linux generally is)

[–] 2 pts

readlink -f[filename] – Print full path of file name for easy copying to clipboard.

[–] [deleted] 2 pts (edited )

shred -fuz [filename]

Overwrite a file with random data, zeros and then delete it. [filename] can be a disk device. the 'f' forces the issue and changes file permissions to make the target writable if needed.

I do like the "Oh shit! This torrent has every episode in separate rar files!"

x=$(find . -name "*.rar"); for n in $x; do unrar x $n ; done

or

find . -name '*.rar' -exec unrar x {} \;

Run from the series parent folder for best results.

[–] 2 pts

mplayer -af scaletempo – Allows adjusting playback speed without affecting audio pitch.

[–] 2 pts

If you're on debian or derivatives

sudo apt install tree

tree

This is going to display the whole tree view of the directory you're calling the command from, and it's pretty fast shit

[–] 1 pt

echo 1 | sudo tee /proc/sys/kernel/sysrq saves you headaches if you run a live session.

[–] 1 pt

sdparm --page=rw --long /dev/sr3 sdparm --set=RRC=0 /dev/sr3

[–] 1 pt

Keyboard shortcut Ctrl+Alt+# converts current command into a comment

[–] 0 pt

Read beginning of device/image files and generate checksum to quickly match if image and device are identical.

Replace if (input file) parameter with desired input file or device.

  • Flash storage: sudo dd if=/dev/sdo bs=512 count=1000 status=none iflag=direct |md5sum
  • Optical storage: `sudo dd if=/dev/sr5 bs=2048 count=250 status=none iflag=direct

  • For image files (high-level), direct I/O efficiency is not required, and any block size is acceptable. sudo dd if=/media/username/mountpount_name/directory/file.img bs=51200 count=1 status=none |md5sum

[–] 0 pt

Play RAW (PCM) audio CD: mplayer -rawaudio rate=44100:channels=2:samplesize=2 -format s32le -demuxer rawaudio *[filename]*

Guide: http://rylokhande.blogspot.com/2014/12/play-raw-audio-using-mplayer.html?m=1

[–] 0 pt

According to my tests, the UDF file system superblock is usually on sector (logical block address) 96, which means bytes 196608 to 198656. But that may confuse mplayer, so we need to skip it.

To play back DVD recordings using mplayer directly without mounting the file system, one needs to skip that superblock:

  • cdvdcontrol -l # list optical drives
  • lsblk /dev/sr* # alternative, although it does not list models. In this example, the optical drive is /dev/sr1. Can also be image file.
  • mplayer -sb 198656 /dev/sr1 # Start playback at byte 198656, hence at LBA 97.