How would you get a webpage source from Terminal? [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 10 years ago.
The community reviewed whether to reopen this question last month and left it closed:
Original close reason(s) were not resolved
Improve this question
On my website I have a text file with data on it (The site in question is hosted by GoDaddy, so I can't access the file locally). This file is updated through PHP. From the Unix/Linux/Mac bash I would like to get the contents of the text file so I can use it in scripts. Any help would be appreciated :)

curl is installed already on your Mac, so you don't need to install it. You will also find curl installed on pretty much any Linux distribution. That's probably your safest bet.
cd ~/Desktop
curl www.google.com >> google.txt
wget can be installed on your Mac easily with Homebrew. It will likely be installed already on most Linux distributions.
cd ~/Desktop
wget www.google.com

Install MacPorts and install wget:
$ sudo port install wget
And then:
$ wget http://godaddy.com/somewhere/somefile.txt
And the resulting text file will be somefile.txt (this can be changed using the -O option).

Related

wget -v -t=5 --no-clobber -x http://www.website.com/ What happen to this website when I run this command in terminal? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
wget -v -t=5 --no-clobber -x http://www.website.com/ What happen to this website when I run this command in terminal ?
If you using Linux Terminal you should get handy with the command wget!
Syntax
wget https://www.example.com
Note:
All the files will get downloaded from website to your current dictionary.
Also:
You can download a specific file from website by specifying it's (exact) location.
This becomes really handy will downloading some files , like jquery-3.6.0.min.js (A file needed for independent working of jQuery)
Articles related / References :
Google search
Reference Article
Difference between Curl vs Wget
Try installing httrack and run following command
httrack "http://www.all.net/" -O "/tmp/www.all.net" "+*.all.net/*" -v

Emacs gone from Mac OS Terminal - Only GUI version left [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
I have recently removed Emacs from my Mac OSX Yosemite, and have a beginner's beginner's problem in re-installing it and running it from the terminal. I can open the Emacs app GUI from the Applications folder, but cannot use Emacs from within the Terminal whatsoever.
I removed the old version of Emacs by using the command:
$ sudo rm /usr/bin/emacs
$ sudo rm -rf /usr/share/emacs
Then I installed the newest version of Emacs through Homebrew, using the code
$ brew install emacs --with-cocoa.
Now, when I type the command emacs in the terminal, I get "/usr/local/bin/emacs: No such file or directory."
I tried to add the following lines in a file named "emacs" in /usr/local/bin:
#!/bin/sh
/Applications/Emacs.app/Contents/MacOS/Emacs "$#"
But now, when I type the command emacs in the terminal I get: "-bash: /usr/local/bin/emacs: Permission denied"
Any suggestions? Thanks in advance!
My crystal ball tells me that you forgot to chmod +x /usr/local/bin/emacs.
You don't need a script, use a symbolic link.
$ ln -s /Applications/Emacs.app/Contents/MacOS/Emacs /usr/bin/emacs

Using the unzip command in SSH with Mac Terminal not working [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 10 years ago.
Improve this question
I logging into my server from the Mac Terminal Bash Shell and the unzip command is not working I keep getting the following message:
bash: unzip: command not found
Can I unzip a file via SSH from Mac Terminal?
The program unzip should be in /usr/bin:
$ type unzip
unzip is /usr/bin/unzip
Worst case, you can always just "ask for it by name":
$ /usr/bin/unzip foo.zip
You should check your PATH variable, as it should normally include /usr/bin:
$ echo $PATH
$ PATH=/bin:/usr/bin:$PATH
$ export PATH
Make sure you have selected a login shell for your Terminal. This will set a good value for the PATH variable when the shell starts.

Troubles with shell script versus terminal on Pi [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 10 years ago.
Improve this question
I am trying to share a folder on a windows computer with the raspberry pi.
when I use these commands in terminal:
sudo mkdir -p /mnt/foldername
sudo mount -t cifs //IPADDRESS/folderIwanttoaccess/ -o username=usrname,password=passwrd /mnt/foldername
This works fine and I am able to save files on the raspberry pi to the windows shared folder.
but when I try this in a shell script I am able to see the folder as shared but with "^m" at the end.
for example: Foldername^M
Why does this happen and is there a way around to stop the "^m"?
Thanks in advance
According to this, you can sort your problem using sed, merely by using the following incantation: s/^M$//. Hope that helped!

Whitespace added after path following a command with sudo [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
When I try to execute a command as super user that is followed by a path, the auto-complete (tab) will produce a whitespace after the folder:
Example, in my home folder:
"sudo cat Doc" <tab>
produces
"sudo cat Documents "
as opposed to
"sudo cat Documents/"
This is quite annoying. Any ideas what may be wrong? Did I break it or is this simply a bug?
I am running Linux Mint 13 Mate 64.
You can use bash-completion for the issue. For Debian/Ubuntu
sudo apt-get install bash-completion
This topic seems to fix it.
I am still unsure why this occurred though. I am quite certain it wasn't an issue until today.

Resources