How to open all mp3 files using windows command line? - windows

If I have the following directory:
C:\Users\mkt\Desktop\Music\Tool\Lateralus
and want to open all files contained in the folder using cmd prompt. how could I do that?
I know that the following line will open one of them:
cd C:\Users\mkt\Desktop\Music\Tool\Lateralus\"01 - The Grudge.mp3"
But what about multiple files?
I am a noob at DOS and I really shouldn't be, but without practice you will never get better.

I am wondering, why it is opening your mp3 file with the cd command.
The cd command is used to switch directories, so this is something new for me.
I am a MAC OS user, so I could not test it, but if your given example worked, I think this should work too:
cd C:\Users\mkt\Desktop\Music\Tool\Lateralus\*.mp3
With the "*.mp3" you say, every mp3 file.
I hope this helps.

Related

use the zip command specifying different path from current directory

We have a set of unix tools that were ported to windows and I want to use the zip command to package a set of files.
I'm trying to do this:
Open cmd from desktop and take the files in r:\pam\client\ssb\portfoliorepportcards\202003\*.docx and create a zip file in r:\pam\client\ssb\PortfolioReportCards\202003.zip with the files in it.
My command is:
C:\Users\JPalomino\Desktop>zip.exe -b "r:\pam\client\ssb\PortfolioReportCards" 202003.zip . -i r:\pam\client\ssb\portfoliorepportcards\202003\*.docx
zip error: Nothing to do! (202003.zip)
and I get nothing
However when I cd to r:\pam\client\ssb\portfoliorepportcards and do
R:\Pam\Client\SSB\PortfolioReportCards>zip -r 202003.zip . -i \202003\*.docx
it works like a charm. Also I wouldn't want the folder structure in it.
Could you please tell me what I'm doing wrong in the command? It seems such an easy thing to ask from zip.
Thanks
Maybe this will help, you don't need zip.exe (if you have powershell 5 or higher)...
powershell -command "Compress-Archive -Path 'r:\pam\client\ssb\PortfolioReportCards\*' 'r:\pam\client\ssb\PortfolioReportCards\202003.zip'"
I saw you're having trouble zipping to another drive letter, this should help with that too. I'm not really familiar with zip.exe to know why that's giving your grief.
Anything else you "port" to cmd is probably better off as a powershell. --- also if "zip.exe" isn't on your desktop that could possibly be your problem right there. If it works when you CD that tells me it's probably located where you're CD'ing to. Perhaps add zip.exe as an environment variable so that it can be accessed globally instead of only from the working directory.
And my take one your command (If zip is actually on your desktop or set as environment variable... : zip.exe -b "r:\pam\client\ssb\PortfolioReportCards" 202003.zip . -i r:\pam\client\ssb\portfoliorepportcards\202003\*.docx
I would re-write that and try this instead (because traditionally the filepath is all in quotes for any other windows command I know of)...
zip.exe -b "r:\pam\client\ssb\PortfolioReportCards\202003.zip" . -i r:\pam\client\ssb\portfoliorepportcards\202003\*.docx

How to go to a specific file in Mac Terminal?

I'm trying to follow a walkthrough and this is one of the steps, "go to that same folder in Terminal (if you can't do that you should probably quit now)" I'm not very familiar with Mac's Terminal, but don't feel like quitting. If it helps, I need to run a grep -r "what I'm looking for" command on the file. I really have no idea what I need to do to run that command, but the rest of the walkthrough is pretty thorough, so I know I can follow the next few steps.
You need to move to the directory where that file is stored, for this the command is cd. For example lets say the file is located in a directory names MyDir in the Desktop, the command will be
cd /Users/{YOUR_USERNAME_HERE}/Desktop/MyDir
You can run ls command here to check if the file is actually present in this directory or not

How to send a file to Desktop with bash script?

I am trying to send a file or folder to Desktop with Linux Command Prompt but I don't know how.
Please tell me what command can I use for this?
The move command mv. Use man mv for more information, as this command is a lot more complex than it seems. With cd Desktop/ you should be able to find your desktop on variations of linux like Mint or Ubuntu. To find your present working directory, as in your current path for the terminal, type pwd. This will give you your directory which will be similar to /home/Desktop.

How to create a batch file in Mac?

I need to find a solution at work to backup specific folders daily, hopefully to a RAR or ZIP file.
If it was on PC, I would have done it already. But I don't have any idea to how to approach it on a Mac.
What I basically want to achieve is an automated task, that can be run with an executable, that does:
compress a specific directory (/Volumes/Audio/Shoko) to a rar or zip file.
(in the zip file exclude all *.wav files in all sub Directories and a directory names "Videos").
move It to a network share (/Volumes/Post Shared/Backup From Sound).
(or compress directly to this folder).
automate the file name of the Zip file with dynamic date and time (so no duplicate file names).
Shutdown Mac when finished.
I want to say again, I don't usually use Mac, so things like what kind of file to open for the script, and stuff like that is not trivial for me, yet.
I have tried to put Mark's bash lines (from the first answer, below) in a txt file and executed it, but it had errors and didn't work.
I also tried to use Automator, but it's too plain, no advanced options.
How can I accomplish this?
I would love a working example :)
Thank You,
Dave
You can just make a bash script that does the backup and then you can either double-click it or run it on a schedule. I don't know your paths and/or tools of choice, but some thing along these lines:
#!/bin/bash
FILENAME=`date +"/Volumes/path/to/network/share/Backup/%Y-%m-%d.tgz"`
cd /directory/to/backup || exit 1
tar -cvz "$FILENAME" .
You can save that on your Desktop as backup and then go in Terminal and type:
chmod +x ~/Desktop/backup
to make it executable. Then you can just double click on it - obviously after changing the paths to reflect what you want to backup and where to.
Also, you may prefer to use some other tools - such as rsync but the method is the same.

How to change the copy file behavior in mac osx

I used to use Ubuntu
most of time, the command are same as Ubuntu
But there is a command annoys me.
it is cp (copy command)
because I often type cp -a FOLDER/ target
to copy a file , however , the command will copy all the folder under FOLDER/ but not including FOLDER/ itself.
I know I can get what I want by using cp -a FOLDER target (without the slash in the tail)
it easily to misuse the command.
Is there any way to change the behavior, thanks
The command cp is a program in /bin so you could rename the cp command to another file, such as main_cp.exe and create a batch file (script) of your own called cp, which changes the call from what you type to what is actually required and then calls main_cp.exe.
However, if you're going to be using OSX a lot and perhaps on other people's machines, learning to train yourself to just not type the slash is probably going to be better in the long term.

Resources