Hello experts,
I am exploring parameter expansion, and trying to cut the fields in a URL.
Following is the requirement:
I have
// abc.nnt /dir1/dir2/dir3/dir4/somefile.java
What i need to get is the path after dir3, and dir3 will be passed.
output that i need is dir4/somefile.java.
I am trying to use like
path="https://abc.com/dir1/dir2/dir3/dir4/somefile.java"
sho
Hi All,
Please help.
I have got a file which contains a listing of a file and some directories after it, one by one. I am calling this file xyz.txt here
Code:
file1
dir1
dir2
dir3
dir4
file2
dir5
dir6
dir7
dir8
file3
dir9
dir10
dir11
dir12
Requirement is that I have to pick the files one by one from xyz.txt file i.e. file1 then file2 then file3 ...
I am trying to list all the files from dir1, dir2, dir3 and dir4 which might be anywhere in as a sub directory of my cwd using the find command. I tried the following with no success:
find . -type f -regextype posix-egrep -regex 'dir1/.+|dir2/.+|dir3/.+|dir4/.+'
I tried posix-extended as well. How can I list these files?
I have 2 directories
DIR1 contains file1, file2
DIR2 contains file1, file3
Is there a way to replicate DIR1 to DIR2.
means,
if i give,
cp -r DIR1/* DIR2
file1 in DIR2 gets replaced with file1 in DIR1.
file2 in gets copied to DIR2.
file3 remains untouched.
But, i need DIR2 to be the exact replica of DIR1.
hi ,
please help me in this context
pkg1_name="/dir1/dir2/dir3/pkg1.txt"
pkg2_name="/dir1/dir2/dir4/pkg2.txt"
.
.
.
input to the script is pkg1 or pkg2 or ...
i have used pkg variable to save input i.e.
pkg=$1
now i need the following
result=`awk something ${pkg}_name ` for each file
but the output is showing error as
pkg1_name : no such file or d
I have many files that i want to move into folders, their names are something like this dir1/dir2/dir3/name_of_file.ex and then maybe another is called /dir4/name_of_file2.xe
Is there anyway of moving those files into the directory dir1/dir2/dir3 and change the name of it to only name_of_file.ex automatically?
I really don't know how i can explain it easier..
use rsync to cp such files and dirs under /var/www/html/mydir directory
but these two files (/dir4/1.html /dir4/2.html) cant rsync to dest mechine.I still dont know why,,give me a hint?thx
rsync configure file,below...
[rsy_file_and_dir]
comment= rsync some files and some dir
path=/var/www/html/mydir
read only= no
Single command to ls all the files inside a particular directory hierachy and output this to a file and open this in a vim file so that i can use gf command in vim to browse through all the files inside this hierachy.
eg :
dir1/dir2
and
dir1/dir3
dir2 and dir3 contain the files i need to browse...
Please help...if this is not as optimal solution ,please mention alternate solutions
Using Sol 10 + KSH.
I need to run a find command on the whole system "/" and exclude a bunch of explicit directories and files that may or may not be on each system.
I cannot use the -name because i dont want to exclude all dirs named just specific paths.
-path/-wholename is not an option on the Solaris FIND utility
What i have is working, but I just wanted to throw this out t