Skip to content
Advertisement

Tag: unix

How to replace ‘>> $log_file 2>&1’ from all files

In my files commands are like : File1.sh: File2.sh File3.sh I am looking for a command to remove the line where defined variable ‘log_file’ from all the files AND remove only ‘>> $log_file 2>&1’ part from all the files Output in files: File1.sh: echo -e “n Output is n” File2.sh File3.sh I tried multiple ways with sed but nothing worked,

AWK: Comparing substrings from two files and write to third file

I’m trying to compare two different files, let’s say “file1” and “file2”, in this way. If the substring of characters i.e 5 characters at position (8 to 12) matches in both files – file1 and file2, then remove that matching row from file 1. Finally, write the output to file3.(output contains the remaining rows which are not matching with file

search and rename and mv all files from directories and subdirectories

i have a lot of files 30k directories, 21k files inside direrctories and subdirerctories of txt files with the same name i want to search for all files inside a lot of subdirerctories and than rename them to other unique name to move them to other directory. This command not showing the duplicate files Answer i find this helpful https://askubuntu.com/questions/1003554/how-to-rename-all-jpg-files-in-all-subdirs-wich-contains-dash-in-linux

Advertisement