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

learn more… | top users | synonyms (6)

584
votes
7answers
1.6m views

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

How do I install a .deb file via the command line?
541
votes
7answers
1.7m 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?
497
votes
6answers
1.6m views

How can I add a new user as sudoer using the command line?

After I add a user using adduser, I can't see it via System->Administration->Users and Groups unless I logout and then login again. Is that normal? Also, can I set a newly added user as a ...
394
votes
9answers
363k 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 ...
394
votes
6answers
1.1m views

How do I shut down or reboot from a terminal?

How can I shut down or reboot Ubuntu using terminal commands?
306
votes
5answers
1.6m 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 ...
298
votes
8answers
886k views

How to install updates via command line?

When I log into my web server via SSH I see the information: 88 packages can be updated. 80 updates are security updates I tried apt-get update then apt-get upgrade but each time I log in I still ...
292
votes
7answers
911k 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.
276
votes
17answers
403k views

How do I fix my locale issue?

I am getting this message every time I do something like starting or stopping a service. perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: ...
275
votes
9answers
637k views

What does “sudo apt-get update” do?

I am wondering what sudo apt-get update does? What does it update?
234
votes
7answers
491k views

What is the correct way to completely remove an application?

I've searched the net for such information and found different command lines, like these ones: sudo apt-get remove application sudo apt-get remove application* sudo apt-get remove --purge ...
212
votes
5answers
937k views

How do I rename a directory via the command line?

I have got the directory /home/user/oldname and I want to rename it to /home/user/newname. How can I do this in a terminal?
212
votes
2answers
426k views

How do I search for available packages from the command-line?

I have successfully installed some packages using the command line 'sudo apt-get install ...' when I have known in advance that those packages are available. But how can I search for or get a list of ...
209
votes
11answers
241k views

How can I suspend/hibernate from command line?

How can I suspend or hibernate my laptop using command line, without installing additional software?
204
votes
5answers
521k 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 ...
203
votes
10answers
12k views

Terminal 'incognito mode'?

I use Terminal a lot, and sometimes I am running commands, which aren't things I don't want others to see, but more commands that if I accidentally arrowed up to and accidentally executed would cause ...
198
votes
5answers
1.0m 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 ...
197
votes
6answers
21k views

How can I make my shell prompt look like a cheeseburger?

I want my shell prompt to look like a cheeseburger! 🍔🍔🍔 It would be nice if it also displayed: username, hostname, and current directory.
182
votes
4answers
81k 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 ...
182
votes
11answers
201k 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 ...
179
votes
6answers
214k views

How can I recursively delete all files of a specific extension in the current directory?

How do I safely delete all files with a specific extension (e.g. .bak) from current directory and all subfolders using one command-line? Simply, I'm afraid to use rm since I used it wrong once and now ...
178
votes
6answers
140k views

How can I install just security updates from the command line?

sudo apt-get upgrade installs all updates, not just security updates. I know that I can use Update Manager to select only important security updates, but is there a way to do this from the command ...
169
votes
5answers
140k views

How can I get octal file permissions from command line?

There is a chmod command to set file permissions, but can I get file permissions in octal mode (such as 755) from the command line?
162
votes
4answers
218k views

What do the different colors mean in the terminal?

What do the different colours in Ubuntu's terminal mean? For example, when I type the ls command in one of my folders, I get one of the files in light green, the other (which is a folder) in blue with ...
161
votes
10answers
574k 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 ...
160
votes
12answers
180k 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?
154
votes
14answers
331k views

How can you log out via the terminal?

Is there a command, that will take you back to the login screen?
149
votes
6answers
27k views

How can I tell, from the command line, whether the machine requires a reboot?

When you install certain updates (e.g. a new kernel) in Ubuntu Desktop, you get an indication that a reboot is required (in Lucid, the logout icon turns red). How can I check, from the command line, ...
148
votes
9answers
8k 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 ...
145
votes
12answers
297k 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?
143
votes
6answers
281k views

How do I find the kernel version, Ubuntu release and disk partition information from the terminal?

Which commands will give me information about following using Terminal? Kernel Version Distribution version no. All partition size of the HDD
142
votes
7answers
229k views

How can I decode a base64 string from the command line?

I would like to write a bash script to decode a base64 string. For example I type decode QWxhZGRpbjpvcGVuIHNlc2FtZQ== and it prints Aladdin:open sesame and returns to the prompt. So far I have tried ...
142
votes
7answers
381k views

How to restart X Window Server from command line?

How can I restart X Window Server from the command line? I'd really like to be able to restart my GUI without having to do a full system reboot.
141
votes
16answers
197k views

How to check battery status using terminal?

I would like a command that check the battery status through the terminal
140
votes
14answers
350k views

How to send mail from the command line?

How to send mail from the command line?
138
votes
1answer
96k 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 ...
137
votes
5answers
108k views

Which one is better: using ; or && to execute multiple commands in one line?

In tutorials and how-to's I often see commands combined. For instance, sudo apt-get update && sudo apt-get install pyrenamer There seem to be four possible connectors: &, &&, || ...
137
votes
6answers
203k views

How to list all variables names and their current values?

Including not only $HOME, $PWD etc but any other you have defined.
125
votes
4answers
192k views

Find and replace text within a file using commands

How can I find and replace specific words in a text file using command line?
125
votes
10answers
44k 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 ...
124
votes
5answers
165k views

How can I empty the trash using terminal?

I am not able to search trash anywhere. Can you please tell me a command or anything like that to empty the trash using terminal ?
121
votes
4answers
16k 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 ...
119
votes
4answers
65k views

How to see the command attached to a bash alias?

Suppose I have an alias in the bash shell. Is there a simple command to print out what command the alias will run?
111
votes
6answers
479k views

How to access a usb flash drive from the terminal? (How can I mount a flash drive manually?)

I only have access to the command line I need to backup my data (on the user folder) to a pen. I don't know where/how can I do this is order to access the pen, and then do the cp command. How can ...
110
votes
7answers
357k 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 ...
110
votes
3answers
22k 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 ...
108
votes
5answers
364k views

How to download a file from a website via terminal?

Suppose that we have a full URL of desired file e.g. http://domain.com/directory/4?action=AttachFile&do=view&target=file.tgz I would like to go without installing a new software. Is it ...
106
votes
5answers
191k views

Execute sudo without Password?

Inspired by this question.... I am the sole person using my system with 12.04. Every time I issue a sudo command; the system asks for the user password (which is good in its own way). However I was ...
103
votes
10answers
51k views

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

What is the difference between Terminal, Console, Shell, and Command Line?
98
votes
1answer
131k views

'sudo su -' vs 'sudo -i' vs 'sudo /bin/bash' - when does it matter which is used, or does it matter at all?

When I'm doing something that requires root be typed in dozens of times in a row, I prefer to switch my session to a root session. In the various tutorials and instructions I have used on the Internet,...