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

learn more… | top users | synonyms (5)

19
votes
7answers
12k views

How do I toggle sound with amixer?

Including Natty I was always able to toggle (mute/unmute) the 'Master' sound volume with the amixer sset Master toggle command that I linked to an edge binding in CompizConfig-Manager. Now after ...
19
votes
3answers
3k views

How to find the number of packages needing update from the command line?

I'm working on some system admin automation using fabric and I'd like to be able to monitor the number of packages that need upgrading on a given machine. This is the same information that I can see ...
19
votes
3answers
5k views

Switch terminal output language from native language to english

How can I switch the terminal output language from my native language to English, so I can post my Ask Ubuntu question with English terminal output (error messages)?
18
votes
9answers
123k views

How do I run .sh files in Terminal?

Whenever I open a .sh file, it opens it in gedit instead of the terminal. I can't find any option similar to Right Click → Open With → Other Application... → Terminal. How do I open this file in the ...
18
votes
5answers
1k views

How to both display a command line's output on console and save the output into a text file?

How can I run sudo apt-get install by BOTH seeing the process of installation (long in my case) and saving its output into a text file ?
18
votes
5answers
2k views

Unable to remove a file which have a name like a command argument

By inadvertance, I've created a file called -r into my home directory. Now I cannot get rid of it: rm -rf rm: missing operand Try 'rm --help' for more information. Other try: rm /-/r rm: cannot ...
18
votes
5answers
5k views

How to open a file manager of the current directory in the terminal?

When I work in terminal, sometimes I want to open the current directory in a GUI file manager. And then to click the items in the window to run the application. How can I do this?
18
votes
3answers
5k views

Is this command to remove old kernels safe to use?

While browsing the internet for Ubuntu articles, I came across this command: sudo dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ...
18
votes
5answers
848 views

What are shells?

What's a shell, their importance, types and functions?
18
votes
2answers
11k views

How to grep 2 or 3 lines, one containing the text I want, and the others just below it?

This is a snapshot of error log: 06:16:29,933 ERROR EmailRMManager$:45 - Exception In get Message com.rabbitmq.client.AlreadyClosedException: clean connection shutdown; reason: Attempt to use closed ...
18
votes
3answers
12k 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 ...
18
votes
3answers
946 views

iPython Like Command History For Shell

For those of you who don't do python programming on ubuntu, ipython is a python shell on steroids, but it has this amazing feature that it not only autcompletes based on known names (i.e. the same way ...
18
votes
1answer
5k views

What can I use instead of gnome-open?

What is a current replacement of 'gnome-open' command (generic open of files based on the type)? Before: gnome-open mydoc.pdf # opened PDF in default application Now: gnome-open The program ...
18
votes
3answers
3k 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 ...
18
votes
4answers
2k views

CLI mounting vs. GUI mounting

On Ubuntu 12.10, when I want to mount a hard drive, I can just click on the unmounted drive and everything works fine (by mounting to /media/username/partitionlabel). Basically, I would like to do ...
18
votes
2answers
2k views

How does Middle Click paste work?

I don't understand the middle click paste. Sometimes I highlight text, middle click in the window where I want it to go and it does what I want. Sometimes it doesn't. For instance, when I highlight ...
18
votes
5answers
4k views

Where are shell/terminal settings stored?

i updated my ubuntu but it crashed during installation and i was not able to recover it (my hard drive crashed). i changed my hard drive and re-install ubuntu i saved all my important docs (bookmark, ...
18
votes
2answers
6k views

What does “%U” mean when calling a command?

When editing the Applications menu, I see for some applications, their commands have “%U” such as "gedit %U" and "gnome-mplayer %U", but others don't such as "gcalctool". I was wondering What“%U” ...
18
votes
2answers
15k views

youtube-dl is not working

I am using youtube-dl to download some videos from youtube. But when I write: youtube-dl http://www.youtube.com/watch?v=rn_YodiJO6k I get: [youtube] Setting language [youtube] rn_YodiJO6k: ...
18
votes
1answer
35k views

How do I change the language via a terminal?

Using system settings I changed my language to Arabic and deleted the English language from the settings. Then the computer lagged and it logged out - now I can't log back in because the login is in ...
18
votes
3answers
850 views

Why is the default virtual terminal number 7?

Why is the default virtual terminal in ubuntu tty7? is there any sort of precedent for this, or was that just the number that first came to mind?
17
votes
3answers
2k views

Why doesn't “cd” work in a shell script?

What is wrong with this easy script? I just want to write an script which change my directory: A. I put below commands on the file witch its name is pathABC on the /home/alex directory, #!/bin/sh cd ...
17
votes
4answers
12k views

How do I download the command-line emacs instead of the GUI one?

I used sudo apt-get install emacs to download emacs. I expected the command-line emacs to start when I ran emacs but instead the GUI emacs started. How can I download the command-line emacs?
17
votes
2answers
1k views

is there any significance to using tee

Why is it that almost all instructions regarding appending text to system files like fstab and /etc/apt/sources.list.d/<name>.list involve using tee and echo to append said text? Take the ...
17
votes
9answers
38k views

How to remove all files and subdirectories in a directory WITHOUT deleting the directory in bash?

Is there a command to remove all files and subdirectories in a directory WITHOUT deleting the directory? For example if I have directory "dontDeleteMe" with subdirectories "1", "2", "3" and each ...
17
votes
6answers
10k views

Command to see media file info in terminal?

I need a command to quickly see in terminal essential information about an audio or video file. (Then I'll consider adding that to Thunar's custom actions, etc.)
17
votes
7answers
35k views

Find number of files in folder and sub folders?

I want to find the total count of the number of files under a folder and all its sub folders.
17
votes
2answers
8k views

What do the various dpkg flags like 'ii' 'rc' mean?

I frequently need to check which packages are installed, and I use the following command: dpkg -l | grep foo which gives the following output Desired=Unknown/Install/Remove/Purge/Hold | ...
17
votes
3answers
13k views

Command to open a URL?

My question is pretty simple: Is there a command I can use in bash that will open a specific URL in the default browser?
17
votes
8answers
18k views

How does one find out the command line corresponding to GUI app (eg, LibreOffice Writer)?

How can I run LibreOffice Writer from the command line? Basically, what is its command and how do I get to know what's the command to run a particular application in general?
17
votes
2answers
3k views

How to “show desktop” from command line?

I want to be able to lower all windows and show the desktop from the command line, not Ctrl+Alt+D.
17
votes
1answer
12k views

How can I find out what RAM a computer system has?

I'm looking for a way to find out what kind of RAM a system has (clocking speed, DDR-X etc.). Is there a specific command for that? I'm only aware of free or lspci which don't offer those things.
17
votes
5answers
18k views

How can I logout from the GUI using CLI?

I chose an Openbox DE at the time of login and the system took ages to load the DE. So I switched to CLI (Ctrl+Alt+F1) and rebooted my system (but I wanted to logout from the GUI and not restart the ...
17
votes
3answers
3k views

How do file permissions work?

Can you explain briefly the main concepts and command line tools used to manage file permissions?
17
votes
2answers
747 views

How to change number of workspaces from command line?

I'd like to change org.compiz.profiles.unity.plugins.core -> hsize and -> vsize from command line. I thought I could use gsettings set org.compiz.profiles.unity.plugins.core vsize 4 but then ...
17
votes
7answers
36k views

Create USB installer from the command line?

I'm trying to create a bootable USB image to install Ubuntu on a new computer. I have done this before following the "create USB drive" instructions for Ubuntu desktop, but I don't have an Ubuntu ...
17
votes
2answers
11k 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).
17
votes
1answer
3k views

How to programmatically swap the caps lock and esc keys?

I am a heavy Vim user and one of the first things I do when I start working on a clean ubuntu installation is to swap the caps lock and esc keys to reduce hand movements over the keyboard. So far I ...
17
votes
2answers
10k views

How can I hibernate/suspend from the command line and do so at a specific time and a relative time?

Ok,I managed to find out how to suspend/hibernate the system from the command line by reading How can I suspend/hibernate from command line?. However, I would like to know how to use the command line ...
17
votes
3answers
904 views

How can I initiate Nautilus file operations from the command line?

How can I start Nautilus's "File Operations" GUI from the command line? My goal is to include this in a Nautilus script.
16
votes
5answers
34k views

How can I make a script that opens terminal windows and executes commands in them?

I have three scripts I need to run when I start up my Ubuntu machine, they start services I use in my development environment. To do that, I manually open three terminals and type in the commands. ...
16
votes
7answers
7k views

Is there a command that returns network utilization?

I need a command that I can run that returns the current utilization of wlan0. Does such a tool exist? I would prefer something that doesn't require root privileges.
16
votes
2answers
2k views

what does “{} \;” mean in linux command

Sometimes I see command find . -name  * -exec ls -a {} \; I was asked this to execute. what does {} \; means here?
16
votes
9answers
3k views

Command line games

Does anyone know if there are games for Ubuntu server (like tetris, etc...)? I know that servers aren't meant for playing games, but sometimes it would be nice to have a little fun . . . not only ...
16
votes
4answers
5k views

How do I install KDE?

I want to have both KDE and Gnome shells on Ubuntu. Ubuntu has Gnome by default. How do I install KDE?
16
votes
6answers
29k views

What terminal-based network speed tests are available?

I'm looking to find a way to test my internet speed at home through ssh. Does anyone know a terminal app that can give me calculations similar info to speedtest.net? It would also be really cool ...
16
votes
3answers
3k views

How do I search a PDF file from command line?

I'm checking references of a paper and want to find the positions in the body where some paper (in the references list) is referenced. Is there a PDF editor which supports search via bash and extract ...
16
votes
1answer
13k 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 ...
16
votes
1answer
177k views

How to copy files via terminal?

I have read about copying files with terminal but these examples will help me a lot. So here is what I want to do: Examples: I have a file in /home/levan/kdenlive untitelds.mpg and I want to copy ...
16
votes
3answers
164k 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 ...