Replace text in a file with sed
Replace every match of a string directly in the file.
sed -i 's/old-string/new-string/g' file.txt
More linux commands
-
sort file.txt | uniq -c | sort -rn | head -20Count how often each line repeats in a file and show the top 20.
-
lsblk -o NAME,SIZE,TYPE,FSTYPE,MOUNTPOINT,UUIDShow disks, partitions and loop devices as a tree with filesystem type, mount point and UUID.
-
blkidPrint UUID, LABEL and TYPE for every block device.
-
mount -t ext4 /dev/sdb1 /mnt/dataMount an ext4 partition to /mnt/data.
-
findmnt --realShow real (non-virtual) mounted filesystems as a tree.