Questions tagged [command-line]

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

Filter by
Sorted by
Tagged with
98
votes
5answers
104k views

How do I enable full-color support in Vim?

I have a lovely Vim colorscheme (xoria256) and it looks brilliant in GVim, but when I use normal vim in Terminal, the colorscheme is only partially supported -- for example, the default semi-...
97
votes
12answers
288k views

How do I install the latest version of cmake from the command line?

I am trying to install latest cmake in my linux box and I am always getting the below exception - userName@phx5qa01c-4e23:~/build$ wget http://www.cmake.org/files/v2.8/cmake-2.8.11.tar.gz --2013-10-...
96
votes
5answers
44k views

How do I turn off Caps Lock (the lock, not the key) by command line?

For some reason my laptop is stuck in Caps Lock. I have the Caps Lock key mapped by xmodmap to hyper_l, so I don't have a caps_lock key to turn it off. Is there a way I can turn it off by command ...
96
votes
11answers
262k views

How to compare two files

So basically what I want to do is compare two file by line by column 2. How could I accomplish this? File_1.txt: User1 US User2 US User3 US File_2.txt: User1 US User2 US User3 NG Output_File: ...
96
votes
3answers
41k views

Remove note about sudo that appears when opening the terminal

Whenever I open the terminal, To run a command as administrator (user "root"), use "sudo <command>". See "man sudo_root" for details. appears before the terminal. How do I get that to go ...
96
votes
6answers
218k views

How can I find which desktop enviroment I am using? [duplicate]

as the title: How can I find which desktop environment I am using? I want to accomplish this using command line.
96
votes
13answers
222k views

Can you set passwords in .ssh/config to allow automatic login?

I'm using Ubuntu 11.10. I'm using ssh for connecting to many servers daily, so I put their parameters in the .ssh/config file like this: Host Home User netmoon Port 22 HostName test.com Is there a ...
95
votes
5answers
759k 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.
94
votes
3answers
33k views

Bash: delete from cursor till end of line with a keyboard shortcut

Consider the following bash prompt, where ^ denotes the prompt location: $ git commit -am "[bug 123456] Do this and that with the bug" ^ Suppose that I want to commit ...
94
votes
1answer
241k views

How do “apt-get clean” and “apt-get clean all” differ?

What, if anything, is the difference between this command: sudo apt-get clean And this command: sudo apt-get clean all On my Lubuntu 12.04 system, simulating these commands reveals their behavior ...
94
votes
4answers
60k views

What's the difference between 'killall' and 'pkill'?

After using just plain kill <some_pid> on Unix systems for many years, I learned pkill from a younger Linux-savvy co-worker colleague1. I soon accepted the Linux-way,pgrep-ing and pkill-ing ...
93
votes
11answers
121k views

Why do I need to type `./` before executing a program in the current directory?

While executing a C program, a.out, using the Ubuntu terminal, why do I always need to type ./ before a.out, instead of just writing a.out? Is there solution for this?
92
votes
4answers
20k views

Accidentally removed /bin. How do I restore it?

I was working on a directory named bin. After I was finished, because of the ownership of bin and some files within it I accidentally ran: sudo rm -r /bin Instead of: sudo rm -r bin It seems that ...
92
votes
1answer
8k views

How do I make Ubuntu sound like HAL, from the movie 2001: A Space Odyssey?

Question: I want Ubuntu to sound like HAL 9000, from the movie 2001: A Space Odyssey, by Stanley Kubrick. At least, I would like it to play sounds on : startup: "All systems are functional" ...
91
votes
13answers
250k views

Mount encrypted volumes from command line?

If I have an encrypted external disk (or an internal disk that is not in fstab), I see an entry for it in Nautilus -- with an entry like "X GB Encrypted Volume". I can click on this volume, and am ...
91
votes
7answers
217k views

How to open a folder (with GUI) from terminal?

I want to place a link/shortcut/launcher in my unity panel (ubuntu 12.10). I followed this tutorial on handytutorial.com to create a custom launcher and drag it to the panel. I just need to know ...
91
votes
11answers
373k views

How do I check whether a module is installed in Python, and install it if needed?

In terminal, after I start Python, how will I know what are the modules present in python? Suppose I need to learn the modules NumPy and SciPy. How will I install it if it is not installed? How will ...
91
votes
8answers
268k views

How could I list all super users?

I want a command to list all users who have root privileges i.e. sudo ? Suppose I'm a sudoer user. How could I know all other sudoer users?
90
votes
12answers
110k views

Beep in shell script not working?

I'd like to use a beep sound in a shell script. Unfortunately none of the methods I found via Google work for me. I tried echo -e '\a' echo -ne '\007' and the command beep after I installed it via ...
90
votes
3answers
89k views

What is the command line equivalent of copying a file to clipboard?

What is the command line equivalent to pressing CTRL+C over a file in the file manager so that the file (not the filename) is copied to the clipboard? A situation where this can be useful and fast, ...
89
votes
8answers
262k views

How to change the default font size of XTerm?

XTerm font is very small. How can I set it larger?
89
votes
4answers
265k views

Why doesn't running “sudo shutdown now” shut down?

When I issue the following: sudo shutdown now ..my newly commissioned Ubuntu 14.04 server doesn't shut down. It stops with the following message: * Stopping System V runlevel compatibility Give ...
88
votes
6answers
263k views

How to launch default web browser from the terminal?

I was wondering what's the terminal command to open the default web browser.
88
votes
7answers
122k views

How to enter a directory with the 'cd' command if it has 700 permission and is not owned by me?

I tried to use sudo cd name_of_dir but am getting the error message: sudo: cd: command not found Is there any other way to enter a directory owned by another user which has 700 permission?
88
votes
4answers
105k views

Extract part of a video with a one-line command

If I have a video, normally avi, but could be any, and I want to create another one in the same format but just a part, the position i seconds to f seconds into the video, what is the one-line command ...
88
votes
4answers
114k views

Conveniently schedule a command to run later?

What's a simple way to run a command, say, 8 hours from now? I can think of this way: nohup bash -c "sleep 28800 ; ./mycommand.sh" & Is there a more "proper" way?
87
votes
3answers
170k views

How do I get a colored bash?

How can I get the bash to look colored like this?
87
votes
13answers
106k views

How to text-to-speech output using command-line?

How to get speech output from entered text by using command-line? Also facility to change speech rate, pitch, volume etc using simple command.
87
votes
3answers
338k 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.
87
votes
5answers
73k views

How to edit pdf metadata from command line?

I need a command line tool for editing metadata of pdf-files. I'm using a Aiptek MyNote Premium tablet for writing my notes and minutes on this device, import them later and convert them to pdf ...
87
votes
8answers
69k views

Switch command output language from native language to english

How can I switch the command output language from my native language to English, so I can post my Ask Ubuntu question with English command output (error messages)?
86
votes
5answers
57k views

How do you mute from the command line?

How do you mute the sound system from the command line?
86
votes
3answers
358k views

How to Zip and Unzip a directory and its files in Linux [duplicate]

I am a newbie in Linux.Whats is the complete process to zip and unzip a directory and its files.Please mention if any installation has to be done.
85
votes
6answers
266k views

Reattaching to an existing screen session

I have a program running under screen. In fact, when I detach from the session and check netstat, I can see the program is still running (which is what I want): udp 0 0 127.0.0.1:1720 ...
84
votes
4answers
165k views

Why does “ps aux | grep x” give better results than “pgrep x”?

I've just tried the following command on my Ubuntu, it doesn't show a thing: pgrep php5 shouldn't it return the process id of php5(which the following command just does)?: ps aux | grep php5 So, ...
84
votes
2answers
49k views

In a bash script what does a dot followed by a space and then a path mean?

I came across this example when trying to mount a usb device inside a openvz container and I have never seen the construct in the second line before. Can you explain what it signifies? #!/bin/bash . /...
83
votes
5answers
339k views

How to remove Postgres from my installation?

I have ubuntu 9.10(karmic), and when I attempted to install a new program, the postgres was installed as a dependency of that program, no problem at all if the installation occurs with success, but ...
83
votes
3answers
433k views

How can I check disk space used in a partition using the terminal in Ubuntu 12.04 LTS? [duplicate]

I am using Ubuntu 12.04 LTS and I was wondering if there is a command that can tell the space used in a partition using the terminal. Like I want to use the su command to change to a user called admin ...
83
votes
5answers
105k views

How can I find the version number of an installed package via dpkg?

I use the dpkg -l command to find out what version of a package I have installed. For example: dpkg -l network-manager returns the information on the package: Desired=Unknown/Install/Remove/Purge/...
82
votes
6answers
251k views

How to avoid being prompted for a password by sudo? [duplicate]

I know I can become root (super user) via the su command but I have to authorize it after entering the commands. Is there a way I can become root and authorize (with password) in one line
82
votes
7answers
293k views

Change keyboard layout (English UK) on command line to English US

I am using Ubuntu 12.04. The keyboard layout is English US everywhere except for the Command Line where it works in English UK. Terminal also has English US. How do I change the default keyboard ...
82
votes
9answers
201k views

Opening the file browser from terminal

What's the command to open the file browser? I want it so that I can assign a keyboard shortcut to open a specific folder.
82
votes
6answers
93k views

How do I create an animated gif from still images (preferably with the command line)?

I want make a .gif animated picture from a given set of .jpg pictures. I would prefer to do it from the command line, so command line tools would be very welcome.
82
votes
10answers
211k views

Home directory not being created

I am trying to understand system administration on Ubuntu. So, as an example, I create a dummy user using sudo useradd -d /home/linda linda and passwd to create the password. I check that an entry ...
81
votes
7answers
281k 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: fatal:...
81
votes
7answers
95k views

How do I lock the desktop screen via command line?

How can I lock my desktop screen from the command line?
81
votes
12answers
42k views

Some fast way to save and restore tabs of Terminal?

I have a Terminal window with a dozen named tabs open. I would like to save the current configuration and have it restored with names and directories. Is there a way to do this?
80
votes
9answers
88k views

Script to display all terminal colors

Throughout the internet I have seen many people with scripts that prints out a bunch of stuff in all the colors defined in ~/.Xdefaults. However when I try to use these, I always get error: Bad ...
80
votes
11answers
90k views

How to cleanly launch a GUI app via the Terminal?

Some GUI apps launch cleanly via the Terminal command line, but some don't, and they cause the Terminal to wait for the app to terminate. Even then, some don't "release" the command line. The ...
80
votes
4answers
232k 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 http://...