Transfer file.txt from Document to Python - terminal

From the terminal on mac OS X, I would like to transfer a file.txt from Documents to Python. Could anyone be able to tell me which command do I have to use for that?
Image of the terminal
Thanks in advance!

The command you want is mv Documents/file.txt Python/. What this does is invoke the mv command (universal in *nix), with Documents/file.txt as the source file and Python/ as the destination directory.

Related

How to create a file using goorm terminal

Hi i am not able to figure out what is the command for creating a file from terminal in Goorm ide . Just to make clear i want to create new file only from terminal not by gui.
Just like in other Linux terminals, you can type touch filename to create a file via goormIDE terminal.
FYI:
Type mkdir foldername to create a directory
Type goorm filename to open a file in goormIDE editor
goormide is ubuntu os.
so you can create files by typing common linux commands like touch data.json

Using gunzip on Windows in command line

I need to use gunzip (which is the decompression tool of gzip) in a terminal on Windows
I've downloaded gzip from here (first download link)
I installed it and added its /bin folder to my PATH variable, the gzip command works but gunzip is not even executable so I can't use it
gunzip content:
#!/bin/sh
PATH=${GZIP_BINDIR-'c:/progra~1/Gzip/bin'}:$PATH
exec gzip -d "$#"
Thanks
I made it work
As I said I needed to install gzip and add its /bin folder to my PATH variable
Then edit the ProgramFiles/GnuWin32/bin/gunzip file using this (replace everything):
#echo off
gzip -d %1
and save it to .bat format so you now have a gunzip.bat file in your /bin folder
Now I can use gunzip in a terminal :)
I have been using MobaXterm software in my local machine (Windows).
It works like Putty and WinSCP together and opens the local desktop in linux mode, thus it is easy for me to gunzip the *.gz type files.
The code you posted is bash, suitable for linux.
You need to make a dos/command version of it to be run on windows
i.e.
REM THIS IS CMD
PATH=c:/progra~1/Gzip/bin;%PATH%
gzip.exe -d "%*"
Since it is a different build anyway it is hard to say if all command line parameters are the same you are used with linux so maybe even with this .cmd or .bat you will not be able to work at the same way you do in a linux environment.

Shell script to copy a file from one location to another

I have written a Unix command to copy a file from one location to other and saved it with script.sh in my E:\ drive in Windows10. However,while executing through the command prompt by going to the path where this script is located,it throws pop up windows saying "how do you want to open this file?".Command in the script as below:
cd E:/source
for f in *.txt
do
cp -v "$f" E:/Destination/"${f%.txt}"$(date +%m%d%y).txt
done
Please help to fix this error.Thanks in advance.

How to open all mp3 files using windows command line?

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.

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.

Resources