Sed — replace in file

In-place global string replacement

sed -i 's/old-string/new-string/g' file.txt

tool
linux133 commands
tags
linux

More linux commands

  • sort file.txt | uniq -c | sort -rn | head -20

    Count and rank duplicate lines in a file

  • lsblk -o NAME,SIZE,TYPE,FSTYPE,MOUNTPOINT,UUID

    Tree of disks, partitions, loop devices with filesystem info

  • blkid

    Print UUID, LABEL, and FSTYPE for all block devices

  • mount -t ext4 /dev/sdb1 /mnt/data

    Mount ext4 partition to /mnt/data

  • findmnt --real

    List all real (non-virtual) mounted filesystems in a tree

all 133 linux commands