os x terminal command [closed] - macos

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
Does anyone know how can i remove '#2x~ipad' string from all files name in a directory
do that a file named: image#2x~ipad.png will be renamed to: image.png
I need to rename all files in a certain directory
Can I do it with a loop from terminal? any idea?

Using bash (in the terminal):
for file in *2x~ipad.png; do
mv $file ${file%%\#2x~ipad.png}.png
done

Related

Bash - unzip: command not found [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I am trying to unzip the file in particular folder and i am getting a "unzip command not found" error.
I am using Cygdrive to run my bash script
#!/bin/bash
for dir in ./"$WORKING"/*
do
unzip '*'
done
The package is unzip
setup -nqP unzip
or use the GUI.
in the wild

Changing batch to shell [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
This is my first question, and I've finally resorted to asking as my hours of googles haven't returned anything good. Would it be possible to convert this batch script to a Linux shell?
#echo off
cd ../bin
color 0a
Title DavidScape 508
"C:\Program Files\Java\jdk1.6.0_11\bin\java.exe" DavidScape/Server 43594
pause
Thanks!
Something close would be:
#!/bin/sh
cd ../bin
echo -ne "\033[40;1;32m"
java DavidScape/Server 43594
read

How do I delete this '# ... #' Emacs File? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
There is a file in my home directory that is called #snake#. I want to remove it but none of the regular remove commands will work. How can this "file" be removed without causing any damage, and what type of file is it?
It's an autosave file, it's there in case your computer crashes. You can delete these from emacs quite conveniently. Open up dired (C-x d) and press # to select all of them in the directory. Then x for delete.
Alternatively in a shell, just put the name in quotes, e.g. rm "#snake#"
The "problem" is that the # sign is interpreted as the start of a comment in a shell. Try enclose the file name in quotes, like:
rm "#snake#"

How to change the host name locally in bash [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I want to generate ssh public key using ssh-keygen with custom host name in it at the end of the file
.
How to change the host name locally in bash.
Just provide the -C flag, the stuff at the end of the file is only a comment, not used for anything else except differentiation.
ssh-keygen -C "somecomment#somehostname"
The hostname at the end of the key file (id_rsa.pub) is just a comment. You can change is with any editor.
or if you really want to do it from the command line:
awk '{$3 = "myname#myhost.com"; print;}' id_rsa.pub > new_id_rsa.pub

How to execute shell script in cygwin? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
the name.sh already save in C:\Documents and Settings\user, i type sh name.sh
sh: testing.sh: No such file or directory
any help will be appreciated!
You can just type ./name.sh and your script should run.
If your current directory is not in your $PATH, adding the ./ tells the shell to look there.
The other possibility is that you're not currently in the right directory. If the result of pwd shows you are not in C:\Documents and Settings\user, then you will need to cd to that directory, or move the script to whatever directory you are in.
Add ./ in front of the name. ./name.sh

Resources