Search Results

Search: Posts Made By: dssyadav
2,371
Posted By Yoda
@juzz4fun, if you are using a for loop, then...
@juzz4fun, if you are using a for loop, then there is no need to use ls command inside.

That useless of ls (http://partmaps.org/era/unix/award.html#ls) command. You can simply use the variable: i...
2,371
Posted By juzz4fun
If you want to rename the files as well, we can...
If you want to rename the files as well, we can incorporate Yoda's logic into a script..


#!/bin/bash
for i in *.txt
do a=`ls $i | awk -F"_" 'length($(NF-1))!=8{$(NF-1)="20"$(NF-1)}{print}'...
10,248
Posted By methyl
@PikK45 Psychic post. You must know the O/P's...
@PikK45
Psychic post. You must know the O/P's directory structure.
10,248
Posted By PikK45
A small correction to the end would help. ...
A small correction to the end would help.


find /dir/subdir -type f -name 'abc_*' -size +0 -exec mv {} target_dir \;
1,325
Posted By elixir_sinari
read repl < file2.txt; sed...
read repl < file2.txt; sed 's/idle\.txt/mike_'"$repl"'/g' file1.txt
3,134
Posted By Irishboy24
Hey mate, try it this way. Add all the pattern in...
Hey mate, try it this way. Add all the pattern in a file called pattern.


$ cat pattern
A756
B234
C987



#!/usr/bin/bash

# script will check for the file pattern in "File" and if...
3,134
Posted By Athix
If u know the position of the char then cut will...
If u know the position of the char then cut will do. But still not clear whether you would be looking at the 3 patterns or more.


mv File.txt File_`egrep 'A756$|B234$|C987$' File.txt | cut -c...
Showing results 1 to 7 of 7

 
All times are GMT -4. The time now is 03:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy