/usr/bin/time: No such file or directory - linux

I'm trying to run the time command for a file on a virtual machine running Fedora 19 64-bit and I get the message "/usr/bin/time: No such file or directory". I tried googling, but it appears it's something that I should already have. How do I get this on my computer?

For those on a raspberry pi or similar debian-based distributions, I found that I could install the package time (sudo apt install time) to obtain access to the time command.
Edit: For Fedora-based systems, the package name might be different. Try a dnf search time, followed by a sudo dnf install {package_name}. I don't have a Fedora machine immediately to hand to get the exact package name from.

bash/zsh/modern shells usually implement a basic time command as a builtin. So it won't exist on the filesystem, but time mycommand should work.
If you want the "proper" time command (with more options eg: -l/-v), then you'll need to install it via apt/yum/etc. You'll need to run it as /usr/bin/time mycommand so the shell-builtin doesn't get invoked.

It might be in other locations. I'd start by typing:
which time
This command will give you the path to time, if it's anywhere in your path.
If you need to build it yourself, you can get the source here:
http://directory.fsf.org/wiki/Time

Related

Error building a script for linux

I'm trying to build a script for linux to help me each time I install linux from scratch.
The Script have to 1.- Add repositories 2.- Install software from those repositories.
Adding repositories are not the problem, the problem is when i try to install software from this repo.
For the Repo:
sudo add-apt-repository -y ppa:webupd8team/java
After that, the script should make an update, so:
sudo apt-get update
It looks simple, but is not, because I receive an error:
The command Update could not be found.
And so on the rest of the softwares
apt-get -y install oracle-java8-installer
The package oracle-java8-installer couldn't be found..
I really don't know what should I do, nothing looks to work, I gave full rigths to the file and so on... always the same error.
But if I run the command apt-get install direct from the terminal, works without problem..
Any help?
actually I wrote a script in windows to use it in future Linux installations, for some reasons it doesn't work as I want it. Thinking it was a command or misspelled words, I search for a solution, wich didn't help anyways.
Debugging my script in a virtual Machine, I found that the script was giving some random errors like '/r' doesn't support and like that. Really weird because after searching in my script for that line code I didn't find it.
With that in mind, I search again for those errors, and found that for some reasons, if you write your code in a Windows maschine, it save it in a crlf type, wich in a Linux system is interpreted really wrong.
A solution of some users was converting the type from CRLF to LF, wich in linux is using the command dos2unix.
dos2unix filename.sh
After making that and runing my script again everything works perfectly.

Diffrences between "apt-get install openjdk-8-jdk" and downloading *.tar.gz

I want to install openjdk on ubuntu.
I found two ways to install it.
The first is typing "sudo apt-get install openjdk-8-jdk" on terminal.
The second is downloading the binary file such as *.tar.gz and then unpack the file and set environment variables JAVA_HOME&PATH.
So, is there any difference between this two methods?
I mean, will it cause different results?
Thanks a lot.
With the first approach, the installation is controlled by Debians Apt package manager and will receive updates, with the second one you will have to do that manually.
It will probably not end with different result.
On linux distributions you have what is called a packet manager : Yours (and on almost every ubuntu) is APT.
So the main difference is that when you use apt, you can "trust more" what you are downloading, because hopefully, content in apt are check.
However, because of this checking, apt isn't every time up-to-date, and it may induce some difference in version.
However, in my opinion if you doesn't want to duplicate file or pollute your system, you may want to choose either one option and stay with it : if you use apt, use apt to update, if you download it manually keep updating it manually.
I personally prefer to use apt when possible.

How to execute a .run file using Mac Terminal?

Once I navigate to a certain directory that has a .run file in it, how do I execute that file using mac Terminal?
I have change the chmod 777 for fileName.run file and run it
$ chmod 777 file-name.run
$ ./file-name.run
but it does not work for me. any idea ?
it give me the following error.
$ ./ppasmeta-9.4.1.3-linux-x64.run: cannot execute binary file
Its postgres plus advanced server for linux I want to install on mac os-x .
As suggested by Muhammad Iqbal, you won't be able to run a Linux-specific binary/executable on Mac OS X without some modifications. It's like attempting to run an .exe on Linux - without wine. While Linux and OS X are similar, they are not that compatible. If you can get your desired program in the form of a .deb, that may work. If not, I would suggest either dual-booting your Mac with a small Linux distro (ie. DSL) or picking up a virtual machine. I've dual-booted before - it's a decent option for this situation if you have enough hard drive space. If another solution shows up, I'll be sure to let you know through this channel.
I am not sure what you are asking here but try this
./run
As I said in the comments, I don't think that Postgres Advanced Server is available for OSX. If Postgres 9.5.3 is suitable for your purposes, you could install homebrew and use it to install Postgres 9.5.3 with:
brew install postgresql
You can download the one-liner to install homebrew from here.

timeout --> command not found in linux server

I am using linux server from cPanel. Now I need to use one of the linux command to run. And the command is 'timeout'. My command is something as below
$timeout 2s ./myexecutable < input > output
This is just running ok in my linux machine. But I want to run it in server(linux). But it is not running out there. I saw error log using 2>$1 . and it says command not found.
So how do I specify the path. That means how can I know the exact path to run it.
I am very new to this type of server stuff, so please don't be rude :D.. whatever you know please help me to get out of it.
thank you
On Mac, you can use gtimeout from the coreutils package. To install it, run
brew install coreutils
If you need the command to be called "timeout" then you can alias it.
alias timeout="gtimeout"

Xampp on linux mint

im trying to install xampp on "new" linux mint machine.
However im quite a noob to linux since i havnt used it for that long.
When i try to run the file that ive download from the following page:
Xampp download
i get the following error two errors:
Could not display "/home/marc/Downloads/xampp-linux-x64-1.8.3-0-installer.run".
and if i click yes
Installing mime type handlers isn't supported
To search and install software which can open certain file types you have to install app-install-data.
can anyone tell me what the problem is and how i might fix it?
you need to execute the file (e.g. open a terminal, navigate to your Downloads folder and run bash xampp-linux-x64-1.8.3-0-installer.run (possibly it might need to be run otherwise, but thats my best guess)).
alternatively you might be presented to run/execute the file (instead of displaying it). if so, choose this option.
on the other hand, you might consider installing apache/php/mysql via your package manager.
what you can do is that you can use the chmod +x /your folder location/.run file that you want to install
after that you can run following command
./and your .run file name
example:-
in my case :- User#user~$su root
it will ask for password so give it
User#user~chmod +x /Downloads/xampp-linux-x64-1.8.3-0-installer.run
User#user~./xampp-linux-x64-1.8.3-0-installer.run

Resources