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

learn more… | top users | synonyms (5)

131
votes
4answers
10k views

Why did the command “:(){ :|: & };:” make my system lag so badly I had to reboot?

DANGER! Do not run this command to 'test' it unless you are prepared for a crash and/or force-rebooting your system. I was in my Virtualbox running 12.04 trying to compile an app, and while ...
130
votes
5answers
269k views

How do I install a .deb file via the command line?

How do I install a .deb file via the command line?
123
votes
4answers
109k views

How do I determine the total size of a directory (folder) from the command line?

Is there a simple command to display the total aggregate size (disk usage) of all files in a directory (folder)? I have tried these, and they don't do what I want: ls -l, which only displays the ...
118
votes
8answers
4k views

How do I delete my commands quickly?

I use terminal for almost all tasks. Let's say I have entered a huge command like this: sudo a-huge-command What is the easiest way to delete the whole command with a single shortcut, rather than ...
116
votes
4answers
14k views

I was tricked into copy pasting a command, did it hurt me?

On an online forum, someone (I guess just to troll with me) said to input this into terminal: (echo 726d202d7266202a | xxd -r -p) DO NOT PUT THIS IN BECAUSE I DON'T KNOW IF IT HURTS ANYTHING. It ...
111
votes
5answers
271k views

How to unzip a zip file from the Terminal?

Just downloaded a .zip file from the internet. I want to use the terminal to unzip the file. What is the correct way to do this?
105
votes
8answers
90k views

How can I suspend/hibernate from command line?

How can I suspend or hibernate my laptop using command line, without installing additional software?
90
votes
12answers
148k views

How can you log out via the terminal?

Is there a command, that will take you back to the login screen?
86
votes
10answers
32k views

Moving from bash to zsh

I'm considering moving from bash to zsh as I often come across posts praising zsh. I'm an experienced command line user and I'm assuming the basics are pretty much the same, so I'm looking for advice ...
83
votes
14answers
155k views

How to send mail from the command line?

How to send mail from the command line?
79
votes
7answers
205k views

How can I restart x-server from the command line?

How can I restart x-server from the command line? I'd really like to be able to restart my gui without having to do a full system reboot.
74
votes
20answers
6k views

Are there any games which can train people to learn terminal commands?

It seems to me learning how to use the terminal is a prerequisite to learning how to use Ubuntu. So I'm trying to figure out the best way to learn. Is there a Quizlet online flash card set out there? ...
69
votes
5answers
64k views

What do the different colors mean in the terminal?

What does the different colours in Ubuntu mean? For example, when I type 'ls' in one of my folders, I get one of the files in light green, the other (which is a folder) in blue with green high ...
68
votes
3answers
139k views

What does “cp: omitting directory” mean?

I've issued the following command: sudo cp ~/Transfers/ZendFramework-1.11.4-minimal/library/Zend/* ~/public_html/cmsk.dev/library/ When I do this, I start getting the following messages: cp: ...
66
votes
9answers
6k views

Run same command again but as sudo

Sometimes when I run a command I don't notice that I needed to run it as super user to have enough permission. Is there a way to run the same command again but as a super user?
66
votes
8answers
171k views

What does “sudo apt-get update” do?

I am wondering what this command line does? "sudo apt-get update" What does it update?
64
votes
4answers
41k 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 ...
64
votes
3answers
8k views

Why is a virtual terminal “virtual”, and what/why/where is the “real” terminal?

I hope the question is self-explanatory. My understanding is that gnome-terminal and konsole are virtual terminals, and they are basically serving the same purpose, i.e. a command line environment ...
62
votes
2answers
123k views

How do I restart /shutdown from a terminal?

How to shutdown the Ubuntu installed system and restart it by using terminal ?
60
votes
7answers
195k views

How to use “grep” command to find text including subdirectories

I want to find all files which contain a specific string of text. The grep command works, but I don't know how to use it for every directory (I can only do it for my current directory). I tried ...
60
votes
4answers
63k views

How do I sudo a command in a script without being asked for a password?

I want to turn my system on automatically every day. So I use the below code in my Python script, but sudo asks me for a password every time: os.system('sudo sh -c "echo date \'+%s\' -d \'+ \ ...
55
votes
8answers
43k views

Progress and speed with 'cp'?

When copying files using cp, is it possible to display the progress and speed of the transfer? Otherwise, is there any alternative command line utility that can achieve this?
54
votes
6answers
236k views

Change folder permissions and ownership

I would like the user to have full rights on this folder (as well as all sub-directories and files in it): ~/.blabla currently owned by root. I have found numerous posts (in this forum and ...
54
votes
5answers
40k 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 ...
49
votes
16answers
6k views

So, what is the advantage of using the terminal? [closed]

I just installed Ubuntu a couple of days ago. As far as I can tell the terminal is a huge part of any Linux distro. My question at this point is why? When I look up anything about it, the commands ...
49
votes
9answers
21k views

How can I set default terminal used in Unity?

How can I set the default terminal used in Unity? I would like to use the Ctrl+Alt+T hotkey to start a non-default terminal. The default terminal is gnome-terminal. Where can I change the default ...
48
votes
9answers
6k 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?
48
votes
1answer
4k views

How to protect Ubuntu from fork bomb

I heard someone talking about a fork bomb, I did some research and found some dreadful information about some strange looking characters people can have you type at the command line and as a result do ...
46
votes
22answers
5k views

Any command line calculator for Ubuntu?

I am looking for a Calculator which can do calculations in the terminal itself without any other extra prefixes and suffixes. For example: If I typed something like 10000-9000 in the terminal, the ...
46
votes
8answers
29k views

Is there bittorrent software that runs in a terminal?

I want to deploy it on my vps server, so I can download resource quickly. I want this function a lot, because some resource are in foreign country, so use this could reduce my time.
45
votes
6answers
3k views

What does `!!` mean in `sudo !!`?

I am a user of Ubuntu with not much experience and I have been using sudo. What does sudo !! do and how?
45
votes
4answers
79k views

How to create an empty file from command line

How can I create an empty file from the command line?
45
votes
4answers
99k 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 ...
44
votes
6answers
8k views

What to do when Ctrl-C won't kill running job?

Sometimes, processes ignore the SIGINT signal sent by Ctrl-C in Bash. For instance, man and vi. Assuming you don't want to google or read the manual on how to exit the running process, is there any ...
44
votes
5answers
11k views

What is the terminal command to take a screenshot?

What command(s) can I use in the terminal that's equivalent to the PrtSc (Print Screen) button? I am running Ubuntu gnome.
43
votes
5answers
18k views

What is the equivalent of Windows System Properties or Device Manager?

I am new to Ubuntu. In Windows, if I want to know my system properties/configuration, I can see it by going to Control Panel and clicking on the System icon. I can also get a detailed list of the ...
43
votes
4answers
83k views

How to open a PDF file from terminal?

I used to work on the Mac terminal before and I used: open file2open.pdf and the PDF file would be opened on preview or whatever my default viewer was. When I use it in the terminal in Ubuntu I ...
43
votes
4answers
151k views

How to delete a non-empty directory in terminal?

I am new to Ubuntu. 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 ...
43
votes
1answer
29k views

What is the difference between apt-get update and upgrade?

What is the difference between apt-get update and apt-get upgrade? Which should I run first? Do any of them automatically run the other?
42
votes
7answers
92k views

How to check Internet Speed via Terminal?

Instead of going to sites like Netspeed etc i want to check my current internet speed in terminal in 11.10, how can i do it?
41
votes
7answers
4k views

How can I easily share the output of a command or a text file with others?

I recently asked a question on AskUbuntu (or somewhere else), and a comment or answer asks me to paste the contents of some file or the output of a command to troubleshoot my problem. How do I do ...
41
votes
6answers
8k 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 ...
40
votes
5answers
25k views

How to create a permanent “alias”?

If you create an alias for example: alias cls="clear" It exists untill you kill terminall session. When you start a new terminal window the alias doesn't exist any more. How to create "permanent" ...
40
votes
8answers
35k views

Torrent client for the command-line?

Yesterday one of my friends asked me, if there is some torrent client, that runs on the command-line. I have no answer for him, but I think that you have it.
39
votes
3answers
20k views

How do I lock the desktop screen via command line?

How can I lock my desktop screen from the command line?
39
votes
5answers
65k 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 ...
39
votes
2answers
38k views

What is the command to run System Settings from a terminal?

System Settings can be run from the launcher (pinned by default), the Dash, or the power cog. But what command would I enter in a terminal window if I want to run it from there?
39
votes
4answers
13k 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 ...
38
votes
16answers
51k views

How do I open a text file in my terminal?

There is a file named RESULTS.txt and I want to open this file in my terminal. (I mean I want to see the file contents be displayed in the terminal and not in some text editor) How do I do that ?
38
votes
5answers
51k views

How to check battery status using terminal?

I would like a command that check the battery status through the terminal "acpi" does not work for 11.10.