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

learn more… | top users | synonyms (5)

0
votes
4answers
45 views

Adding a number to a already present variable sed/grep/awk

I have this in file.txt FORM: lookupfile Version: 1 LookupFile:"$i" How can I find this in the file and add a variable b to the $i. So example INPUT FORM: ...
0
votes
2answers
41 views

How can I find my ubuntu's username?

When I boot system with ubuntu all I see is my background (No DASH, can't open terminal, etc). I've googled for this issue and the only solution seems to be getting to the command line with ...
2
votes
6answers
473 views

Concatenate two files and separate them with a newline

I have two files: k.txt: 3 5 7 9 19 20 h.txt: 000010 100001 111001 if I just use cat, there is no newline. I need a command which would provide a file which looks like this: 3 5 7 9 19 20 ...
1
vote
2answers
44 views

How to disown a chromium or chrome app on double click

I wrote a bash script to open an app (by double click) in my chromium. The code works but after opening the app when i close terminal the app also closes. I have searched through web and found out ...
1
vote
2answers
101 views

Looping tr command to remove '\r' in multiple files in a directory

I have about 260 files in a directory. How can I input these files one by one into some thing like this file is an array name file=input stream of multiple files x=0 LOOP tr -d '\r' file2 rm ...
3
votes
7answers
700 views

How do I round numbers to the nearest integer from the command line?

There is a file I have which look 555.92 569.472 582.389 648.078 999.702 1040.75 1386.24 1418.47 1998.26 2182.13 2384.3 I would need to round every number like this 556 569 582 Ideally i don't ...
1
vote
5answers
101 views

How do I check which terminal I am using?

I have Ubuntu on my machine and I am running awesome window manager on top of it. How do I check which terminal I am running? Is there a command for it?
0
votes
0answers
20 views

Execute Script in home directory on session open [duplicate]

I have a touchpad config command (synclient RightButtonAreaLeft=0 RightButtonAreaTop=0) that I want to execute on every system boot. My special requirement is that the whole config should be in my ...
1
vote
3answers
82 views

retain white spaces in fields when using awk

I am using nawk on a pipe delimited file to print fields as index and key where some of the fields contain white space, when there is no white space everything works normal, but in case of white ...
1
vote
1answer
4k views

No such command 'sip show peers' when using asterisk

i want to connect two soft phone using asterisk after configuration the sip.conf and iax.conf and extension.conf can't enter any order from cli example of the error: Connected to Asterisk 11.6-cert1 ...
2
votes
1answer
24 views

Flush Terminal Buffer?

I have a (proprietary) program which I start with ./program -a asdf in the Terminal. When I do that, I can see all the output at the right time. However, when I want to use the programs' output in a ...
0
votes
1answer
23 views

If condition fail skip to end of file

for (( v=0; v<t ; v++ )) do awk '/TRAP-TYPE/{i++}i' $fname >tron if [ "$?" -eq 0 ] then echo "MIB file found" else t=$t-1 fi some other commands echo "MIB not ...
0
votes
0answers
12 views

lxc-ls option flag error - lxc_container: command get_init_pid failed to receive response

I'm trying to use the lxc-ls command to list LXC containers on Ubuntu 12.04, but I'm getting a get_init_pid error whenever I invoke the command with an option flag. Here is an example session: $ sudo ...
1
vote
0answers
16 views

How to require root privilege to run command or alias? [duplicate]

On Ubuntu 14.04 LTS I would like to force certain terminal commands to run as root - or at least require the user password - to execute. For instance, poweroff requires sudo while gnome-session-quit ...
109
votes
6answers
228k views

What is the correct way to completely remove an application?

I've searched the net for such information and found different command lines, like these ones: sudo apt-get remove application sudo apt-get remove application* sudo apt-get remove --purge ...
1
vote
0answers
20 views

Terminal collapses when it get resized [video included]

https://www.youtube.com/watch?v=pCHCpOV-Kjk After upgrade to 15.04 my terminal acting weird when i resize it, It collapses and never back to normal no matter what, i should close/re-open to get it ...
6
votes
4answers
159 views

How to disable input language switching in terminal

In Ubuntu 12.04 I have two input languages installed, English and Russian. I would like to disable use of Russian language in terminal - so that regardless of system-wide selection, terminal will ...
2
votes
2answers
36 views

How to detect current gnome-terminal character encoding?

I am trying to detect the current gnome-terminal character encoding from the command line. I have tried using gconftool : $ gconftool-2 --get /apps/gnome-terminal/profiles/Default/encoding current $ ...
0
votes
1answer
20 views

How do I remove an update link from my terminal? [closed]

I found this guide called 'switching from LightDM to MDM,' and it was a nightmare when I had to uninstall it because of a black screen I got when I logged in. Now I have removed the packages that were ...
0
votes
1answer
16 views

How do I move between windows in IRSSI?

In IRSSI, I've always been able to use alt3 or alt5 to jump directly to specific windows. That seems to have stopped working. I think it probably happened with the update to 15.04, but I can't swear ...
19
votes
5answers
24k views

Command line tool to crop PDF files

I am looking for an open source command line tool to crop PDF file just like we can do in Adobe Acrobat Pro. I have tried PdfTk, ImageMagick, PyPDF, and GhostScript—all with no success so far.
0
votes
2answers
27 views

How to create a zip file from contents of a folder with certain name pattern?

is it possible to create a tar.gz file from contents of a folder but only put the files with certain name pattern in the archive and ignore the rest? for example just put the files which their names ...
3
votes
2answers
303 views

Tee doesn't get whole output from the pipe

I have a script executing commands like: export LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH;./some_app -i $INDEX | tee $LOG echo "Number of errors: $(grep "ERROR" $LOG | wc -l)" The problem is probably in ...
1
vote
1answer
107 views

How do I remove the brontok virus that has infected my Ubuntu via Wine?

My laptop runs on Ubuntu and was recently infected with the brontok virus it managed to infect my Ubuntu - through my flash drive - because I have Wine installed. I had used the USB in an infected ...
0
votes
0answers
10 views

Webmin Squid Commands

Whats command do I type on the CLI if I want squid to first implicit deny everyone to use the internet then afterward a command to allow the ip address 10.1.10.201 to be able to access all websites ...
2
votes
1answer
1k views

Bash Tab Completion: '-bash: unexpected EOF while looking for matching `)' -bash: syntax error: unexpected end of file

I'm trying to go into an irb session with specific environment variables from a file with this command: $ env $(cat env.sh) irb But when I try press Tab after I type env. to complete it, I get this ...
0
votes
0answers
57 views

GTK-Message, when open a file with emacs through terminal

I'm trying to open a text file through terminal just typing: emacs file.txt the file opens on emacs, but when I close the terminal emacs closes too, and I get this message in terminal ...
1
vote
2answers
26 views

How to get a recursive ftp directory listing without write permissions?

I know I can run ls * on the ftp server and get everything, but there's too much for my terminal (hundreds of pages so far). using ls * > myfile isn't an option because I don't have permission to ...
1
vote
5answers
130 views

Find files belonging to a user with size in MB on Ubuntu 12.04 (Precise Pangolin)

I am using this command which is working fine: sudo find / -user web132 -ls But when I am trying like sudo find / -user web132 -ls -lh I am getting a wrong syntax error. How can I get the file ...
14
votes
6answers
143k views

What is a command to compile and run C++ programs?

I am new to Linux. I am using Ubuntu 11.04 and do not know how to compile and execute C++ program in it. I need to know the commands to Compile and Execute a C++ program in Linux.
3
votes
1answer
59 views

File sharing between Mac OS and Ubuntu

I am pretty new to Ubuntu so please if you can answer to this question explicitly. I have two laptops one is running on MAC OS X 10.8.5 (OS X Mountain Lion) and the other one running Ubuntu 14.04 LTS. ...
3
votes
2answers
49 views

How can I list connected monitor(s) with xrandr?

I'm working on developing a python application for Ubuntu that enables a user to have their desired resolution without requiring graphics drivers. In order to do this I've been using xrandr, which so ...
1
vote
1answer
40 views

How to send terminal output to text file without newline

I am using the find command to find files of a certain type recursevely in subdirectories. I am trying to send the output from the 'find' command to a text file. However the long file paths returned ...
2
votes
1answer
27 views

oh my zsh binaries

I am trying to set a few permanent aliases in my terminal export PATH=$PATH:/Applications/orca alias subl='/Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl' alias chem='wine ...
70
votes
5answers
169k views

How to create an empty file from command line

How can I create an empty file from the command line?
0
votes
0answers
16 views

Totem X and Y coordinates [duplicate]

How do I set the X and Y coordinates of the totem window using command line or config file? I'm using ubuntu. The config file in the ~/.config/totem/state.ini only has these in it: [State] ...
27
votes
3answers
20k views

Bash history handling with multiple terminals

I use mainly Terminator, and it's usually opened with 3 split terminal windows. I also use Gnome terminal for various reasons. I'm wondering how is bash history handled in this case as I sometimes ...
21
votes
3answers
32k views

How to see time stamps in bash history?

Is there any way I can see at what time the commands were executed from the bash history? We can see the order but is there any way I can get the time also? Bottom-Line: Execution time in the Bash ...
2
votes
3answers
149 views

Install tar.gz , but no configure folder on install file

Im trying to install RokiSim a robot simulator in Ubuntu 14.04 I downloaded the tar.gz and extracted it. But didnt find any configure folder or make file to start installaton. How do I install such ...
0
votes
1answer
41 views

How to fix this error I got while Re-installing dropbox?

How can I fix this error I got while re-installing dropbox? The following packages have unmet dependencies: nautilus-dropbox : Depends: dropbox but it is not going to be installed E: Unable to ...
0
votes
3answers
3k views

changing shell from zsh to bash

My web server was tampered by someone who was using zsh shell. I feel more comfortable using bash shell, as that's the defaults that come with Ubuntu and OS X (the two main operating systems I use). ...
1
vote
1answer
20 views

backing up and compressing /home directory using lzma

Will this work? sudo tar -cvpf backboxhome.tar.gz/home/user --lzma I am mainly confused on where to place the --lzma argument.
0
votes
5answers
101 views

How to change the title of the current terminal tab using only the command line

None of the currently posted answers works/answers the question. Using only a command at the command prompt, how do I change the title of the current terminal tab? Many posts suggest this: echo ...
-1
votes
2answers
70 views

apt-get install/remove/reinstall doesn't work. Python errors

Recently I tried to install the ubuntu desktop on my ubuntu server 14. The installation failed hard. I tried several things fixing it and did a lot of research. But I couldn't find anything helpful. ...
0
votes
1answer
34 views

Why no ubuntu -v command? [closed]

I know that lsb_release -a as a terminal command will achieve exactly what I want (that is a quick printout of my installed Ubuntu release - 15.04). My question is more one of accessibility. Terminal ...
1
vote
1answer
36 views

Fancy apt-get output

How can you have a cleaner and fancier output with or with out colors form apt-get not apt something like the yum update output
49
votes
6answers
53k views

How to get the MD5 hash of a string directly in the terminal?

How do I get the MD5 hash of a string directly from the terminal? For example, I want the string abcdefg hashed. Currently the md5sum command only accepts a filename as input. I want to simply enter ...
3
votes
6answers
590 views

Create Random non words [closed]

dd if=/dev/urandom of=a.log bs=1M count=2 Question: if this code ^ gives me random numbers, how can I get random non-words (unintelligible) such as “hgcqw”. Question 2: Can the shuf command be ...
0
votes
1answer
33 views

Click every link on multiple webpages

In our project we have pages like http://123.4.5.6/3/4; inside there are a few pages. I need to access the URLs and to click on every link within them to download some files (in an automated way). ...
0
votes
0answers
14 views

Install script as service running under speciffied user

I would like to install services into init.d folder in most standard way. Suppose I have script which should be run under specific user and starts the service (tomcat8 good example) ...