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

learn more… | top users | synonyms (5)

25
votes
3answers
12k views

How do I find the build dependencies of a package?

I'd like to find out which packages sudo apt-get build-dep <package> would install (if I already got some dependencies installed, I'd also like to see those → so running or simulating the ...
25
votes
4answers
80k views

How do I move all files from one folder to another using the command line?

I would like to know how could I move all files from a folder to another folder with a command line. Let's say I'm in my Downloads folder and there are a 100 files that I would like to move to my ...
25
votes
3answers
19k 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 ...
25
votes
2answers
31k views

Is it possible to clean the APT cache from the command line?

I ask because Ubuntu Tweak's Janitor is frozen due to the sheer number of packages in the cache that accumulated during the upgrade from 12.10 to 13.04.
25
votes
2answers
24k 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 ...
25
votes
5answers
47k views

How can I find out if a specific program is installed? [duplicate]

I want to find out if a program - Chromium for example - is installed on Ubuntu or not. Manually or as a package. How do I know if a program is installed via command line?
25
votes
2answers
21k 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).
24
votes
4answers
3k 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 ...
24
votes
3answers
2k views

Why `time` command doesn't work with any option?

I tried to use time command with -f option to format the output of time, but I get the following error: -f: command not found Then I tried to use other options -a, -o, etc and I get the same error. ...
24
votes
4answers
43k views

How do I save terminal output to a file?

How do I save the output of a command to a file? Is there a way without using any software? I would like to know how.
24
votes
4answers
40k views

Where to declare environment variables?

What are correct places for: Global environment variables meant to affect all users? User-specific environment variables?
24
votes
3answers
21k views

How can I convert a ppt to a pdf from the command line?

I have a folder containing a bunch of ppts, each of which I'd like to convert to an individual pdf. I'm using Ubuntu 10.04 with whatever comes installed on it.
24
votes
4answers
13k views

Why is sudo -s better than sudo su?

I’ve seen many comments here in Ask Ubuntu regarding preference in using sudo -s rather than sudo su. For me, that two commands do exactly the same. But why is sudo -s supposed to be better?
24
votes
3answers
10k views

Is there an offline command-line dictionary?

Is there any command line offline dictionary? I know that there are some like StarDict and Artha but how about one in the command line? Also, I tried dict but it is an online dictionary.
24
votes
2answers
48k 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 ...
24
votes
5answers
10k 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)?
24
votes
4answers
40k views

What is the proper terminal-way to shutdown?

I was trying to shutdown my PC through SSH. I executed sudo shutdown now The user was logged-out and Ubuntu starting turning off, but it froze at the last screen with the Ubuntu logo and the loading ...
23
votes
3answers
2k 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 ...
23
votes
2answers
149k views

I want to copy a directory from one place to another via the command line

I want to copy a directory from one place to another folder. sudo cp is the command, but after that what should I type? The destination or source first?
23
votes
6answers
24k 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.)
23
votes
4answers
8k views

How can I list all packages I've installed from a particular PPA?

How can I list all packages I've installed from a particular PPA? Command-line answers preferred. Related question: how can I list all installed packages that are not available from the main Ubuntu ...
23
votes
12answers
17k views

Command line audio players

What are popular audio players for the command line? How to play a single sound file? Are there command line players that also index the music library like Banshee, Exaile, etc.?
23
votes
5answers
17k views

How can I get mv (or the * wildcard) to move hidden files?

I am migrating my home directory from an old system to a new one, and the tarball I made contains everything, including hidden files like .bashrc. However, when I move the contents of the unpacked ...
23
votes
3answers
7k views

Redirect the output using `sudo` [duplicate]

I have a small question regarding using sudo with output redirect >. To enable IP forwrding, someone can use the command: echo 1 > /proc/sys/net/ipv4/ip_forward Executing this command will ...
23
votes
2answers
18k 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 ...
23
votes
3answers
23k views

How can I measure the execution time of a terminal process?

I'm trying to measure the execution time of a process that I call via the command line (i.e., I want to find out how long it takes to for the process to finish). Is there any command that I can add to ...
23
votes
4answers
73k views

How to detach a screen on a terminal?

Maybe this is a dumb question. I know how to start a screen or how to list different screens. screen -ls or to attached.. There are screens on: 2477.pts-0.server1 (Detached) ...
23
votes
3answers
17k views

Changing colors for user, host, directory information in terminal command prompt

Is it possible to change the colors in the command prompt for the user@computer, as well as the the current directory and command parts of the prompt display? I've already seen something like this ...
23
votes
3answers
3k views

Command-line equivalences of some tasks in Synaptic

I already use apt-get for most of my package management. Yet, there are times when I occasionally need to use Synaptic to do certain things. I would like to learn the equivalent commands for doing the ...
23
votes
3answers
7k views

What is the maximum length of command line arguments in gnome-terminal?

What is the maximum length of command line arguments in gnome-terminal? ... and is there a system environment variable which reports this value?
23
votes
2answers
5k views

What does `~/ ` mean?

I'm new to Linux and Ubuntu. People keep using ~/filename in their answers to my questions. What does ~/ mean?
23
votes
1answer
19k 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.
23
votes
2answers
11k 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” ...
23
votes
7answers
27k views

How do I navigate to a samba location I've mounted in Nautilus on the command line?

Please note: I am two weeks old in Linux. I have found a lot of answers to this question on the internet, tried many, but all failed one way or another. Therefore I dare to ask once again in the hope ...
23
votes
1answer
7k 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) ...
23
votes
2answers
32k views

How do I extract a password protected .7z file?

Can someone tell me how can I extract a password protected .7z file in Ubuntu server? (I know the password, I just need a program to do so and an example of how to use said program...)
22
votes
6answers
100k views

How to create a bootable Ubuntu USB flash drive from terminal?

Is there any way to create a bootable Ubuntu USB flash drive from the terminal without using any third-party applications like YUMI,Unetbootin, etc. I tried to create a bootable Ubuntu flash drive ...
22
votes
6answers
8k views

How can I create an alias for cd and ls?

I frequently run the ls command after running the cd command. How can I create an alias (like cs) for this operation?
22
votes
9answers
63k 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 ...
22
votes
4answers
7k views

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

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

Take a picture from terminal

I want to be able to take a picture using the webcam from the terminal. this image then will be send to a specific directory. How can this be done.
22
votes
3answers
82k 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?
22
votes
2answers
25k views

How to resize an image through the terminal?

I have Ubuntu 10.04. I have converted image through terminal using the following command: convert myfigure.png myfigure.jpg. But I want to resize the height and width of the converted image. Is ...
22
votes
3answers
27k views

Shutdown from terminal without entering password?

I have desktop edition of Ubuntu. I like the Terminal so that that I prefer to shutdown my computer with the shutdown command. However when I type shutdown now it prompts me to enter my password.Is ...
22
votes
8answers
26k 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?
22
votes
3answers
31k views

How to find and list all the symbolic links created for a particular file?

I had created many symbolic links on various paths for a particular file or a directory. I want the whole list of created symbolic links paths (location). Example: I created symbolic links for ...
22
votes
1answer
48k 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 ...
22
votes
1answer
16k views

Bash: delete word ahead of cursor

Consider the following bash prompt, where ^ denotes the prompt location: svn commit -m very/long/path/to/some/file "[bug 123456] Fix the pixel issue" ^ I'd like to commit a different ...
21
votes
5answers
3k 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 ?
21
votes
4answers
113k 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 ...