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

learn more… | top users | synonyms (6)

1
vote
0answers
133 views

How does gedit detect the encoding of a text file?

How does gedit detect the encoding of a text file when opening it? I notice that gedit can always find the correct encoding when opening a text file of mine, while chardet can often fail to and ...
6
votes
2answers
413 views

How can I delete numbered files in a given range?

I have folderA that has some files with a number sequence starting with a_000000. What I want to do is to delete files starting from a specific number: let's say a_000750 till the end of files in this ...
0
votes
0answers
63 views

Creating an alias with tab completion

I know how to create a permanent alias, just edit .bashrc . I created alias forsudo apt-get install <appname> . As you may not know the exact name of app or want to check the dependency u can ...
1
vote
0answers
135 views

How to copy or select current string in terminal? [duplicate]

I want to copy current string (or select and then copy with help ctrl+shift+c) to clipboard. How do I make this?
1
vote
1answer
723 views

Ubuntu 14.04 won-t pass login screen after update and terminal won't accept password

So, I've been using Ubuntu 14.04 for several months now [still a newbie] and today, disaster has struck. I installed an everyday update, not really sure which, the kinds that I'm prompted for all ...
0
votes
1answer
450 views

save number of lines of a text file in a variable shell file

I'm working on terminal and running a .sh file and I want to count the lines in another file and save it as a variable to be used in this .sh file. I'm using this command sed -n '$=' /lines.txt when I ...
0
votes
2answers
438 views

Problem starting Gnome-Shell after login

I am using Gnome-Ubuntu desktop 14.04. I have a Intel i7 processor, 6g ram, and over 2.5t of disk space. I am loading the Gnome-Shell by DVD. I am current using Windows XP because I cannot launch ...
0
votes
1answer
62 views

Ubuntu install from USB issues

I have downloaded Ubuntu to my USB but am having trouble with the install. I reboot my computer and boot from the USB. Then the Ubuntu screen pops up and I select install ( also have tried the demo ...
2
votes
2answers
192 views

how to see the PID for currently running command?

while reading about linux I got : By default, variables created within a script are only available to the current shell; child processes (sub-shells) will not have access to values that have ...
12
votes
3answers
3k views

How to do: underline, bold, italic, strikethrough, color, background, and size in Gnome Terminal?

How to do: underline, bold, italic, strikethrough, and color in Gnome Terminal? Bold Italic u̲n̲d̲e̲r̲l̲i̲n̲e̲ s̶t̶r̶i̶k̶e̶ ̶i̶t̶ ̶l̶i̶k̶̶e̶ ̶i̶t̶s̶ ̶h̶o̶t Color background font < (its mono ...
0
votes
0answers
106 views

Bash Script for adding Keyboard Layout to available Layouts

I am writing a bash script to add a layout (Urdu as input language) to the available keyboard layouts. The current status is: script automatically detects the current layout, as a string. adds te ...
1
vote
0answers
73 views

Ubuntu 14 Terminal is not found in search in VM

I am pretty new to Ubuntu 14. I have UI version running on VM VirtualBox. I didn't install Ubuntu and I want to open its terminal, but it's not shown in the search results. I don't know why, is it ...
0
votes
1answer
66 views

Console errors are not being shown

The problem is no errors are being shown even when I type wrong command as shown. There are several cases: bash> blablabla bash> man blablabla The output of lsof -a -p $$ -d0,1,2 gives the ...
1
vote
3answers
320 views

How to get list of all non-removable disk device names (SSD/HDD and SATA/IDE only)?

I need a list of all disk device names (not USB or CD ROM) in the following form DRIVES='sda sdb' so that I can loop through them in a bash script. Ideal solution would not have to install a special ...
5
votes
4answers
1k 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
2answers
69 views

How do I write a CD/DVD from the shell to save emails etc?

Was wondering if there is a simple way to save emails, etc... to a CD/DVD from terminal when the upgrade to ubuntuu 14.04 has delivered an icon and bar-less desktop with a program error message? ...
4
votes
3answers
9k views

How do you view file permissions?

I want to know how to see the permissions a particular file has. Which command should I type in the terminal? However, I don't want to change it.
-3
votes
2answers
131 views

How do you call g++?

I wanted to use g++. However, when I type in g++ in the terminal, it says, "fatal error no input files". I have asked a similar question before but to avoid extending the discussion in the comments, i ...
0
votes
1answer
118 views

lost access to executable file (file not found)

I am trying to execute a file that I have recently run. However the system says file is not found? The file was taking a long time to execute and in the end I had to close the Terminal window that ...
1
vote
1answer
127 views

shortcut to send selection to terminal in geany

So i've set up the geany to use with the terminal. My next question is how to set up a keyboard shortcut to send the currently selected code to the terminal?
0
votes
1answer
402 views

How to send an email attachment from terminal?

I am using Ubuntu 14.04. I think the mutt command is not available with this version of Ubuntu. Then how can I mail an attachment using terminal commands?
4
votes
1answer
267 views

Adding unread message count to terminal command prompt

I want to see the number of unread messages in my unix mail messages account in the command prompt. How can I do this? Update: Here is the output from mail and mailx when I have sent myself two ...
1
vote
2answers
46 views

Command to identify running computer

Based on development level there are three computers on which I work at. My personal computer has a different version, and the other two are a development and production servers with similar ...
0
votes
0answers
272 views

Unable to resolve (even ping) hosts on command line while reaching them in browser

I am trying to perform some actions in a Ubuntu (12.10) inside a Virtual Box, under Windows 7 I can perform most tasks, access any needed repositories ... except for some, and I don't understand ...
0
votes
1answer
21 views

How to save newly created commands in the terminal

is there anyway to save newly created commands in the terminal? Every time, I exit the terminal, all of the commands I created are lost. Thank you.
0
votes
0answers
88 views

What pnum to specify when applying a unified patch file

I have a patch file that has the header: diff -Naur '--exclude=*.mod.c' '--exclude=*.o' '--exclude=*.ko' '--exclude=*.cmd' '--exclude=*.git' '--exclude=.git' ...
2
votes
4answers
294 views

How do you find and use programs that have been installed on Ubuntu? [duplicate]

I recently installed a program using the terminal command sudo apt-get install, and I want to locate and use it, and delete it. (I only did it as a test and had no actual use for the file). Where can ...
0
votes
1answer
55 views

echo “${txtred}Text${txtrst}” color not always working

I have a .sh file through terminal and I'm using echo "${txtred}Text${txtrst}" as a display of what's happening when running the script. But sometimes the color is not red, although I used {txtred}. I ...
0
votes
1answer
70 views

Script Not Running Properly On Server

I am having an issue with my webserver. I am testing it out on a new kernel build and it seems as if I can't get one certain part running on it. All of my scripts work except this one. Every file ...
1
vote
0answers
373 views

proxy system wide configuration from terminal applied to gui

we began installing ubuntu desktop 14.04 lts in replacement of xp desktop. the problem is after installing few desktop with the required applications and softwares it takes so long, so we are trying ...
1
vote
0answers
13 views

How Do I Change the Application Mapped to Open in Terminal? [duplicate]

I have appended Open in Terminal to my right-click context menu which by default, opens up a terminal window at the selected location. I would like to replace the default terminal window with ...
3
votes
1answer
127 views

mkdir crashes bash

I'm trying to create a directory in my home directory but the shell itself keeps crashing. I have permission to write to the directory. I am able to create files in the directory via touch. I can ...
0
votes
1answer
291 views

How can I create this specific executable in Ubuntu 14.04? [duplicate]

So I'd like to run World of Warcraft's .exe (wow.exe) with the following command from the terminal: __GL_THREADED_OPTIMIZATIONS=1 WINEDEBUG=-all wine wow.exe -opengl The reason for this is because ...
4
votes
2answers
797 views

Is there a faster way to check if a file is in use?

I'm looking for a command line function or c function that will let me know if a file is open/in use by something. lsof and fuser do tell this, but they provide a lot of other info which results in ...
1
vote
1answer
174 views

script.sh run differently when manually opening terminal and when using .desktop launcher

I have a script file script1.sh as shown below: #!/usr/bin/env bash cd /home/userA/scripts . r1.sh when I manually open a terminal and run it using . script.sh it works fine. But when I created ...
0
votes
1answer
2k views

Ubuntu touch Terminal app asks for password

I just installed ubuntu touch latest devel on my nexus 7 2013. Everytime i open the terminal app it asks for a password. I am not talking for the root password that i read it is "ubuntu". Does anyone ...
-1
votes
1answer
26 views

Is there an analogous command to `which` for shell functions? (or how to know how an function ended being callable up in my shell)

I'm working with Virtualenv, which i found out (after a few google searches) that it creates a shell function called deactivate in my shell. By looking through the package's files i found how it does ...
10
votes
3answers
917 views

What cowsay characters does Ubuntu have by default and how can I test them?

I saw somebody using Tux in cowsay earlier and I wonder what other characters there and what they look like in practice. Is there a quick way to look through all the characters Ubuntu has in its ...
1
vote
1answer
103 views

Prevent SSH from logging out after running initial commands

I'm using ssh to connect to a remote Linux machine like this: ssh -i .ssh/path/to/id_rsa -p 22 user@host 'cd /path/to/dir' I'd like some commands to be executed upfront (such as cd /path/to/dir) ...
2
votes
1answer
121 views

What does a file that is dark grey in linux mean?

From this question on the forum Color Code Files, I learned that some colors mean different things on linux. However, in the answer there wasn't a reference to a file that was dark grey. Here is a ...
1
vote
1answer
385 views

shell file opens terminal and run a sequence of commands in specific order

What I used to do is: Manually open a terminal instance to run the following commands and shell files Run PACKAGE_PATH=/home/userA/package1:/home/userA/package2:$PACKAGE_PAT‌​H run: cd ...
16
votes
1answer
2k views

How to display random jokes from www.icndb.com in your terminal?

I already know that you can get some nice quotes/jokes using the fortune program. But I've found in this urwird script a new source of fun that I'd like to have when I open a new terminal. This time ...
2
votes
4answers
617 views

Is there a way to check which font your shell/terminal emulator is using from the commandline?

Is there a way to check which font your shell/terminal emulator is using from the commandline? I am willing to settle reading part of a config file, if a direct command is not readily available.
1
vote
1answer
345 views

how to run command in an already opened terminal through a shell script

I'm running a shell script.sh which is supposed to open terminal and then run some commands in this opened terminal. What happens is that the terminal starts but the following commands are not ...
0
votes
1answer
91 views

Desktop Launcher executing a sequence of commands after opening a terminal

I've created a .desktop launcher as shown below which successfully opens terminal. What I want to do next is to run the following commands such as cd home/userA/scripts then ...
0
votes
0answers
9 views

Error mounting external hard drive [duplicate]

here is the error message: Error mounting /dev/sdb1 at /media/hubert/My Passport: Command-line `mount -t "exfat" -o ...
2
votes
1answer
389 views

Execute command with relative (upper) path. Using another working directory

I need to run an application (msp430-gcc) using a relative path from a makefile. The issue is that the application is in a different folder branch so I need to do something like this: ...
-1
votes
2answers
64 views

Just installed UBUNTU and two problems [duplicate]

First every time it asks me for a password in a terminal all the keys on my keyboard stop working completely fine all the time until it asks for the terminal password so I cant do anything Second. ...
10
votes
4answers
1k views

Identify the server I'm working at

How to identify which server you're on when using ssh from terminal? I have to ssh into 30 servers daily, and switch between them constantly. Currently I'm editing the tab name and writing the IP ...
0
votes
2answers
47 views

Run a command using some text [duplicate]

What I want to achieve is making a string command start server run the command wine ./_server.exe. How would I do this?