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

learn more… | top users | synonyms (6)

70
votes
3answers
291k views

How to make a file (e.g. a .sh script) executable, so it can be ran from terminal

I have a script.sh file and type of this file is shellscript file. I want to make this file as application/x-executable file. How can I make it?
66
votes
7answers
108k views

How to add Android Studio to the launcher?

I'm trying to install the android studio so that I can launch it from a launcher instead of via terminal. Android Studio -> Tools -> Create Desktop Entry doesn't do antything Can someone give ...
24
votes
5answers
38k views

Environment variables when run with 'sudo'

As example to my question, my ~/.bashrc file contains this lines: export LD_LIBRARY_PATH=/opt/intel/mkl/lib/ia32:$LD_LIBRARY_PATH export LD_PRELOAD=/opt/intel/mkl/lib/ia32/libmkl_core.so so that ...
28
votes
8answers
3k views

How to make a package manager wait if another instance of APT is running?

I have seen many softwares such as Update Manager and Synaptic Package Manager, they wait if some other program is using the /var/lib/dpkg/lock and is locked. How can we do this through the Terminal? ...
15
votes
2answers
47k views

Bluetooth from the command line in 12.04?

I've been trying to pair up my bluetooth keyboard with my computer after reinstalling from a standard ubuntu 12.04 to a minimal install. In the minimal install I have no gui, so I've been trying to ...
55
votes
6answers
109k views

How do I download and install Handbrake?

I'm new at Ubuntu so I don't know very well how to use the terminal in order to download and install programs that aren't in the software center. I've tried without success downloading and installing ...
19
votes
5answers
5k views

How to determine the size of a package while using apt prior to downloading?

When using apt-get install <package_name>, and there are dependencies that need to be downloaded, the terminal outputs names of additional packages and total size, and asks for confirmation ...
12
votes
3answers
25k views

How do I make the terminal run python 3.1?

Currently, when I type "python" at the terminal I get v2.6 which is all fine and dandy but how can I set it to use v3.1 instead? Is there a "path" variable out there somewhere that I can change like ...
7
votes
1answer
6k views

Ubuntu Touch using apt-get

I'm sorry if this has already been asked, I did do some searching and didn't find it. However a number of questions, I have just installed the latest Ubuntu touch, on a nexus 5, and was going to have ...
5
votes
3answers
1k views

Are there any tutorials and books to get accustomed to the terminal? [closed]

I want to use my Ubuntu computer with text-based system. But I can find only some tutorials. I need more tutorials and books.
14
votes
6answers
31k views

How to add an alias to a command in terminal?

By typing a manually specified command in terminal i want to do some. How could add an alias to a command? Can i do that with the help of the terminal or should i edit some kind of file?
4
votes
2answers
3k views

What does 'ls -la' do?

When I entered the -al attribute with the ls command, I got the following: anupam@JAZZ:~/blog$ ls -al total 76 drwxrwxr-x 13 anupam anupam 4096 Aug 28 21:45 . drwxr-xr-x 34 anupam anupam 4096 Aug 28 ...
4
votes
2answers
10k views

Won't execute terminal commands

I have been using Ubuntu 12.04 for quite a while and have never had a problem come at me out of the blue like this. I'm trying to install python 3.2 on my Ubuntu system and every time I run the code ...
273
votes
7answers
838k views

A command to list all users? And how to add, delete, modify users?

I need a command to list all users in terminal. And how to add, delete, modify users from terminal. That could help in administrating your accounts easily by terminal.
195
votes
5answers
488k views

How can I copy the contents of a folder to another folder in a different directory using terminal?

I am trying to copy the contents of a folder to another folder in a different directory using terminal. Would somebody be able to provide me an example of the command line syntax required to achieve ...
138
votes
12answers
283k views

How to check Internet Speed via Terminal?

Instead of going to sites like speedtest.net, or others, I want to check my current Internet speed from the terminal on Ubuntu. How can I do it?
101
votes
10answers
47k views

What is the difference between Terminal, Console, Shell, and Command Line?

What is the difference between Terminal, Console, Shell, and Command Line?
90
votes
6answers
114k views

How can I get a list of all repositories and PPAs from the command line into an install script?

I know how to list all packages installed on my system. But how could I get a list of all repositories and PPA's? I know I can look into /etc/apt/sources.list and /etc/apt/sources.list.d, but I'm ...
178
votes
11answers
189k views

How to really clear the terminal?

I can issue the clear command or press Ctrl + L to clear the current Ubuntu terminal, but this just shifts previous output upwards and if you use mouse scroll or PgUP and PgDown keys it's hard to ...
90
votes
7answers
263k views

Command-line to list DNS servers used by my system

Is there a command to list dns servers used by my system? I tried $ cat /etc/resolv.conf # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8) # DO NOT EDIT THIS FILE ...
50
votes
4answers
58k views

How to list dependent packages (reverse dependencies)? [duplicate]

In order to research what caused the installation of a given package, I'd like to get a list of packages which depend on that package. I couldn't find anything obvious in man dpkg.
38
votes
3answers
365k views

How to start GUI from command line?

I've installed the following version of ubuntu om my machine. ubuntu-12.04-desktop-i386.iso But when I switch on the computer, I get command line. Ubuntu 12.04 LTS COMP-1245 tty1 Once I ...
35
votes
2answers
34k views

How do I disable the blank console “screensaver” on Ubuntu Server?

How to disable blank screensaver on Ubuntu Server? There's no desktop or X, only console (command-line interface).
21
votes
2answers
29k views

How can I create a custom terminal command (to run a script)?

I'm a web developer. When I want to start working, always i'm executing some command on terminal. For example: sudo service apache2 start sudo service mysql start sublime For speed up this process, ...
19
votes
1answer
5k views

How to configure pkexec?

Reading these questions and answers: When to use pkexec vs. gksu/gksudo? Why is gksu no longer installed by default? brought me another one that will create problems for new users of that ...
18
votes
2answers
120k views

Terminal method of formatting storage drive

I want to know how to format a storage drive from the terminal. Helpful things to provide in the answer would be often used options for commands and base knowledge that one can use to extrapolate ...
22
votes
5answers
22k views

trim the terminal command prompt working directory

When using the terminal in a deep folder structure sometimes the prompt can take up most of the line. Is there any way in which I can trim the working directory? I know I can do PS1="\W >" to ...
32
votes
6answers
190k views

How can I execute a .jar file from the terminal

I know that to execute a file, I use the . command, then the file name with a space between them. But I'm trying to execute a .jar file using the . and it does not work. I went into the properties and ...
40
votes
7answers
17k views

Make a sound once process is complete

I have started a long process through a terminal. Is it possible to make the Ubuntu terminal make a sound once the process is complete? This way, I don’t need to keep checking, but will instead be ...
21
votes
4answers
16k views

Why is moving directories to /dev/null dangerous?

When trying to move a test_dir directory to /dev/null, I get the message mv: cannot overwrite non-directory ‘/dev/null’ with directory ‘test_dir/’ Then why do people say "Don't run the command sudo ...
18
votes
3answers
23k views

How can I (from CLI) assign multiple IP addresses to one interface?

On my server I want to assign several IP addresses to one NIC, but without using the deprecated ifconfig or the obsolete "alias" notation (like eth0:0) in /etc/network/interfaces because in IP ...
11
votes
1answer
18k views

How to run a command at login? [duplicate]

I need to run the following command (with real parameters) after login: ssh -f user@example.com -L 54321:example.com:54321 -N I need it only for my user, not all users on the machine. Also, I need ...
12
votes
3answers
14k views

How do I add a repository from behind a proxy?

Hi I've a problem at the office. We're behind a proxy (which is set and applied at ubuntu proxy settings) and when I try to add a repository from terminal, I get: Error reading --some url here--: ...
28
votes
6answers
36k views

How do I change directory to a folder with special characters?

I am using Ubuntu 11.10 and in terminal I want to enter the following folder: cd Milano, Torino (Jan)-Compressed And it does not work! How should I write the command cd to enter this directory?
22
votes
5answers
12k views

In the output of 'ls -n', what does the the second column mean?

When I run: ls -n I get something like: -rwxrwxrwx 1 1000 1000 765528 2009-10-15 18:41 file1 drwxr-xr-x 10 1000 1000 4096 2010-12-07 20:50 dir1 drwxr-xr-x 3 1000 1000 4096 2010-10-24 ...
12
votes
3answers
3k views

What does $PATH mean?

I am trying to install something and among the steps there was this one: "Place it on your $PATH" What does this mean? What is that? I have searched both this site and on Google but everyone just ...
9
votes
1answer
3k views

Why is pkexec preferred over gksudo for graphical applications?

Please provide Ubuntu documentation that refutes this: https://help.ubuntu.com/community/RootSudo Why, on my fully updated 13.04 system, does pkexec not function? $ pkexec gedit somefile.txt No ...
19
votes
3answers
8k views

“♦: command not found” in tty after login

I have this problem after upgrade Lubuntu from 12.10 to 13.04. I press Ctrl + Alt + 1, enter login, password, wait two seconds and get: ♦: command not found". After this message I can type commands ...
294
votes
5answers
1.5m views

How to delete a non-empty directory in Terminal?

How do I delete the following directory? I typed: rmdir lampp This error comes up: rmdir: failed to remove `lampp': Directory not empty Is there a command to delete all the files in the ...
136
votes
1answer
91k views

Differences between /bin, /sbin, /usr/bin, /usr/sbin, /usr/local/bin, /usr/local/sbin [duplicate]

I'm running an Ubuntu Server 13.04, but I see the same on a 12.04: I have six directories with command files. These are: /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin What are the ...
124
votes
6answers
189k views

How to list all variables names and their current values?

Including not only $HOME, $PWD etc but any other you have defined.
49
votes
6answers
20k views

What is the difference between ./ and sh to run a script?

I have written a simple script. When I runsh <myscriptname.sh>, i got the correct output, but when I run ./<myscriptname.sh>, I got an error. What is difference between when I do sh and ...
53
votes
3answers
84k 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 ...
32
votes
7answers
69k 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 ...
49
votes
4answers
42k views

How can I tell if my system was booted as EFI/UEFI or BIOS?

How do I determine whether a particular running Ubuntu system was booted using EFI/UEFI, or BIOS?
28
votes
3answers
7k views

Where should I put my script so that I can run it by a direct command?

Where can (should) I put my (bash) script so that it can be used (forever) by terminal or by a direct command: Alt+F2? I know there is /usr/bin and /sbin & /bindirectories but when should I use ...
32
votes
1answer
13k views

How do I pipe terminal standard output (stdout) to the clipboard?

For example, Say I want to list the contents of a folder and directly paste them into a chat window for a friend to see. I realize I could do ls > filename.txt to create a file (filename.txt) ...
32
votes
5answers
15k views

How can I change the default text editor from gedit to vim?

How can I change the default text editor from gedit to vim? When I click on a text file, I want it to open in vim under the terminal instead of gedit.
25
votes
4answers
4k views

Why wouldn't the `which` command work for `cd`? I can't find the executable for `cd` either!

I tried which cd and it didn't give a path but instead returned the exit code 1 (checked with echo $?). The coreutil cd itself is working, so the executable should be there, right? I also ran a find ...
15
votes
0answers
12k views

Command to know my external IP address? [duplicate]

How can I get my external IP address using the Command Line?