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

learn more… | top users | synonyms (6)

27
votes
2answers
3k views

Why does the command “xterm xterm” create an infinite recursion?

I am running Ubuntu 14.04 (64 bit). When I first found out about the command xterm, I tried the command xterm xterm, and it started infinitely opening new xterm windows. ctrl + C stops it immediately ...
27
votes
5answers
51k 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?
27
votes
2answers
23k 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).
27
votes
7answers
30k 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 ...
27
votes
5answers
12k 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)?
26
votes
6answers
25k 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?
26
votes
4answers
47k views

How to change extension of multiple files from command line?

I have many files with .abc extension and want to change them to .edefg How to do this from command line ? EDIT: I have a root folder with many sub-folders, so the solution should work -r ...
26
votes
4answers
12k 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 ...
26
votes
4answers
5k views

What does ~$ stand for?

What does ~$ stand for? For example: user@ubuntu:~$ So far I know that the $ sign is a symbol for a regular user. If I'm not mistaken root have # at the end. I also found a lot of commands in the ...
26
votes
2answers
5k views

Did I just delete everything with find -exec mv?

I tried to figure this out on my own. Here's the command I used in the terminal: find . -name "*.jpg" -exec mv {} pictures \; I did not create a directory named pictures first. What happened was a ...
26
votes
8answers
9k views

Multiple terminal windows

I develop code. I use terminal alot. I use many terminal windows alot. I hate how tabs look. Any useful applications that allow for multiple terminal use, and streamline my development. allow me to ...
26
votes
6answers
20k 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 ...
26
votes
6answers
6k views

What causes Nautilus to restart whenever I kill it?

In htop, I kill Nautilus, and within one second, it's back, with a new PID! The restarted Nautilus shows in the Processes list, but has no GUI until I manually launch Nautilus... I've heard ...
26
votes
2answers
36k 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.
26
votes
3answers
26k 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 ...
26
votes
3answers
4k views

Why do shells call fork()?

When a process is started from a shell, why does the shell fork itself before executing the process? For example, when the user inputs grep blabla foo, why can't the shell just call exec() on grep ...
26
votes
4answers
11k 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.
26
votes
2answers
26k 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
3answers
3k 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. ...
25
votes
8answers
2k 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? ...
25
votes
2answers
3k views

Prevent command from stopping when pressing CTRL+C

So, I was playing some Zork 1 and I went to copy some text to show a friend of mine, but I accidentally forgot to hold the shift key when pressing CTRL+C. This stopped the command and I lost my Zork ...
25
votes
4answers
44k views

Where to declare environment variables?

What are correct places for: Global environment variables meant to affect all users? User-specific environment variables?
25
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?
25
votes
12answers
19k 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.?
25
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 ...
25
votes
5answers
159k views

How do I remove a folder?

I'm a new user and Im trying to remove a specific folder. I am using sudo rm /path/ but its not working. What is the correct command to use? It is a file catolog I am attempting to remove but im ...
25
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?
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
9answers
69k 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 ...
24
votes
3answers
22k 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
5answers
106k views

Create default home directory for existing user in terminal

How do I do this? I created a user without a home directory and now I want to create one. Not just a folder called new_user, I want the default home directory with all it's folders and hidden files, ...
24
votes
4answers
84k 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) ...
24
votes
1answer
21k 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.
24
votes
3answers
26k views

How to exclude/ignore hidden files and directories in a wildcard-embedded “find” search?

Starting from (notice the wildcards before and after "some text") find . -type f -name '*some text*' how can one exclude/ignore all hidden files and directories? I've already been googling for far ...
24
votes
1answer
8k 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) ...
24
votes
4answers
43k 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
7answers
22k views

How do I search my command-line history for commands I used before?

Other than viewing the history, is there a way to filter my history? Say I want to search for a command that started with "ssh"?
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
5answers
52k views

Automatically enter input in command line

I'm running a script that it requests entering 'y' on each operation, I am looking for a solution like $ ./script < echo 'yyyyyyyyyyyyyy' to pass all my inputs in one time.
23
votes
4answers
126k 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 ...
23
votes
6answers
9k 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?
23
votes
6answers
26k 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
3answers
35k 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 ...
23
votes
3answers
20k 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
2answers
19k 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
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
3answers
11k views

Are terminal and shell the same?

I know this might sound foolish but I just wanted to know if there is really a difference between the two words used in the Linux world. I do know that the Shell is a Command Line Interface and has ...
23
votes
8answers
28k 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?
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
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?