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

learn more… | top users | synonyms (5)

7
votes
2answers
4k views

Is it possible to save output from a command to a file after the command already has been executed?

Does an elegant way exist to save the output of a command to a file after the command has been run, with the terminal window is open? I mean once the command has been executed in the terminal. The ...
5
votes
5answers
1k views

Is there a command-line utility app which can find a specific block of lines in a text file, and replace it?

UPDATE (see end of question) The text "search and replace" utility programs I've seen, seem to only search on a line-by-line basis... Is there a command-line tool which can locate one block of ...
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 ...
7
votes
5answers
5k views

Concatenating several .mp3 files into one .mp3

As it was suggested here I am using cat command to concatenate several .mp3 files into one .mp3 file. Imagine, I have following .mp3 files in the current folder: 001001.mp3 001002.mp3 001003.mp3 ...
7
votes
3answers
5k views

Diffrence between two dirs?

I have two identical folders, but the are not identical(for example Java installation dir). One dir has one extra file and one file has been changed. Is there any easy to use tool to check that or do ...
73
votes
4answers
99k 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?
19
votes
7answers
30k views

How to run a script without closing the terminal?

I have a script in file bla.sh and it is executable. When I click on it, the script is executed and the window is closed. I'd like the window to stay open. Something like command cmd /k** command in ...
2
votes
1answer
1k views

How can I force fish to save new key bindings persistently after closing a terminal window?

How can I force fish to save new key bindings persistently after closing a terminal window? At the moment i have the problem: I open a terminal window, the default shell is fish. I add a key ...
20
votes
6answers
12k views

Differences between doublequotes “ ”, singlequotes ' ' and backticks ´ ´ on commandline?

I often see tutorials on the web or posts on this site which make heavy use of the following characters at the command line. Often it seems that they are used for pretty similar purposes. What are the ...
1
vote
1answer
170 views

Add binding to fish that not auto executes the string?

How do i set up a key binding in fish, so that fish understands not to execute the bindingstring after appending it to commandline but just appending it as string to commandline. I want to set up a ...
4
votes
4answers
2k views

Battery loading state on commandline?

Sometimes the energy status applet on my gnome panel suddenly disappears. Is there a simple command to print loading state of the battery at commandline?
18
votes
4answers
21k 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?
2
votes
3answers
908 views

Is it possible to use two different shells for different terminal windows?

Is it possible to use another shell for scripts than for standard terminal use? The problem is, i use fish as shell at the moment and i find i very convenient. But i would like to learn a bit of ...
33
votes
6answers
33k views

Beep in shell script not working?

I'd like to use a beep sound in a shell script. Unfortunately none of the methods I found via Google work for me. I tried echo -e '\a' echo -ne '\007' and the command beep after I installed it ...
16
votes
1answer
12k views

“sudo cd …” one-liner?

Occasionally I want to cd into a directory where my user does not have permission, so I resort to sudo. The obvious command sudo cd somedir doesn't work: $ sudo mkdir test $ sudo chmod go-rxw test $ ...
3
votes
2answers
4k views

Differences between fish and bash to pass commandline arguments to alias functions?

From the answers to my other question here i learned about the possibility to pass commandline arguments to a alias function in Bash. In Fish i can edit an alias by editing the file config.fish in ...
15
votes
3answers
14k views

How to activate pagination for ls command?

What is the equivalent option for the ls command to activate pagination as in DOS the dir /p does?
4
votes
1answer
3k views

Difference between dhclient & dhclient3?

Well, I Stumbled upon a command that connects your wired connection from the command line by issuing this in the terminal; "sudo dhclient3 eth0". But there is also a command called "dhclient". Are ...
14
votes
5answers
37k views

Command line option to check which filesystem I am using?

Is there a command that will show which file system (ext3, ext4, FAT32, ...) the various partitions and disks are using? Similar to how sudo fdisk -l lists information about disks and partitions?
1
vote
2answers
595 views

Split large file, have arbitrary start index number

I do a lot of file manipulation on my system and in one particular batch job I end up with around 16 Gb file. I need to prepare this data into smaller chunks for another process. I split it into 10k ...
5
votes
1answer
1k views

Dual monitors and command line

I set up Gnome to use 2 monitors in extended mode - and it works great as expected. Now I'm wondering wether it is possible to use this setup in the console mode. Currently I see the same command ...
18
votes
5answers
9k views

In the output of 'ls -n', what does the the second column mean?

When I run: ls -n I get something like: -rwxrwxrwx 1 1000 1000 765528 2009-10-15 18:41 file1 drwxr-xr-x 10 1000 1000 4096 2010-12-07 20:50 dir1 drwxr-xr-x 3 1000 1000 4096 2010-10-24 ...
7
votes
5answers
31k views

Is there a command to close a terminal window via commandline?

Is there a command to close a terminal window via commandline?
4
votes
3answers
1k views

How to change a particular path from the environment variable PATH?

I incorrectly declared a variable, and now it has two forward slashes in it. How do I unset/correct it? PATH=...ols-1.3-62308//bin:/bin Thanks.
9
votes
5answers
2k views

Can I change the name of the guake tab to show the current command?

I use guake very heavily, and ssh into more than 3 computers at any point in time. I also have daemons running on some tabs (terminals). What I want to know, Is it possible to have the name of the ...
8
votes
3answers
879 views

Is there a way to check if a program is available in the repository by commandline?

When i find a interesting program i want to test and install in ubuntu i first check if it's available in the repository. For that i use the software center. But does a possibility exist to check it ...
10
votes
3answers
5k views

How to enter the Default Keyring password via the command line?

Is there a way to enter the default keyring password using the command line? For instance: You have a remote setup of Ubuntu 10.10 thats set to auto login. You don't want to remove the keyring ...
7
votes
2answers
10k views

How to rename file with whitespaces in filename?

i tried it the following way: rename 'bla bla .txt' blabla.txt But this doesn't work, what's the correct syntax for this case?
30
votes
2answers
16k 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 | ...
6
votes
2answers
1k views

How can I create an alias so that when I enter “kt” it executes “killall gnome-terminal”?

How can I create an alias so that when I enter "kt" it executes "killall gnome-terminal"?
9
votes
4answers
2k views

How can i keep a command started from shell on running if i logout from shell?

Which methods exist to keep a command that was started from shell on running after logging out from from shell?
7
votes
1answer
480 views

For what duration is sudo_root in “don't-prompt-for-password” mode?

The first time a user enters sudo foo, sudo_root prompts for the password. For a certain duration after that, sudo_root doesn't prompt for a password for any subsequent sudo foo's in that terminal ...
6
votes
3answers
731 views

Can I log to a non-default shell?

I love fish. I have a nice Ubuntu 8.04 Server running some services. So I edited the /etc/passwd file, as I did in the past, to change my default shell from bash to fish. And ,yes, I made I typo (BTW: ...
4
votes
1answer
642 views

Shutter's --selection command line option is missing

In Karmic, shutter used to have a commandline option called --selection, which I've used in a hack to replace gnome-screenshot with the funcionality of shutter. However, this option doesn't not exist ...
24
votes
1answer
20k 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.
7
votes
3answers
2k views

How to delete all files that are returned by locate

At the moment his is what I do: Step 1: locate fooBar /home/abc/fooBar /home/abc/Music/fooBar Step 2: Manually perform a removal, by copy-pasting each line. rm /home/abc/fooBar rm ...
1
vote
5answers
6k views

Pasting Clipboard Contents into Terminal [duplicate]

Possible Duplicate: Can not paste into terminal How can I paste clipboard contents into terminal without having to right click then press the "Paste" menu item? Ctrl-V doesn't work here!
1
vote
2answers
3k views

Volume control command

Is there a way to control volume of a remote system via ssh? we have a media center server and we want to remotely control the volume.
0
votes
0answers
275 views

I can't open program from remote computer, why? [duplicate]

Possible Duplicate: How to open a remote python program from terminal by ssh? When I open a program from my local account using terminal, it works. For example, I type "firefox"...firefox ...
1
vote
6answers
2k views

How to open a remote python program from terminal by ssh?

I type ssh -X name@blah.edu and asks for a password, I type it in and get logged in. name@blah.edu:~$ program.py then nothing happens, when it should actually pop up. Why is this happening and ...
2
votes
1answer
1k views

Can I use ping to see real time drop rates?

I'm pinging a server which is dropping packets. At the end of my ping I see something like: 100 packets transmitted, 85 received, 15% packet loss, time 100030ms What I'd like to do is run my ping ...
8
votes
1answer
1k views

What are “select-by-word” characters?

What are the "select-by-word" in gnome-terminal's preferences?
15
votes
5answers
13k views

trim the terminal command prompt working directory

When using the terminal in a deep folder structure sometimes the prompt can take up most of the line. Is there any way in which I can trim the working directory? I know I can do PS1="\W >" to only ...
16
votes
0answers
529 views

Why do I need ./ to run an application? [duplicate]

I wrote a little Hello world program. When I tried to run a.out, I got "command not found". When I ran ./a.out, it worked fine. Where can I learn about why that was?
11
votes
5answers
15k views

Where does Ubuntu store its library files?

I want to add my own library to use in c compiling, but don't really know where ubuntu stores it.
6
votes
5answers
1k views

way to detect which workspace you are currently in from the command line

I'm trying to figure out how to get the workspace number from a terminal script in gnome. Any ideas?
118
votes
4answers
134k 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 ...
99
votes
10answers
108k 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?
9
votes
3answers
6k views

How to pause/resume transfer of large files?

I recently had to copy about 20 GB of data split between about 20 files from my laptop to an external hard drive. Since this operation takes quite a while (at ~560kb/s), I was wondering if there was ...
6
votes
4answers
7k views

How to send SFTP file download to background?

Is it possible to: execute sftp command on remote machine and download a file (ssh user@machine, sftp user2@server, get file) then, send download to background, so I can turn my local computer off