Most Popular
1500 questions
119
votes
8 answers
How to get the first word of a string?
When I echo * I get the following output:
file1 file2 file3 ...
What I want is to pick out the first word. How can I proceed?
vdegenne
- 1,676
- 3
- 16
- 20
119
votes
13 answers
Replace environment variables in a file with their actual values?
Is there an easy way to substitute/evaluate environment variables in a file? Like let's say I have a file config.xml that contains:
instanceId
$INSTANCE_ID
…
Robert Fraser
- 1,297
- 2
- 9
- 7
119
votes
3 answers
What is "mail", and how is it navigated?
The program is located in /usr/bin/mail. Upon execution, Version 8.1.2 01/15/2001 is shown.
Entering list produces:
Commands are:
next, alias, print, type, Type, Print, visual, top, touch, preserve,
delete, dp, dt, undelete, unset, mail, mbox,…
cwd
- 44,479
- 71
- 146
- 167
119
votes
13 answers
Is there any decent speech recognition software for Linux?
The short version of the question: I am looking for a speech recognition software that runs on Linux and has decent accuracy and usability. Any license and price is fine. It should not be restricted to voice commands, as I want to be able to dictate…
Franck Dernoncourt
- 4,749
- 15
- 48
- 79
119
votes
1 answer
What happens when you 'mount over' an existing folder with contents?
Right now /tmp has some temporary files in it. When I mount my hard drive (/dev/sdc1) on top of /tmp, I can see the files on the hard drive. What happens to the actual content of /tmp when my hard drive is mounted? Is it possible to perform r/w…
user
- 1,569
- 4
- 15
- 20
119
votes
4 answers
How to rsync a directory to a new directory with different name?
I'm doing a data transfer, the old file system relies deeply on a directory which now is on different path. This is a git directory which stores code online. I have no rights to move it or rename it.
So what I can do is rsync this directory to the…
Zen
- 7,287
- 18
- 50
- 72
119
votes
9 answers
How to view a specific process in top
Are there any relatively strightforward options with top to track a specific process?
Ideally by identifying the process by a human readable value? e.g. chrome or java.
In other words, I want to view all the typical information top provides, but for…
Michael Coleman
- 1,307
- 2
- 8
- 7
119
votes
4 answers
Watch YouTube videos in terminal
I'm looking for a way to watch YouTube videos in terminal (not in a browser or another window, but right there, in any bash session).
Is there a simple way to do this?
I imagine something like this:
$ youtube
I already know how to…
Ionică Bizău
- 3,371
- 10
- 30
- 49
119
votes
5 answers
Does tail read the whole file?
If I want to tail a 25 GB textfile, does the tail command read the whole file?
Since a file might be scattered on a disk I imagine it has to, but I do not understand such internals well.
The Unfun Cat
- 3,341
- 9
- 30
- 40
118
votes
6 answers
What is the difference between Halt and Shutdown commands?
What is the difference between the halt and shutdown commands?
wassimans
- 1,501
- 2
- 13
- 15
118
votes
9 answers
Can't indent heredoc to match code block's indentation
If there's a "First World Problems" for scripting, this would be it.
I have the following code in a script I'm updating:
if [ $diffLines -eq 1 ]; then
dateLastChanged=$(stat --format '%y' /.bbdata | awk '{print $1" "$2}' | sed…
Bratchley
- 16,684
- 13
- 64
- 103
118
votes
3 answers
Why doesn't grep ignore binary files by default?
The manpage for grep describes the -I flag as follows:
-I Ignore binary files. This option is equivalent to
--binary-file=without-match option.
It also says this about binary files:
--binary-files=value Controls searching and…
user36078
118
votes
11 answers
Uploading directories with sftp?
I'm having some trouble uploading directories(which contain other directories a few levels deep) by sftp. I realize I could work around this by gzipping, but I don't see why that's necessary.
Anyway, I try
sftp> put bin/
Uploading bin/ to…
Earlz
- 2,184
- 2
- 16
- 12
118
votes
5 answers
Command-line completion from command history
So, I've looked at history and at Ctrl+R, but they are not what I thought I knew.
Is there a way that I can type in the beginning of a command, and cycle through the matches in my history with some bash shortcut?
# mysq(some shortcut key)
Gives…
Ben Dauphinee
- 1,283
- 2
- 9
- 8
118
votes
7 answers
What are high memory and low memory on Linux?
I'm interested in the difference between Highmem and Lowmem:
Why is there such a differentiation?
What do we gain by doing so?
What features does each have?
Navaneeth Sen
- 9,369
- 17
- 58
- 65