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

learn more… | top users | synonyms (5)

0
votes
1answer
29 views

I am getting an error when compiling a c program on terminal [closed]

ubuntu@ubuntu-desktop:~$ gcc sender.c ubuntu@ubuntu-desktop:~$ ./a.out Unable to bind: Address already in use
0
votes
3answers
50 views

Substitute specific char sequence inside filenames

A friend of mine grouped tons of files in this way on windows After I made him switch to Ubuntu, files are no more ordered based on the number of exclamation marks in front, so I would like to know ...
9
votes
5answers
15k views

How do I make urxvt render xft fonts?

I wonder whether there's a way to make urxvt render xft fonts: URxvt.font: xft:Droid Sans Mono Slashed:pixelsize=9:Regular URxvt.boldFont: xft:Droid Sans Mono Slashed:pixelsize=9:Bold ...
1
vote
2answers
138 views

How to send a mail/write to other user through a shell script? How to send EOF?

if [ who | grep $user | grep pts ] then write $user message here EOF fi Here if I execute it, it is blocking at write and I have to enter a ...
1
vote
2answers
58 views

permanent terminal with root

Is it bad to have at all times (one) terminal logged in as root? If so, why? (I leave the window with root terminal usually opened because it's much more comfortable than writing sudo before ...
17
votes
7answers
25k views

How to run a script without closing the terminal?

I have a script in file bla.sh and it is executable. When I click on it, the script is executed and the window is closed. I'd like the window to stay open. Something like command cmd /k** command in ...
0
votes
2answers
2k views

Terminal autocompletion 'tab' not working as intended?

I know this has been discussed on other posts but my problem does not seem to be fully resolved and I do not have permission to add a comment to those posts yet :( listed on help.ubuntu.com > ...
4
votes
7answers
607 views

How do I count text lines?

How do I count how many lines are in text file. e.g : command file.txt Note, I want to only count the non-empty lines (lines without counting white space and tabs)?.
1
vote
0answers
31 views

14.10 blank terminal and no wireless internet [on hold]

I seem to have messed up my ubuntu after checking some software sources I did a update and reboot and when I rebooted my terminal is now blank and minutes after my wireless lost connection and doesn't ...
12
votes
7answers
728 views

How to delete files listed in a text file

I have a text file that has a list of paths to various files. Is there a command I can use that will iterate thorough each line and delete the file at the stated path?
8
votes
2answers
3k views

How can I create a new profile for Gnome terminal via command line?

As everybody knows you can create a new profile by the menu where you get asked which existing profile should be the parent for your new profile and so on. But how should I create a new profile by the ...
1
vote
0answers
22 views

USB Modem Network Mode/Type

I'm using a Huawei E173 USB modem. With comgt sig I can easily get the network's signal strength, but I didn't find a way to specify which type of network is used (either GSM, Edge, or UMTS). Is there ...
18
votes
4answers
3k views

how to get bash to stop escaping $ during tab-completion?

I have this on the command line: ln -sf $PWD/wine- and then I hit tab to complete the filename. In earlier versions of Ubuntu, this worked just fine to complete the wine- filename (and as a ...
1
vote
2answers
436 views

Terminal line glitches

I installed Ubuntu 11.10 mini + LXDE and wanted to make my command line different in terminal (than just plain white), so I added blue color to path line (everything until $ sign) and it works fine ...
0
votes
2answers
289 views

Ubuntu 14.04 (cinnamon desktop) freezing, typically when using terminal

This is really strange, but frequently, Ubuntu freezes when I'm trying to enter (even basic) commands in the terminal. It does randomly happen when opening programs like Chrome as well. It freezes for ...
3
votes
1answer
90 views

Open URL in default browser (Chromium) from terminal and give browser focus

I am trying to open an URL from the terminal window in my default browser which is Chromium: $ xdg-open 'https://www.google.no/?gws_rd=ssl#q=site:askubuntu.com+xdg-open' >/dev/null This will ...
1
vote
2answers
145 views

Is there any way to execute a shell script whenever I open a terminal?

I want to display a message showing "welcome to terminal" whenever I open a terminal. Any ideas?
16
votes
9answers
26k views

How to show only hidden files in Terminal?

I have a directory that contains thousands of files, some of them are hidden. The command ls -a list all files, including hidden ones, but I need just to list hidden files. What command should I ...
1
vote
1answer
29 views

Error When Installing Anything

Every time i try to install wine in the terminal i get these errors Reading package lists... Done Building dependency tree Reading state information... Done wine is already the newest version. ...
0
votes
0answers
11 views

Known problems with readerware software download

Having some problems opening and running the Readerware 32 bit down load. "gunzip rware3x86.tar.gz" comes back with "no such file or directory"
0
votes
1answer
104 views

Failure during ssl handshake while sending mail using openssl

I am trying to send mail from terminal using openssl by connecting to gmail's server using ssl on the port 465. Things are fine until i enter from address and authenticate. But when i enter RCPT TO, i ...
63
votes
6answers
187k views

How can I create a zip archive of a whole directory via terminal without hidden files?

I have a project with lots of hidden folders / files in it. I want to create a zip-archive of it, but in the archive shouldn't be any hidden folders / files. If files in a hidden folder are not ...
2
votes
1answer
26 views

How to create a common base folder with tar and how to rename folders?

So I'm pretty new to Ubuntu and the whole Linux environment though I'm a computer scientist and I want to become familiar with the basic commands. At the moment I am working with .tar and .tar.gz ...
1
vote
1answer
39 views

How can I print a variable to a file?

How can I print the contents of a variable into a text file? For example, I have the following script: #!/bin/bash #My Bash echo "saisir votre nom" read $name I would like to print the contents of ...
2
votes
1answer
107 views

bash: /home/…/program: cannot execute binary file

I've got a problem with simple program. When I try to run it double clicking it. Also when I try to run it by writing its path in the termilal and it says bash: ...
1
vote
1answer
32 views

How to move all subdirectories to current directory?

I'm new to shell script programming. Suppose we have a file hierarchy like this: /A/B/C/D /A/B/E/F/G /A/H/I /A/H/J/K Note that here we not only have /A/B/.., but also /A/H/.... All letters are ...
5
votes
1answer
110 views

Shell scripting bash: How to detect Alt+N keystroke?

I want to write a script that always listens in the background and execute a particular command when the user hits a specific key combination such as Alt + N. How this can be done?
-1
votes
0answers
31 views

Getting error when I run command in Ubuntu 12.04

When I tried to run a command I got this error message: E: Sub-process /usr/bin/dpkg returned an error code (1), and for solving this error message I had tried this: But when I run this command sudo ...
12
votes
2answers
602 views

Wrong behavior of sort command?

I tried to sort the content of a file in Ubuntu desktop 14.04 (Trusty Tahr). In my case, the expected result should be same as original content, but the actual result is not. Why? # cat test.txt ...
21
votes
2answers
44k views

How do I change mirrors in Ubuntu Server from regional to main?

I have a Lucid Server (10.04) set up and I would like to change the mirror from US (or any other country) to the Main Ubuntu Mirror. For example my two first entries in sources.list are: deb ...
1
vote
0answers
23 views

Trying to connect wifi in Ubuntu 12.04 via terminal

I use ubuntu 12.04 and I'm trying to connect wifi via terminal. I did the following from root: $ iwlist wlan0 s - And I found my wireless network there $ wpa_passphrase essid_name pswd > ...
6
votes
3answers
2k views

How to prompt users with a GUI dialog box to choose file/directory path, via the command-line?

Suppose for example I have script like this: (The example depicts an rysnc use case) #!/bin/bash echo -n "Enter Source Directory:" read srcdir echo -n "Enter Destination Directory:" read dstdir ...
0
votes
1answer
28 views

How can I install Ubuntu with no boot options?

Here is my walk if shame: I ran the command sudo rm -rf ~ /.local And it deleted everything on my system. It is (or was) a Vizio CT14. The reason I ran this command in Terminal, if this is ...
0
votes
0answers
76 views

Mouse and video freezes. Fixed by CTRL-ALT-F6 and then CTRL-ALT-F7

Every hour or so the mouse and video freezes. I do Ctrl+Alt+F6 and then Ctrl+Alt+F7 and then it works again. What is wrong? And how can I stop the mouse from freezing?
3
votes
2answers
694 views

ctrl+alt+t random terminal opens

When I need to open a terminal I press Ctrl+Alt+T to save time. Most of the time absolutely nothing happens, I try to press same combination again, and still nothing happens. After like 5-8 tries ...
2
votes
1answer
716 views

Ctrl Alt T no longer opens terminal

I wanted to change my computer name so I edited /etc/hostname and /etc/hosts and restarted. Ever since then, Ctrl+Alt+T no longer opens Terminal. I tried going into Keyboard and making a custom ...
3
votes
2answers
300 views

copy to clipboard current path from console with no mouse [duplicate]

I'm wondering if it possible to copy to clipboard output of pwd command. I often need to copy some path and I have to select it with mouse, do several clicks and that is annoying for me. What I want ...
1
vote
1answer
224 views

Terminal (Ctrl+alt+F1-6) text colour

Is it possible to change the default foreground text coulour in the F1-F6 Terminals or the machines bios colour. I Love Green on Black and change it in the konsole/uxterm/Term ect as soon as I install ...
0
votes
2answers
37 views

How to run two 'python manage.py runserver' commands of two different folder in a single terminal

I have two different python project placed in different folder (project 1 in pydir1 directory, project 2 in pydir2 directory). Every time, I need to open two new terminal and run the python manage.py ...
2
votes
3answers
4k views

How to crop a multi-page (image/scanned) pdf file (which won't crop with pdfcrop)?

Usually, I'm pretty happy using pdfcrop, even though the cropped output usually consumes significantly more disk space. Note that comparable code does exist, which addresses and resolves this issue. ...
0
votes
2answers
2k views

Disable OpenGL for compiz from command line

I can run CompizConfig Settings Manager (ccsm) and uncheck OpenGL. How can I do the same thing, but from the command line? I need to add this step to a machine provisioning script.
5
votes
1answer
178 views

How to prevent output from '&' and '>' operator (send to background operator and redirection operator)

I have tried various combinations of gedit, &, >/dev/null 2>/dev/null. When gedit is used with the other two it always prints something to the terminal. I understand that the numbers are ...
0
votes
1answer
37 views

I can't run a program in Ubuntu 14.04

I've got a problem with a program I downloaded last week from GitHub. I tried to chmod it (a+x), tick option to run it as a program, but it didn't help. I don't get any notifications. It just does ...
1
vote
2answers
77 views

How to set custom keyboard shortcuts from terminal?

How to set custom keyboard shortcuts from terminal for different Linux versions? Basically I want to know where Linux stores the keyboard shortcut files and how it can be edited. On my research I ...
0
votes
1answer
26 views

Image format conversion from terminal?

Is there any way to convert image formats from Ubuntu terminal? Particularly from eps to png/jpg or to any other formats.
1
vote
1answer
108 views

What commands the suspend item in system menu really launch?

On my laptop trying to go in sleep mode using the Unity Sleep item (or closing the lid for what it is worth) does not work well (it goes in suspend mode very slowly and after that I am unable to wake ...
0
votes
1answer
42 views

What does “.bashrc or prepend the Anaconda install location” mean?

I installed Anaconda from root, after completion of installation this message was displayed on terminal screen: Python 2.7.8 :: Continuum Analytics, Inc. creating default environment... installation ...
0
votes
1answer
35 views

How to I parse a file and only keep certain words?

Let's say I have a list of words I want to keep. list=['hi','name','first'] I want to be able to go through a text file, keep each and every word in my list, and output the new cleaned up content ...
5
votes
4answers
630 views

Redirect pipe output to the same file

Is there any short way to save the pipe output to the same file that it's processed. For example, this is what I am actually doing $ cat filename | sort | uniq > result $ rm -f filename $ mv ...
0
votes
1answer
314 views

How do I set up PHP and MySQL cronjobs on Ubuntu 12.04 (Precise Pangolin) server?

I just made a LAMP install and got SFTP working. My question now is: How do I set up cronjobs on Ubuntu server? I need to make some cronjobs for my PHP/MySQL application. I look for un-activated ...