Suppose I have a directory structure as follows
test
test/a
test/b
Now I want to execute a command, such that in the . folder I can execute a command on the basename of the files a and b.
So basically, I want something like this, which I naively tried
find test -type f -exec touch `basename {}` \;
Only, this does not result in empty files a and b in the parent directory.
Hi,
I have a directory with a bunch of files say around 150K.
I want the directory's path and the filenames printed to a text file.
Example:
If I am in the directory /path/test and the files in this directory are
Quote:
1.txt
2.txt
3.txt
My output file should be like this
Quote:
/path/test/1.txt
/path/test/
I have the following bash script:
tar -zxvf $1
cd $1
It should extract the archive file and enter the directory that was created. Typically, package archive file creates directory with the same name, as the file, without extension, for example, mpc-1.0.1.tar.gz creates mpc-1.0.1 directory. How can I change the line cd $1 to get directory name?
I'm new to Ubuntu. I installed it because i'm using it in my operating systems class in college. One thing needed to do is copy.
So I rescued files off of a computer, put it in an encrypted zip archive. The zip archive is 32 gb's.
Hi I need a script with an if statement that goes.
I need it to search through all files within a directory with the extension .test if it finds the string '71502FSC1206' then do
Code:
sed 's/71502FSC1206/\n&/g' > send.test
If it finds the string '715MCH' or '715JAC' then I need it to move the file to another directory.
Thanks in advance
First I write a configfile with all my parameters like this
path="/home/test/"
I name it test.conf.
Then I write a shell script with this content, name it test, and make it executable with chmod +x.
#!/bin/bash
#read the config file
.
I have a bunch of hidden files in a directory in AIX. I would like to move these hidden files as regular files to another directory.
Say i have the following files in directory /x
.test~1234~567
.report~5678~123
.find~9876~576
i would like to move them to directory /y as
test~1234~567
report~5678~123
find~9876~576
Can you please let me know the best way to do this ?
Hi all,
I need a shell script to write into a .txt file the no of files in a directory with extension and separated by comma in between.