Tag Info

Hot answers tagged

21

You can also do a file name that starts with a period, and has no extension. Try naming it ".whatever." (note the trailing period). This works in both Explorer and from the command line.


16

Review the offending files. find /path/to/files -name '*:*' -print Delete the offending files. find /path/to/files -name '*:*' -exec rm {} + Rename the offending files with an underscore. find /path/to/files -name '*:*' -exec rename ':' '_' {} +


9

I used to write perl scripts to do this, until I discovered the rename command. It accepts a perl regex to do the rename: for this, I just typed two commands: rename 's/(\w+)-(\w+)-(\d\d)-(\d{4})-NODATA.txt\$1.$4$3$2.log$//' * rename 'y/A-Z/a-z/' *.log


9

You will not need to rejoin clients or re-create users if you are doing a domain rename. I don't know what step-by-step guide you're looking at, but the step-by-step guide to domain rename from Microsoft doesn't contain such instructions. I've done several domain renames in Windows 2003 single-forest, single-domain environments with and without Exchange ...


8

First of all, please read my blog post about how to name your AD. Ok, so now you're hopefully ready to name your AD ad.example.com or corp.example.com. Good choice, that's very reasonable of you. To answer your actual question, after you complete the domain rename and reboot the DCs, they will self-register everything necessary in the _msdcs zone. A ...


7

On the sharing tab of the properties dialog there is a New Share button at the bottom that will add a new share name into that drop-down. This will allow you to create a new share and set the share to that new name without having to delete the existing share. Don't forget to review the share permissions on the new share when doing this. Also if you don't ...


7

Rename can do this.. try something like find dir -depth -exec rename -n 's/[^[:ascii:]]/_/g' {} \; | cat -v you may need the cat -v to properly display any weird characters without your terminal getting screwed. if that prints acceptable substitutions change the -n to -v. That said, it sounds like the charset on your filesystem is wrong(mount -o utf8 ...


7

You can use ssh for that. For example: for server in server1 server2 server3; do ssh $server mv oldfilename newfilename; done You may want to have a list of servers stored in a environment variable: export MYLISTOFSERVERS="server1 server2 server3 ... servern " and a function (for example) in your bashrc (or a dedicated script): runforeachserver () { ...


7

Use bash variables and a for loop: for i in *;do mv $i ${i%0000777};done when you surround the variable name with {} and add a % sign, it returns the value of the variable with everything after the % removed. If you use a # sign it will remove from the beginning of the string. so for i in *;do mv $i ${i#thumb_};done Would strip the thumb_ off the front.


6

A few other things to check: If you run MySQL, don't forget to update it as well. By default, mysql_install_db will add entries to the mysql.user table allowing access from the server's own hostname. It usually adds localhost as well, so you're probably ok here, but it's worth doublechecking to make sure you don't lock yourself out. If you're running ...


6

rename 's/ACDC/AC-DC/' *.xxx from man rename DESCRIPTION "rename" renames the filenames supplied according to the rule specified as the first argument. The perlexpr argument is a Perl expression which is expected to modify the $_ string in Perl for at least some of the filenames specified. If a given filename is not modified by the expression, ...


5

For a more efficient version of Dan C's delete some UNIX variants support: find /path/to/files -name '*:*' -delete this avoids the need to fork and exec /bin/rm for every single matching file. This -delete option is present on MacOS X and on my FC11 system (with findutils-4.4.0). I don't know how long ago it was added to findutils.


5

I'd do it in a "mass grep" way. For example: $ grep -rin "hostname" / > /my/output/file.txt and examine file.txt when it finishes. Reason for that being that it's nearly impossible to accurately know where hostname/ip changes are needed, even if you're on top of your config, users might configure their software to depend on it, blind search tends to ...


5

You can (and you should!) run sysprep before capturing the master image, and then customize the installation using sysprep.inf, leaving the fields for computer name and domain blank; this way, all other installation steps will be automated, but computer name and domain will be asked during setup.


5

find . -depth -print0 | xargs -0 rename -n '$_ = lc $_' Take out the -n flag once you're sure that it's doing what you want.


5

In short, yes. You can move the .hg repository folder and then pull a new copy of your source.


5

This sounds a lot like a permissions issue. When you save the "second" file, you're saving it with permissions 0644 by default, with your user/group, at least on *nix. If you want, post the the output of ls -l file1 file2 before you do the rename, and I can give you a better answer. As for permissions, try changing the permissions on the original file by ...


5

Here's a script to do what you want: DECLARE @var1 nvarchar(50) DECLARE @var2 nvarchar(50) SET @var1 = convert(nvarchar(50),@@SERVERNAME) SET @var2 = convert(nvarchar(50),SERVERPROPERTY('MachineName')) EXEC sp_dropserver @var1 EXEC sp_addserver @var2, 'local' GO Credits: http://www.myitforum.com/articles/5/view.asp?id=4983


5

IP allocation is layered, with the Regional Internet Registry (RIR) for your geographic region controlling all IPs; these are then assigned to Local Internet Registries (LIRs) in large netblocks (typically /16 or bigger), who sell them to ISPs and - sometimes - individuals or corporations. Your first point of contact will be your ISP, but if you expect to ...


5

Bash has some amazing scripting possibilities. Here's one way: for file in ??????*; do mv $file `echo $file | cut -c6-`; done A handy way to test what it would do is to add an echo in front of the command: for file in ??????*; do echo mv $file `echo $file | cut -c6-`; done The six question marks ensure that you only attempt to do this to filenames ...


5

Your regular expression is broken, I think you meant something like this: 's/(\d{2})-(\d{2})-(\d{2})/20$3-$2-$1/' i.e. hyphens do not need escaping and the second slash was out of place. Note that with this substitution you will also rename files with the new naming scheme. You probably want to anchor the regular expression. Something like this should ...


4

mmv is a standard linux utility to move/rename multiple files. It is available from the repos for most distributions. For your example above, you could do: mmv *-Log-*-*-*-NODATA.txt #l1.#4#3#2.log For more information, read this debaday article or the man page.


4

Seriously don't do it! Renaming your domain will take you far longer than migrating/creating to a new domain name. Or easier still just ignore your domain name, end users never need interact with it. Aside form the "member of domain" section in Windows it is irrelevant what your Domain is called - simply creating a new DNS zone and adding the new domain ...


4

You will need to delete the share and re-create.


4

Files in /var/spool/cron (or /var/spool/cron/crontabs or /var/spool/cron/tabs on some systems) will be run with the permissions of the user for whom the file is named. For instance, /var/spool/cron/root will run as user "root" and /var/spool/cron/tom_13 will run as user "tom_13". If a crontab file is renamed to another valid user, it should run as that ...


4

Quick hack that will do what you describe in bash: cd /directory for F in `ls -1 |awk -F. '{print $2}'` do mv $F.jpg ${F}_00.jpg done For rename usage: wmoore@bitbucket(/tmp/dowork)$ ls -1 1.jpg 2.jpg 3.jpg 4.jpg 5.jpg wmoore@bitbucket(/tmp/dowork)$ rename .jpg _00.jpg *.jpg wmoore@bitbucket(/tmp/dowork)$ ls -1 1_00.jpg 2_00.jpg 3_00.jpg 4_00.jpg ...


4

Too complicated. If you have the rename command available, you could try the following: find . -name "*_test.rb" -print0 | xargs -0 rename "s/_test/_spec/" This finds the relevant files, sends them to xargs which in turn uses the rename tool (which renames files according to the given perl regex).


4

Using the bash shell find . -type f -name "ACDC*" -print0 | while read -d $'\0' f do new=`echo "$f" | sed -e "s/ACDC/AC-DC/"` mv "$f" "$new" done Note: using find will process the current directory, and the directories under.


4

Make a file named "renamethis.sh". Its contents should be: #!/bin/bash mv "$1" "$(echo $1 | sed 's/ \././')" Set the executable bit: chmod a+x renamethis.sh. Then, run something like: find /path/to/dir -name '* .*' -type f -print0 | xargs -0L 1 /path/to/renamethis.sh YMMV, no warranty express or implied, etc. FWIW, the spaces are what makes this ...


4

Some providers offer SWIP capabilities which will let you add your whois details to the Whois record. This however requires a minimum 8 IP block. https://www.arin.net/resources/request/reassignments.html You may want to see if you obtain a 8 IP block if they will provide SWIP'd Whois. You will still see a referral to your provider's whois servers but ...



Only top voted, non community-wiki answers of a minimum length are eligible