Questions about using the command-line interface (CLI).

learn more… | top users | synonyms (6)

7
votes
5answers
539 views

how can I take total minutes from time?

My system displayed the time like this 10:42 when i input the command date +%R. I need to take in total minutes of the time. That means like this 642 minutes. Is there any command or shell script for ...
0
votes
1answer
24 views

BASH: boolean statement unexpected behavior when checking for whether a directory exists

I have to get some files from a device and store them in a directory with a particular name. I'm writing a script that does this, but one of the first things it does is it checks if the directory with ...
14
votes
4answers
2k views

What is `$?` ? Is it a variable?

The question is pretty straight forward. I can get the exit code of the previous command by using $?. But what exactly is it? I don't think it is a variable, because you can't have any special ...
6
votes
2answers
85 views

Adding a suffix at the end of each shell command

Is it possible to automatically add some characters at the end of each command typed in the terminal. For example, if I write sudo apt-get update the shell will execute sudo apt-get update ...
1
vote
1answer
29 views

How to create shortcuts in terminal? [duplicate]

I'm using Ubuntu 14.04. I often use cd .. command in terminal. I want to replace the command with .. or some other shortcut. Can I do that? If yes, how to do it?
3
votes
1answer
23 views

No new line in terminal ubuntu after changing prompt style

I changed the PS1 for terminal to export PS1="\033[0;33m\h:\W \u\$ \e[m" Now, it doesn't type into new lines in case of a long sentence. Instead, it just overwrites on the existing written stuff ...
0
votes
0answers
29 views

Ubuntu 3.13.0-48-generic PATH Variable Not Working

I am trying to edit the PATH variable on a fresh Ubuntu install. For some reason it keeps throwing the error "No such file or directory" whenever I try to invoke my command. java;echo PATH=$PATH;echo ...
2
votes
1answer
30 views

How to multiply negative numbers in bash

This is my script for multiplying negative numbers #!/bin/bash p="1" h="-10" z=$(echo "(($p)*($h)+2"| bc -l) echo $p $h $z and this is the result (standard_in) 2: syntax error 1 -10 how to ...
0
votes
1answer
31 views

Is it possible to see a log of all terminal output that occurred after running a command?

I know it's possible to see a history of all commands I've run, but is it possible to see a log of all terminal output that occurred after running a command? Context is that I want to see exactly ...
2
votes
2answers
32 views

Renaming (.filename) file to original names

I'm trying to revert a change I made via rename. I was renaming files in a subfolder, then without thinking, tried to clear the .. from names using: rename "s/.././" * Now I have a folder of 600 ...
0
votes
1answer
29 views

How to subtract float values in shell script

I have a script which uses float values but some how i am not able to subtract two floats. This is the sample code #!/bin/bash p="1" h="10" m=$(echo "3.5"| bc -l) for (( c=$p; c<=$h; c++ )) do ...
0
votes
2answers
42 views

How to install the any downloaded software packages via teminal [duplicate]

As a new Ubuntu user I installed the OS by downloading the software via terminal commands without problems. Now I would like to install additional software packages. While trying to install downloaded ...
2
votes
1answer
39 views

Find and replace special characters in a directory

I have a number of Windows based .m3u playlists - they start with ..\..\ and have \ instead of / for folder paths, whereas Ubuntu prefers they start with /media/usr/part/dir/ (i.e. the absolute path). ...
14
votes
2answers
485 views

What's the missing argument to -exec?

I use the following command to clear a directory, of files and directories over 30 days old, and move them to an archive directory which I can delete after a few weeks if nobody asks for their files ...
4
votes
4answers
1k views

What is the difference between scp and cp?

I'm really new to the command line and Ubuntu and I have recently learned that there is the scp command as well as the cp command. I tried to use an scp command to move a directory from Point A to ...
0
votes
1answer
71 views

cc1plus: error: unrecognized command line option ‘-std=c++11’ [closed]

I am installing pothosware but the following error occurs: cc1plus: error: unrecognized command line option ‘-std=c++11’ I am trying to install through synaptic package manager .
1
vote
1answer
30 views

Sending MIDI clock only (bpm count) through USB to sequencer [terminal]

I'm trying to send bpm to my Arturia MicroBrute sequencer through USB. It has USB MIDI input through that port as it can be seen on many YouTube links and I easily manage to sync it with Reaper DAW on ...
1
vote
1answer
50 views

How to sort numbers in text files? [closed]

I made a file using ed and named it numeric. Its content is as follow: -100 -10 0 99 11 -56 12 Then I executed this command on terminal: sort numeric And the result was: 0 -10 -100 11 12 -56 99 ...
1
vote
6answers
70 views

How to fetch numbers from a file and calculate using shell script [closed]

I have a file named numbers.txt. That contain some numbers like this 1568 14578 2365 41655 9965 ... ... I need to take sum of these numbers. How can i take this using a shell script??
2
votes
3answers
171 views

How to install certificates for command line

So in school we need to install a certificate to access https sites. In firefox, I can import the certificate. However, I can't do so with the command line. For example, running git push I get: ...
0
votes
1answer
50 views

Change desktop environment from terminal?

I have installed Crouton on my chromebook, with the standard unity desktop(Ubuntu 12.02). However, I wish to use the Gnome 3 desktop environment. I cannot however install gnome-shell, since it ...
1
vote
1answer
33 views

Writing an alias that puts a folder and its subfolders/files into an encrypted archive titled with the date

I am trying to write an alias that puts a folder and its subfolders/files into an encrypted archive titled with the date the command is run. Preferably in format "YYYYMMDD FolderName Backup". E.g. ...
0
votes
1answer
24 views

terminal not working it wont let me put in my password [duplicate]

after I type in a command in to the terminal it ask for my password but when i try to type in my password nothing happens don't know where to go from here
0
votes
0answers
21 views

Lubuntu: Make Control+Alt+T open a new terminal on top of all windows?

I'm using Lubuntu. Whenever I open a terminal using Ctrl+Alt+T, it opens lxterminal behind whichever window is currently focused. Is there any way for this shortcut to open lxterminal on top of all ...
0
votes
1answer
28 views

how do i send a command to execute on a terminal?

I am executing system ("./get_emotion.sh"); which opens a terminal and establishes some connections. Then it requires this input set all evi . I have tried using && in system() to send input ...
0
votes
0answers
27 views

Executing Pure Data Patch from within Python/Shell on Raspberry Pi

I am searching for a way to execute a Pure Data patch from within a Python/Shell script. I have the PD patch (called sf.pd) on my Pi in a folder called /home/pi/pd. To execute the PD patch from the ...
0
votes
0answers
25 views

Installing brackets

I'm trying to install brackets.i've used the dpkg command.i've checked /opt and there's a new folder called Brackets.What should i do with it in order to run brackets? When i type brackets in ...
1
vote
2answers
27 views

could not execute a file generated by php from terminal

I am trying to execute a file from terminal generated by PHP. When i manually type the file, its executing the perfect. But when it is generated by PHP program, it throws an error. The permission of ...
0
votes
0answers
8 views

Why is sage not cooperating with urxvt?

I'm running Ubuntu 14.04 and having a problem getting the computer algebra system sage to cooperate with my terminal rxvt-unicode-256color. For instance, issuing the clear command returns an error ...
1
vote
2answers
43 views

I can not remove blender

I want to install the new version of blender (2.75), but first I have to remove my old version of blender (2.74), I try to remove blender with this command: sudo apt-get remove blender but when I ...
2
votes
1answer
29 views

Bash completion for commands that start with specified letter?

Is it possible when I press Ctrl+r and after this, for example, press the letter a, then using the up and down arrow key to search only the commands in the history that start with a? Or if I type ssh ...
2
votes
2answers
54 views

7zip: How to exclude file types?

I want to exclude the following file types: epub pdf html (upper case too) azw3 mobi opf txt I have this so far which doesn't seem to work, i get an error saying "Incorrect Command Line". 7z e ...
0
votes
1answer
22 views

High values of cpu load

The system uptime command is returning values above 5... This is a high value right? What could be the reason behind this?
1
vote
1answer
114 views

Ubuntu phone Apt-get install not working

I have purchase the Meizu mx4 Ubuntu edition and I downloaded the Terminal application from the store. I wanted to try to install anything through the terminal but it's always the same answer: W: ...
1
vote
1answer
19 views

what-source (part of what-utils) returns package name two times

On my Ubuntu 14.04.2, what-source returns two times the package name for some packages, e.g. ~$ what-source openssl openssl openssl or ~$ what-source firefox firefox firefox Is this normal ...
0
votes
1answer
34 views

Terminal session message: unable to find PtrFeedbackClass — Ubuntu Mate 15.04

Running a fairly stock install of Ubuntu Mate 15.04 the following message started showing up each time I open a terminal session: Here is some xinput output: unable to find PtrFeedbackClass for ...
0
votes
1answer
53 views

Drop/Undo sudo privileges on .py file which runs inside a program which runs from sudo previleges

I need to run a program from sudo privileges and I am running .py file inside the program. So when my program runs from sudo then it automatically calls/runs the .py file with sudo. I am running file ...
0
votes
1answer
35 views

installation of wine

i was trying to install wine on ubuntu 14.04. I used the command sudo apt-get install wine. A complete process was worked out. Around 140 MB data was downloaded from the internet but suddenly it was ...
0
votes
1answer
20 views

Alias syntax for mpirun

I execute my jobs in terminal using: mpirun -np 4 lmp_fedora < in.stdinfile Now I want to create a permanent alias run so that I can just input the command: run < in.stdinfile from any ...
0
votes
2answers
41 views

How to skip a record with awk

I have a large number of files in a log-directory, whose names were time-stamped (in this case with date +%b[...]). I want to write a POSIX compliant one-liner that will: either skip lines output ...
1
vote
2answers
65 views

What do I type in a terminal to understand what commands mean? [closed]

Is there a shortcut key to list what each Help command in the Gnome Terminal means? I got it to list by accident but didn't know the key switch to slow down the list, I am guessing these are DOS?
1
vote
1answer
35 views

Error with #!/BIN/BASH MAC [closed]

I am trying to host a unturned server, and I watched a tutorial on youtube. So that is what I wrote in textedit for the launcher of the server (a .command) : #!/BIN/BASH ...
2
votes
2answers
225 views

Command to list all users with their UID?

How can I list all users along with their UIDs? I want to do this from the terminal.
1
vote
1answer
23 views

execute python package to download a pdf file

i am new in python. please dont bore. i have a python package to download pdf file from a specific site. i can not execute this package. Please help me someone to execute the package. thanks in ...
0
votes
1answer
24 views

Bash Script for Dump Several Processes on Android Devices

I have created three bash script for dumping several processes that runs in the Android device. The first bash script: #!/bin/bash echo "adb forward tcp:8888 tcp:8888" adb forward tcp:8888 tcp:8888 ...
0
votes
0answers
14 views

impossible to run monodevelop

When I try to run MonoDevelop, I get this error: Unhandled Exception: System.TypeInitializationException: An exception was thrown by the type initializer for MonoDevelop.Core.LoggingService ---> ...
2
votes
1answer
57 views

Alias and executable file [duplicate]

I have lmp_fedora executable file located in /src. I use this command: mpirun -np 4 lmp_fedora < in.stdinfile to execute the job. However it is only able to run if I copy lmp_fedora into the ...
0
votes
2answers
56 views

Changing Mode of Installer Not Working

I am trying to run chmod +x /path/to/metasploit-latest-linux-x64-installer.run in the terminal to mark the installer as executable, however I keep receiving an error: cannot access ...
0
votes
1answer
39 views

How to open new terminal by C code?

I am using ubuntu 14.04 and Qtcreator to complile a code. I am able to run a terminal by code system("/home/salman/find_location/start_yarp.sh"); But on the next line i have ...
1
vote
5answers
218 views

Check Software Version

I need to check the current version of VLC I have running, however I don't know where it is installed (can't see it in /etc or /bin). If I do vlc in a terminal then the application starts, but is ...