10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
I am trying to rename files with spaces and other characters and not able to be successful.
FileNames:
UPLOAD REFERENCE.xls
UPLOAD MASS REFERENCE.XLS
find /UPLOAD REFERENCE/ -depth -type f -name "* *" -exec rename " " "_" "{}" ";"
The above one is successful to replace spaces... (1 Reply)
Discussion started by: eskay
1 Replies
2. Shell Programming and Scripting
Hi,
Friends, i have a requirement where i need to rename my files residing in multiple sub directories and move them to one different directory along with some kind of directory indicator.
For eg:
test--is my parent directory and it has many files such as
a1.txt
a2.txt
a3.txt
... (5 Replies)
Discussion started by: gnnsprapa
5 Replies
3. Shell Programming and Scripting
Hi
I have a list a filename in a directory starting with particular pattern
for example:
abc_1234.txt
abc_7565.txt
abc_7676.txt
abc_7765.txt
i need to rename all these files by appending bck. or bck_
Expected output:
bck.abc_1234.txt
bck.abc_7565.txt
bck.abc_7676.txt... (1 Reply)
Discussion started by: Little
1 Replies
4. Shell Programming and Scripting
Hi all,
I have more than 12000 files in 46 different directories and each directory has 2 sub-directories named “dat” or “gridded”. Dat sub-directories have files with extension “jpg.dat” and gridded sub-directories have files with extension “.jpg”.
I need to... (1 Reply)
Discussion started by: AshwaniSharma09
1 Replies
5. Shell Programming and Scripting
I can rename a file with sequential numbers from 1 to N with this script:
num=1
for file in *.dat;do
mv "$file" "$(printf "%u" $num).txt"
let num=num+1
done
The script begins with renaming a some.dat file to 1.dat.txt and goes on sequentially renaming other DAT files to... (1 Reply)
Discussion started by: shoaibjameel123
1 Replies
6. UNIX for Dummies Questions & Answers
Hi,
I have a directory that has a file which contained special characters in the filename. Can someone please advise how to remove the file, preferably with a rm -i ?
Thanks in advance.
Listing is as below:
{oracle}> ls -1b
bplog.bkup.001
bplog.bkup.002
bplog.bkup.003
bplog.bkup.004... (1 Reply)
Discussion started by: newbie_01
1 Replies
7. UNIX for Dummies Questions & Answers
Well, I've searched the forum, but couldn't find an option, that would help me. I'm really a dummie in unix, so here it goes.
I've got like 50k files in a single catalogue. One of them contains a string:
Including the box/square brackets. I tried to find it manually, and use some search... (2 Replies)
Discussion started by: kalik
2 Replies
8. UNIX for Dummies Questions & Answers
hello all
i have a big problems for me
if i have more files as example
test.ghrt.part01.rar
test.ghrt.part02.rar
test.ghrt.part03.rar
test.ghrt.part04.rar
test.ghrt.part05.rar
test.ghrt.part06.rar
test.ghrt.part07.rar
test.ghrt.part08.rar
test.ghrt.part09.rar
test.ghrt.part10.rar... (13 Replies)
Discussion started by: ateya
13 Replies
9. Shell Programming and Scripting
Hi,
This is what I would like to do.
1. Find all directories named "ByHost" in a specified directory
2. Rename all .plist files inside "ByHost" directories
This is the way I have been able to do it so far.
#!/bin/sh
#
# Rename ByHost files
#
# Thomas Berglund, 13.07.08
# Get the... (2 Replies)
Discussion started by: Thomas Berglund
2 Replies
10. Shell Programming and Scripting
i have hundreds of directories that have to be renamed. the directory structure is fairly uniform which makes the scripting a little simpler.
suppose i have many directories like this */*/*/*abc* (in other words i have similar directory names 3 dirs deep that all contain the pattern abc in... (8 Replies)
Discussion started by: quantumechanix
8 Replies
LOCATE(1) BSD General Commands Manual LOCATE(1)
NAME
locate -- find files
SYNOPSIS
locate [-d dbpath] pattern
DESCRIPTION
locate searches a database for all pathnames which match the specified pattern. The database is recomputed periodically, and contains the
pathnames of all files which are publicly accessible.
Shell globbing and quoting characters (``*'', ``?'', ``'', ``['' and ``]'') may be used in pattern, although they will have to be escaped
from the shell. Preceding any character with a backslash (``'') eliminates any special meaning which it may have. The matching differs in
that no characters must be matched explicitly, including slashes (``/'').
As a special case, a pattern containing no globbing characters (``foo'') is matched as though it were ``*foo*''.
Options:
-d dbpath
Sets the list of databases to search to dbpath which can name one or more database files separated by ``:'', an empty component in the
list represents the default database. The environment variable LOCATE_PATH has the same effect.
EXIT STATUS
locate exits with a 0 if a match is found, and >0 if no match is found or if another problem (such as a missing or corrupted database file)
is encountered.
FILES
/var/db/locate.database Default database
/usr/libexec/locate.updatedb Script to update database.
SEE ALSO
find(1), fnmatch(3), weekly.conf(5)
Woods, James A., "Finding Files Fast", ;login, 8:1, pp. 8-10, 1983.
HISTORY
The locate command appeared in 4.4BSD.
BSD
April 5, 2003 BSD