date int64 1,220B 1,719B | question_description stringlengths 28 29.9k | accepted_answer stringlengths 12 26.4k | question_title stringlengths 14 159 |
|---|---|---|---|
1,350,495,713,000 |
I have a data file ($file1) which contains two lines of data per individual. I need to intersperse a third line of data from another data file ($file2). So my input looks like:
>cat $file1
bob 1 1 0
bob 1 0 1
alan 0 0 1
alan 0 1 1
>cat $file2
bob a a b
alan a c a
So the desired result would ... |
Just:
paste -d '\n' -- - - "$file2" < "$file1"
(provided $file2 is not -).
Or with GNU sed, provided $file2 (the variable content, the file name) doesn't contain newline characters and doesn't start with a space or tab character:
sed "2~2R$file2" "$file1" < "$file2"
With awk (provided $file1 doesn't contain = charac... | Intersperse lines from two files |
1,350,495,713,000 |
I have two csv files:
test1.csv
1
2
3
4
test2.csv
6
7
8
9
I want to horizontally merge these two files. To do this I use paste -d , test1.csv test2.csv > paste.csv If I open this file in notepad it looks correct i.e.
paste.csv
1,6
2,7
3,8
4,9
However if I load paste.csv in Excel it looks like
What I'm I missing... |
Unix represents newlines with the character LF (line feed = \n = ^J = 10 decimal = 012 octal = 0x0a hexadecimal). Windows represents newlines with the two-character sequence CR, LF (CR = carriage return = \r = ^M = 13 decimal = 015 octal = 0x0d hexadecimal). When a Windows text file is processed by a Unix utility, eac... | Trouble with horizontial merge of csv files under Cygwin |
1,350,495,713,000 |
I'm working on a raspberry pi, and trying to paste some text files into a command-line text editor nano... but the text ends up corrupted on the remote end (partial/incomplete text).
I can only guess the paste function of my PC (xubuntu 16.04) is pushing the data too fast (the serial baud is 115200).
Can I slow down t... |
I found that screen has a slowpaste function!
https://gist.github.com/jandahl/8436cd6a99d56efd9ff4
install screen
make a .screenrc file if you don't have one:
startup_message off
hardstatus alwayslastline
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}]... | how can I slow down pasting text into a serial terminal? |
1,350,495,713,000 |
I have a tab delimited file like this:
chr1 53736473 54175786
chr1 56861276 56876438
chr1 57512145 57512200
I want to concatenate the three fields result like this:
chr1:53736473-54175786
chr1:56861276-56876438
chr1:57512145-57512200
I tried with paste -d ':-' file, which apparently did... |
With sed:
$ sed 's/\(.*\)\t\(.*\)\t/\1:\2-/' file
chr1:53736473-54175786
chr1:56861276-56876438
chr1:57512145-57512200
printf:
printf "%s:%s-%s\n" $(< file)
chr1:53736473-54175786
chr1:56861276-56876438
chr1:57512145-57512200
| Concatenate different fields with different seperator |
1,350,495,713,000 |
I have two or more files
FileA
A: 18.49 RPKM
C: 14.49 RPKM
B: 18.89 RPKM
FileB
A: 21.29 RPKM
C: 38.71 RPKM
B: 36.13 RPKM
I want to paste these two files and print first-column only once and second column from each file
Desired output (tab delimited)
A: 18.49 21.29
C: 14.49 38.71
B: 18.89... |
With any awk in any shell on every UNIX box for any number of input files, all you need is:
$ paste FileA FileB | awk '{o=$1; for (i=2; i<NF; i+=3) o=o"\t"$i; print o}'
A: 18.49 21.29
C: 14.49 38.71
B: 18.89 36.13
| Format output file from paste command |
1,350,495,713,000 |
Usually paste prints two named (or equivalent) files in adjacent columns like this:
paste <(printf '%s\n' a b) <(seq 2)
Output:
a 1
b 2
But when the two files are /dev/stdin and /dev/stderr, it doesn't seem to work the same way.
Suppose we have blackbbox program which outputs two lines on standard output and t... |
Why you can't use /dev/stderr as a pipeline
The problem isn't with paste, and neither is it with /dev/stdin. It's with /dev/stderr.
All commands are created with one open input descriptor (0: standard input) and two outputs (1: standard output and 2: standard error). Those can typically be accessed with the names /d... | Why can't `paste` print stdin next to stderr? |
1,350,495,713,000 |
I want to add numbers from two txt files. The number will change in file1, and file2 should update itself like this file2 = file1 + file2. Decimals not needed.
Example:
file1
3
file2
7
Output:
file1
3
file2
10
I tried $ paste file1 file2 | awk '{$0 = $1 + $2}' > file2 but all it does is copy the number from file... |
You could do this:
let tot=$(cat file1)+$(cat file2)
echo $tot
| How do I add numbers from two txt files and write it to the same file? |
1,350,495,713,000 |
Is it possible to output both the full line and the matched parts of some line?
Suppose I have this input
low [ 0]: 0xffff0000 Interesting description A
hi [ 0]: 0xffff00a0 Interesting description B
low [ 1]: 0x5000 Interesting description C
hi [ 1]: 0x6000 Interesting description D
...
hi [15]: 0x806000 ... |
With any awk:
awk 'match($0,/0x[0-9a-zA-Z]*/) {print $0; print substr($0,RSTART,RLENGTH)}' file
With GNU awk:
gawk 'match($0,/0x[0-9a-zA-Z]*/,arr) {print $0; print arr[0]}' file
You might consider replacing 0x[0-9a-zA-Z]* with 0x[[:xdigit:]]+
| How to collect both full lines, and matching part of line? |
1,350,495,713,000 |
I have two files which contain only one column of numeric data each, and the same number of rows. When using paste, it does combine the rows from the two files into one row, but the text of the first file is truncated, while the text from the second file is intact:
$ head -3 s1_.dat s2_.dat
==> s1_.dat <==
-0.02319335... |
There shouldn't be a limit. It's just that at least your first input file has DOS/Windows -style CRLF line endings, where the carriage return (CR) returns the cursor position to the start of the line before the separating TAB and the next value are printed. Note how the value from the second file starts at position 8,... | Why does paste command truncate one of the input files? |
1,598,351,860,000 |
I want to sort several text files in reverse order and then merge/cat to one single text file.
a.txt
0 33.1
2 33.0
10 21.1
20 21.8
b.txt
0 30.1
2 33.0
10 28.1
20 27.8
and so on *.txt files
I want output like this
20 21.8
10 21.1
2 33.0
0 33.1
20 27.8
10 28.1
2 33.0
0 30.1
I don't want like t... |
Sort files individually, and redirect the whole output to the resulting file:
for file in *.txt ; do
sort -k1,1rn < "$file"
done > file.concatenated
(here it's important the output file doesn't have a .txt extension as it's created first by the redirection).
Or if you want to sort the files in place (rewriting th... | sort multiple files and merge |
1,598,351,860,000 |
I have a list of numbers which i would like to add to the end of another file as the final column:
1:.196
5:.964
6:.172
The numbers in front (1,5 and 6) indicate at which line the numbers have to be appended in the target file, so that the first line ends with .196, the fifth with .964 and so on. The usual paste file... |
With awk:
# create two test files
printf '%s\n' one two three four five six > target_file
printf '%s\n' 1:.196 5:.964 6:.172 > numbers
awk -F':' 'NR==FNR{ a[$1]=$2; next } FNR in a{ $0=$0 a[FNR] }1' numbers target_file
Output:
one.196
two
three
four
five.964
six.172
Explanation:
awk -F':' ' # use `:` as input... | Append a column to a file based on line number |
1,598,351,860,000 |
I'm combining live sar samples with paste and trying to format the output with awk live.
It works as expected to format the output, but it doesn't do the formatting live on each sample and instead waits till the full 50 seconds (5 sec samples, 10 of them) completes.
Solution was (stdbuf -o0) to disable buffering on t... |
The answers in Turn off buffering in pipe provide several techniques which you can use. The principal idea is that commands which are not connected to an interactive terminal (for example, in a pipeline) are using buffering. One command which can run another command with different buffering settings is the GNU coreuti... | Format sar samples live with paste and awk |
1,598,351,860,000 |
Why does a brace expansion behave differently than wildcard in combination with paste?
Example:
Assume we have multiple folders, each containing the same-structured tsv and want to create a 'all.tsv' containing the 5th row of each of those. The two commands behave differently:
paste -d, <(cut -d$'\t' -f5 {test,test1,t... |
The behaviour you're looking for is a bug that was fixed between bash-3.2 (the version found on macOS), and bash-4.0. From the CHANGES file:
rr. Brace expansion now allows process substitutions to pass through
unchanged.
For a one-liner, you might try awk:
awk -F '\t' {FNR != NR {exit} {out=$5; for (i = 2; i < ARG... | Paste & Brace Expansion vs Wildcard |
1,598,351,860,000 |
I have many files like following in a directory "results"
58052 results/TB1.genes.results
198003 results/TB1.isoforms.results
58052 results/TB2.genes.results
198003 results/TB2.isoforms.results
58052 results/TB3.genes.results
198003 results/TB3.isoforms.results
58052 results/TB4.genes.results
198003 results/TB4.isofor... |
GNU awk is used. I put this command in the bash script. It will be more convenient.
Usage: ./join_files.sh or, for pretty printing, do: ./join_files.sh | column -t.
#!/bin/bash
gawk '
NR == 1 {
PROCINFO["sorted_in"] = "@ind_num_asc";
header = $1;
}
FNR == 1 {
file = gensub(/.*\/([^.]*)\..*/, "\\1", "g", ... | How to join files with required columns in linux? |
1,598,351,860,000 |
I have a number of text files that have the same name. Each file is saved in a different folder also each file contains one column of numbers as follow:
FILE.TXT FILE.TXT FILE.TXT FILE.TXT ....
5 4 5 7
8 2 1 5
6 1 1 ... |
{ paste -d, /dev/null "${in}"/folders_names.txt | tr -d \\n | cut -c2-; \
sed 's|.*|'"${in}"'/&/file.txt|' "${in}"/folders_names.txt \
| tr \\n \\0 | xargs -0 paste -d,; } > all_files.csv
The first command
paste -d, /dev/null "${in}"/folders_names.txt | tr -d \\n | cut -c2-
prints the header, e.g. if your "${in}"/... | Paste single-column files with same name using directory name as column name |
1,598,351,860,000 |
I have 2 files
File 1:
01:12:00,001 Some text
01:14:00,003 Some text
02:12:01,394 Some text
File 2:
01:12:00,001 Some text
01:12:01,029 Some text
01:13:21,123 Some text
I need output as follows:
01:12:00,001 Some text
01:12:00,001 Some text
01:12:01,029 Some text
01:13:21,123 Some text
01:14:00,003 Some text... |
Because you're asking for the file to be sorted by the order that the fields appear in the file, this is the most basic use of sort:
sort file1 file2 > outputfile
| How to merge multiple files based on a timestamp |
1,598,351,860,000 |
These are 3 files:
file1 file2 file3
1 2 3 1 1 1 3 3 3
2 1 3 1 1 1 3 3 3
0 0 0 1 1 1 3 3 3
I want to join them together and have a final file like:
1 2 3 1 1 1 3 3 3
2 1 3 1 1 1 3 3 3
0 0 0 1 1 1 3 3 3
But when I use :
paste file1 file2 file3 > file4
I see gap in output(file4):
1 2 3 1 1 1 3 3 ... |
I tried
paste -d ' ' file1 file2 file3 > file4
and it worked fine. Tested on MacOS.
| how to paste several file together using a single space as a delimiter [duplicate] |
1,598,351,860,000 |
I have a 4 line input file and i need to modify the file to combine alternate lines. I want to perform the operation in place.
INPUT:
Tom
Nathan
Jack
Polo
Desired Output:
Tom Jack
Nathan Polo
One way is to collect odd numbered lines and flip them and cut even numbered lines and combine both files to get the final... |
Given
$ cat INPUT
Tom
Nathan
Jack
Polo
then
$ pr -s -T -2 < INPUT
Tom Jack
Nathan Polo
(paginate with single tab spacing between columns, no headers, two columns); or
$ paste -d ' ' - - < INPUT | rs -T
Tom Jack
Nathan Polo
(paste then transpose)
| How to combine alternate lines in a file? |
1,598,351,860,000 |
I have a testA.txt with contents as shown below
[jiewmeng@JM textFiles]$ cat testA.txt
The quick
brown fox
jumped over
the lazy
dog.
paste normally works
[jiewmeng@JM textFiles]$ paste testA.txt
The quick
brown fox
jumped over
the lazy
dog.
But what happened when I used serial?
[jiewmeng@JM textFiles]$ paste -s... |
Your file contains CR+LF line ending. (You can say cat -vet inputfile to figure that. Carriage returns would show up as ^M in the output.)
The following demonstrates the effect of line endings on the output:
$ cat test.txt
The quick
brown fox
jumped over
the lazy
dog.
$ paste -s test.txt
The quick brown fox ... | Wierd output using paste with serial option |
1,598,351,860,000 |
I am writing a script which returns 15 lines of titles and 15 lines of URLs.
title 1
title 2
title 3
*snip*
title 14
title 15
http://example.com/query?1
http://example.com/query?2
http://example.com/query?3
*snip*
http://example.com/query?14
http://example.com/query?15
I'd like to merge it in such a way that produces... |
You're looking for the pr command
pr -2t -s" " file
| merge x and x + n lines |
1,598,351,860,000 |
I have a bunch of input csv files (delimited with semi-colon ";" having the following format
YEAR;MONTH;DAY;RES1FILE1;RES2FILE1;RES3FILE1
1901;01;01;101;154;169
1901;01;02;146;174;136
The number of columns for each files is variable, meaning that some files could have 6 columns and some others 4.
I would like to past... |
I can think of two ways to approach this:
implement your own 'paste' that skips the first three fields of all but the first file - for example
awk -F\; '
FNR==NR {
a[FNR]=$0; next;
}
{
for (i=4;i<=NF;i++) a[FNR] = sprintf("%s;%s", a[FNR], $i);
}
END {
for (n=1;n<=FNR;n++) print a[n];
}' file*... | Paste different csv files |
1,598,351,860,000 |
I am attempting to merge three files using 'paste' and 'awk'. However, the columns are not adjusting to the longest string of characters. All files are formatted in the same manner as below.
F gge0001x
D 12-30-2006
T 14:15:20
S a69
B 15.8
M gge06001
P 30.1
Below is my faulty code.
$ paste <(awk '{print $1}' lin... |
Your input files have DOS \r\n line endings. Remove the carriage returns with the dos2unix command or with sed -i 's/\r$//'
| Format Column Width with Printf |
1,598,351,860,000 |
To paste many files, whose names are incremental numbers:
paste {1..8}| column -s $'\t' -t
What if your files wasn't named by number, but only words?
It can be up to ten files, what should I do?
In addition, you have a list of files that contains all the files you want.
So far, my approach is:
mkdir paste
j=0; whil... |
With bash 4
mapfile -t <list
paste "${MAPFILE[@]}" | column -s $'\t' -t
for the paste {list}/PQR/A/sum version of the question
mapfile -t <list
paste "${MAPFILE[@]/%//PQR/A/sum}" | column -s $'\t' -t
| How to use paste command for many files whose names are not numbers? (paste columns from each file to one file) |
1,598,351,860,000 |
I have two (or maybe more) files:
file1.csv
dog
cats
mouse
file2.csv
001a
002a
003c
If I use paste file1.csv file2.csv the output is
dog 001a
cats 002a
mouse 003c
Of course I can use paste -d , file1.csv file2.csv
dog,001a
cats,002a
mouse,003c
But I want this output
TEXT1-dog-TEXT2-001a-TEXT3
TEXT1-cats-TEXT2... |
A KISS solution based on what you have so far:
paste -d, file1.csv file2.csv | awk -F, '{print "TEXT1-" $1 "-TEXT2-" $2 "-TEXT3"}'
or
paste -d, file1.csv file2.csv | awk -F, '{print "TEXT1", $1, "TEXT2", $2, "TEXT3"}' OFS=-
(which may be more convenient if you want to make the TEXTs variable).
| Combine .csv-files with text between each line |
1,598,351,860,000 |
I have a few csv-s, each containing 3 columns separated by ",".
Example:
header1,header2,header3
value1,value2,value3
value1,value2,value3
...
Using this tutorial, I thought if I execute paste -d "," *csv > output.csv I will end up with something like this:
header1,header2,header3,header1,header2,header3,...
value1,v... |
Most likely, your original files have \r\n end of lines.
If it is so, the final file would have an extra \r between each line segment. Try using tr:
paste -d "," *csv | tr -d "\r" > output.csv
| paste command puts data from csv files vertically line by line instead of horizontally next to each other |
1,598,351,860,000 |
I have two column in one file :
1 2
3 5
4 8
9 18
3 5
4 19
I want to divide each element of first column to each element of second column and want to print that number too.
for example:
1,2,1/2,
1,5,1/5,
1,8,1/8,
1,18,1/18,
1,19,1/19,
3,5,3/5,
4,19,4/19,
3,2,3/2,
3,5,3/8,
3,19,3/19 and ... |
GNU Parallel
parallel echo "{1},{2}" :::: <(cut -d' ' -f1 file) :::: <(cut -d' ' -f2 file) |
awk -F, '{ print $1,$2,$1"/"$2,$1/$2 }' OFS=, OFMT='%.2g'
Output:
1,2,1/2,0.5
1,5,1/5,0.2
1,8,1/8,0.12
1,18,1/18,0.056
1,5,1/5,0.2
1,19,1/19,0.053
3,2,3/2,1.5
3,5,3/5,0.6
3,8,3/8,0.38
3,18,3/18,0.17
3,5,3/5,0.6
3,19,3/19,0.16... | how to divide each one element from a column to each element of other column? |
1,598,351,860,000 |
I have nearly 400 files, each looks like this:
head HI.1.Q091_13R_all_PA_code
Ha8_00040788 C
Ha4_00024045 C
Ha4_00025366 C
Ha16_00022130 C
Ha16_00023451 C
Ha8_00040789 C
Ha4_00025367 C
Ha4_00024046 A
Ha16_00022131 C
Ha16_00023452 C
I want to copy and paste only the "second" column of each file and save it as a tab-de... |
paste + awk solution:
paste HI.* | awk '{ for(i=2; i<=NF; i+=2) printf "%s%s", $i, (i==NF? ORS : "\t") }' > result
| how to copy and paste only a specific column in each file? |
1,598,351,860,000 |
I am experiencing some strange behavior of the paste tool. For some reason it appears to not do it's job on two specific files, but I cannot reproduce that behavior with other files.
The first file:
$ cat file1
20.623 40.276 -1.999 -1031 127 141 154
20.362 40.375 -2.239 -941 130 141 159
20.36 40.376 -2.402 -1083 139... |
It was indeed the windows line-endings that caused this behavior. After running
sed $'s/\r//' -i file1
To replace them, paste worked as expected. Thanks to steeldriver for pointing me into the right direction. Another solution is using
dos2unix file1
| Strange behavior of paste [closed] |
1,598,351,860,000 |
How can I add output of each file incrementally in one singel output? I want to do this instead of running paste command on all files together. It is because I have 10k files and each file is 100 GB in size.
file1
a 1
b 2
c 3
file2
a 10
b 20
c 40
file3
a 0
b 0
c ... |
paste command is a good choice if we just need to merge lines of files.
To prepend header line with filenames use combination awk + paste:
{ for f in file*; do awk '{ for(i=1;i<=NF;i++) printf("%s\t",FILENAME); exit }' "$f"; done;
echo ""; paste -d"\t" file*; } | column -t
The output (for 3 input files):
file1 fil... | how to add output as a new column with the file names |
1,598,351,860,000 |
I am using a paste command to concatenate two .csv files column wise.
These both files are huge file and when I run the paste command as below where comma(,) is the delimiter:
paste -d',' file1.csv file2.csv > file3.csv
The command fails giving output
paste: line too long
However, I searched the same over internet a... |
try this command
nawk '{if ((getline a < "-") > 0) $0 = $0 "," a; print}' file1.csv < file2.csv > file3.csv
this command will browse your file1.csv and file2.csv line by line and save the line from the file1.csv in $0 (for nawk $0 match the hole line, $1 the first column, $2 the second...) and save the line from file... | Why paste command doesn't work for Concatenating two files column wise when the characters are more than 511? |
1,598,351,860,000 |
Linux have virtual terminals, one can switch between them with chvt 1, chvt 7 commands. Former is in the text mode, later is in the graphics mode.
I want to copy all the text from first terminal, with some utility from graphics mode.
fbgrab -c 1 ~/image.png saves an image, but in my case it is a transparent rectangle.... |
You can get it from /dev/vcs1 (for the first virtual console (tty1)).
cat /dev/vcs1
But chances are those lines are also in a log file. (check /var/log/messages, /var/log/kernel.log, /var/log/syslog for a start).
You may also want to check the stdout/stderr of chrome which if you started it with your Windows manager,... | How to copy text of virtual terminal from graphics mode? |
1,598,351,860,000 |
In a parent folder I have multiple folders inside it. Within each folder I have text file "text.txt". The text files are similar in all the folders, each text file contain 100 line and one column of numbers. example
cat /folder1/text1.txt
1654
1684
535
35131
.
.
I want to merge all these text files as columns in on... |
You could use set and parameter expansion on each array element to print just the directory name:
set -- */text.txt
{ printf ' %s' "${@%/*}" | cut -c2-; paste -- "$@"; }
# this blank ^ is a literal tab
| Paste text files and add parent directory name as header for each column |
1,598,351,860,000 |
I'm learning my way around the vim and got around to copy-paste. Or yank-paste. Now when I try to paste a yanked piece of text, it pushes previous content to the right and squeezes in on the left.
I took 2 screenshots to show you what behaviour I mean.
And
before pasting:
after pasting:
I don't think that my .vimrc... |
In vim there's various ways to copy/paste. (In the enumeration below I'm just showing the three variants using first marking the text then copy/pasting.)
Select a range of whole lines: type V, move to end of range, type y. Then go to the target position and use p to print the text below the current line or use P to p... | Pasting with vim squeezes content in between previous content and margin |
1,598,351,860,000 |
I have a file that looks like this:
Heading1,Heading2
value1,value2
And another one that looks like this:
Row1
Row2
How can I combine the two to become:
Row1,Heading1,Heading2
Row2,value1,value2
Effectively appending a column in the place of the first column?
|
Job for paste:
paste -d, f2.txt f1.txt
-d, sets the delimiter as , (instead of tab)
With awk:
awk 'BEGIN {FS=OFS=","} NR==FNR {a[NR]=$0; next} {print a[FNR], $0}' f2.txt f1.txt
BEGIN {FS=OFS=","} sets the input and output field separators as ,
NR==FNR {a[NR]=$0; next}: for first file (f2.txt), we are saving the... | Append first column to file |
1,598,351,860,000 |
I can copy characters in other apps such as browsers with ctrlc.
I can then press i to enter insert mode in vim and press shiftctrlv to paste the text in.
The problem is that each line gets indented a bit more so I end up with:
but what I want (and end up manually editing to achieve) is:
|
Using :set paste prevents vim from re-tabbing my code and fixes the problem.
Also, :set nopaste turns it off
I also put set pastetoggle=<F2>in my .vimrc so I can toggle it with the F2 key.
| vi / vim - extra indents when pasting text? [duplicate] |
1,598,351,860,000 |
I have to 3 files with all containing columns of information
id.file
1
2
3
name.file
Josh
Kate
Chris
lastname.file
Smith
Jones
Black
And I would like to combine them in a way, so I can get something like this:
The ID of the Josh Smith is 1
The ID of the Kate Jones is 2
The ID of the Chris Black is 3
So far I have ... |
One way:
paste name.file lastname.file id.file | awk -F '\t' '{printf "The ID of the %s %s is %d\n", $1,$2,$3}'
Using awk to get the formatting needed.
| Combining multiple columns and insert information in middle |
1,393,960,193,000 |
Under certain conditions, the Linux kernel may become tainted. For example, loading a proprietary video driver into the kernel taints the kernel. This condition may be visible in system logs, kernel error messages (oops and panics), and through tools such as lsmod, and remains until the system is rebooted.
What does t... |
A tainted kernel is one that is in an unsupported state because it cannot be guaranteed to function correctly. Most kernel developers will ignore bug reports involving tainted kernels, and community members may ask that you correct the tainting condition before they can proceed with diagnosing problems related to the ... | What is a tainted Linux kernel? |
1,393,960,193,000 |
My video card crashes from time to time. It's quite annoying but I live with it -- usually I just restart the graphics with sudo systemctl restart lightdm.service, or if needed reboot the whole system.
In this particular instance the systemctl call hangs, and I don't want to reboot since I have a long-running job on ... |
As @Chris Stryczynski says, sudo cat /sys/kernel/debug/dri/N/amdgpu_gpu_recover is the correct way to reload the amdgpu kernel module, or you can start your system with amdgpu.gpu_recovery=1 kernel parameter to automatically reset it on a crash.
But these options are not usable so much because the display server ( Xor... | How to restart a failed amdgpu kernel module |
1,393,960,193,000 |
I need to connect additional monitors on my computer and I get Fresco Logic FL2000DX USB display adapters. This adapters works perfect on Windows but I need to use on my development machine based on Ubuntu 16.04.
I find this on git hub: https://github.com/fresco-fl2000/fl2000 and try to install it but installation fai... |
You should use Ubuntu 14 LTS instead of 16 LTS
This information is from https://github.com/fresco-fl2000/fl2000
On which kernel versions does this driver work?
This driver is tested on Ubuntu 14 LTS as well as some Android platforms with kernel version 3.10.x. This driver source might not compile on newer kernels (eg... | How to properly install USB display driver for Fresco Logic FL2000DX on Ubuntu? |
1,393,960,193,000 |
I have a PC Oscilloscope Instrustar ISDS205X which I used on Windows 10. Now that I have switched to Linux, I am unable to find the respective drivers for it. I have tried installing it on PlayOnLinux but the software doesn't install and so do its drivers.
Is there any method to convert such Windows drivers to run on ... |
In short: no.
To go further, a driver is a piece of software that interact with the kernel of the operating system.
When you're working in kernel world, interoperability doesn't exist. POSIX neither.
Everything is totally OS-specific: the architecture, the sub-systems and the way they have been built and designed, th... | Installing Proprietary Windows Drivers on Linux |
1,393,960,193,000 |
I have a Linux Mint 20.0 (Ulyana) Cinnamon, which is Ubuntu 20.04 (Focal) based.
Also tested and valid for Linux Mint 21.1 (Vera) Cinnamon, which is Ubuntu 22.04 (Jammy) based.
GPU: NVIDIA, GeForce GTX 1060, Max-Q Design, 6 GB GDDR5X VRAM
which has the basic specification as follows:
Objective
To install the latest... |
Disclaimer - please read before you try installing anything
Today, I ran into an old laptop, with Nvidia Geforce GT 520M, which is not supported by the latest driver anymore, version 390 works fine though. Therefore, I must strongly recommend running a search on the Nvidia drivers page before you try to install any dr... | How to install the latest Nvidia drivers on Linux Mint |
1,393,960,193,000 |
I've installed Linux Mint 18 on my machine, but it has a Radeon HD Graphics card, which is not supported by AMD on systems based on Ubuntu 16.04 (according to some research I did).
So, after the install the system was booting into a black screen and wouldn't go anywhere.
I did some research and found that I could edit... |
The xxx.modeset=0 disables kernel mode setting for the hardware. In other words, this option tells Linux not to try activating and using the incompatible hardware, which is likely the source of your problems. When this is used, your computer will still be functional, but without the benefits of hardware acceleration ... | Linux Mint with radeon.modeset=0 |
1,393,960,193,000 |
I've been trying to set up a virtual display with Xorg, but there's just no virtual display in xrandr.
This seems to be totally ignored:
Section "Device"
Identifier "Device1"
Driver "intel"
Option "VirtualHeads" "1"
EndSection
Specs:
OS: Debian Testing (Bullseye)
Nvidia proprietary d... |
The Device section with VirtualHeads is being ignored because you do not have an Intel card (your xorg.log indicates you have NVidia). Unfortunately the nvidia driver doesn't support virtual screens (the modesetting driver that's recommended for intel cards nowadays doesn't support it either, btw), and it's not possib... | Unable to add a VIRTUAL display to Xorg |
1,393,960,193,000 |
Why isn't the Linux module API backward compatible? I'm frustrated to find updated drivers after updating the Linux kernel.
I have a wireless adapter that needs a proprietary driver, but the manufacturer has discontinued this device about 7 years ago. As the code is very old and was written for Linux 2.6.0.0, it doesn... |
Greg Kroah-Hartman has written on this topic here: https://www.kernel.org/doc/html/v4.10/process/stable-api-nonsense.html
Besides some technical details regarding compiling C code he draws out a couple of basic software engineering issues that make their decision.
Linux Kernel is always a work in progress. This happ... | Why Linux module API isn't backward compatible? |
1,393,960,193,000 |
I'm running Ubuntu 16.04 on Lenovo ThinkPad T470s and quite simply, bluetooth appears to not exist, even though it is clearly in the computer according to all specifications available.
It appears that I'm missing a kernel driver. Sounds easy enough: except I cannot find any information on where to find this driver or ... |
This should solve your problem:
sudo apt-get install linux-generic-hwe-16.04-edge xserver-xorg-input-libinput-hwe-16.04
wget https://mirrors.kernel.org/ubuntu/pool/main/l/linux-firmware/linux-firmware_1.161.1_all.deb
sudo dpkg -i linux-firmware_1.161.1_all.deb
Do this, and reboot.
Source? Here, people facing the same... | Linux Bluetooth driver for Lenovo ThinkPad T470s |
1,393,960,193,000 |
Or is the kernel 100% open source?
|
Here is the link for your binary blobs.
Quote from the link:
Binary firmware blobs from the Debian non-free archive are installed
when no good Free Software alternative exists.
| Does Tails OS have binary blobs in its kernel? |
1,393,960,193,000 |
I'm trying to write a Linux driver for an existing USB device, based on captured USB communication.
The device has multiple configurations. Unfortunately, it seems like the device doesn't follow the USB specification: Only the first Set Configuration Request works. The device locks and eventually crashes on issuing a ... |
It seems there is a way to prevent the system from trying to set the device's configuration, and it even works from user space. I stumbled upon the commit that added this functionality to the kernel, and luckily it also includes some sample code.
User-space programs can declare ownership of a particular port of a USB ... | Prevent Linux kernel from setting USB device configuration |
1,393,960,193,000 |
I'm trying to compile drivers. do_posix_clock_monotonic_gettime was used in the source code and I'm made sure that the file had #include <linux/time.h>. I was getting implicit declaration when I tried to compile it. When I opened time.h file on my disk, it didn't have do_posix_clock_monotonic_gettime declared. Can som... |
The problem caused by removal of a #define do_posix_clock_monotonic_gettime
before kernel 4.0.
It used to be defined as:
#define do_posix_clock_monotonic_gettime(ts) ktime_get_ts(ts)
You could include that define into some of driver's headers.
Also, note that ktime_get_ts is defined in linux/timekeeping.h of 4.7.2.
... | do_posix_clock_monotonic_gettime is missing in linux/time.h |
1,393,960,193,000 |
i'm using Linux Mint.
I recently updated my workstation, and from this moment, my drivers went nuts. I was working fine before, with the nvidia-361 drivers, and, when i finished my updates, and after rebooting the PC, il was running in "software rendering mode".
I finally get to have a correct desktop, but now, i'm qu... |
After trying different things, this is what worked for me. I'd appreciate any suggestion or explanation if anything seems useless.
download the proprietary driver you want to use, from the nvidia website in my case:
NVIDIA-Linux-x86_64-375.39.run
go to your non-graphic mode (ctrl-alt-f1)
Kill your graphic proces... | How to switch nvidia driver from "nouveau" to nvidia proprietary |
1,393,960,193,000 |
I have a Fedora 19 install on a laptop, which has Intel integrated graphics & discrete AMD graphics. I have been using the radeon driver, which works for most stuff - though I have recently tried the fglrx driver, and found it to be quite a bit faster and have better power management, though some OpenGL based programs... |
I eventually just wrote a script that could be used to install and uninstall the driver, as well as set up the xorg.conf as my system required it:
#!/bin/bash
if [[ ! $(whoami) = "root" ]]; then
echo -e "\033[1;31mPlease run this as root\033[0m"
exit 1
fi
if [ "$1" = "enable" ]; then
echo -e "\033[22;34mI... | Stop fglrx from loading on boot/unload fglrx module without uninstalling it |
1,393,960,193,000 |
A question has been bugging my mind recently.
Since virtually all proprietary modules are out of tree (and therefore not compiled against any kernel versions), I'm wondering how exactly they are compiled and loaded.
Many major organizations allow for the download of a single .tar.gz, .deb or whatever and it just wor... |
The general approach is to ship an object file containing the proprietary code, and a “shim”, provided as source code, which is rebuilt for the appropriate kernels when necessary. The interface code handles all the module interface for the kernel, including symbol imports with version strings etc.
For example, NVIDIA ... | How do proprietary modules work for majority of kernel versions? |
1,393,960,193,000 |
UPDATED:
I have Linux Mint 18.1 running on an HP laptop.
VGA compatible controller: Intel Corporation Atom Processor Z36xxx/Z37xxx Series Graphics & Display...
I can install the drivers from https://01.org but the update tool fails 'make' (but ./configure runs clean) with error:
make[3]: Leaving directory '/home/Doc... |
Intel does not offer a proprietary driver, the packages on 01.org just exist to update the open-source drivers for select distributions(Fedora and Ubuntu). If you want a newer driver, you just need to update your kernel(for the driver) and mesa(for the userspace that goes with it).
| How do you install Intel proprietary drivers on Mint? |
1,393,960,193,000 |
I've tried to install and configure nvidia drivers on Linux Mint 18 but still have errors.
Can anyone help me?
See some errors:
wellington@wellington-mint18 ~ $ cat /var/log/Xorg.0.log | egrep -i "nvidia|nouveau"
[ 18.063] (==) Matched nvidia as autoconfigured driver 0
[ 18.063] (==) Matched nouveau as autoconfi... |
After I read it from NVIDIA site.You didnt need to do modprobe nvidia-375.But you should add NOMODESET in GRUB when the display was not right.I did some searches for you.
| Linux Mint 18 + Nvidia-375: modprobe: FATAL: Module nvidia_current not found in directory /lib/modules/4.4.0-21-generic |
1,393,960,193,000 |
I have a Linux Mint 20 Cinnamon Nvidia-based (GTX 1060) system and would like to install the latest Nvidia drivers now when I noticed they're out.
However, I can't seem to be able to install it with:
apt-get --dry-run install nvidia-driver-455
which throws up the following:
Reading package lists... Done
Building depe... |
Issue resolved, for some reason, there remained installed a meta-package of previously installed version: nvidia-driver-440. Reproduced on 3 laptops already, the offending package stays the same and is blocking the Nvidia from updating.
After updating the OS as a whole, I rebooted, and issued:
apt-get purge nvidia-dr... | Can't install nvidia-driver-455 (upgrade from 450 version) |
1,393,960,193,000 |
I'm using rtl8192cu on various distros and getting slow internet speeds on them, but on bodhi linux, since rtl8xxxu is available and loaded, I'm getting higher speeds.
I'm curious to know if it is possible to download the rtl8xxxu drivers and use them on other distros as well?
lsmod | grep rtl on bodhi linux returns:
... |
My network driver is rtl8192cu and I've just figured out there are some issues with this driver not only for me but many other users.
After digging deeply for hours,I found the following to be helpful for me.
Ensure you have the necessary prerequisites installed:
sudo apt-get update
sudo apt-get install git linux-head... | How to download and install rtl8xxxu driver? |
1,393,960,193,000 |
A few months ago I installed Debian 10 on my laptop, I have already managed to use it regularly for my daily activities, so I am starting to customize my settings.
And started by validating the drivers that are installed for each component of my laptop. I have a Dell Inspiron 15-3567 laptop
According to the details of... |
I believe the 'Host Bridge' that lspci is referring to is the PCI host bridge that connects the CPU to the PCI bus. I have a 3rd generation Core i5 and my host bridge description says:
00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor DRAM Controller (rev 09)
I think what it means is that ... | How to update the driver used by the Debian Linux kernel for my processor? |
1,393,960,193,000 |
On every reboot my Linux Mint deletes /etc/init.d/xorg.conf so it doesn't boot the graphical interface, so I have to go to CTRL + ALT + F2 every time and copy a backup I have in my home directory using sudo cp then run /etc/init.d/mdm start.
It basically doesn't find the file. Another solution is running sudo nvidia-x... |
Reconfigure X:
Xorg -configure
it will generate a new file xorg.conf.new , copy it to /etc/X11/xorg.conf:
cp xorg.conf.new /etc/X11/xorg.conf
You can create and set up /etc/X11/xorg.conf.d/20-nvidia.conf manually without using nvidia-xconfig ; e,g:
#/etc/X11/xorg.conf.d/20-nvidia.conf
Section "Device"
Identifie... | Linux Mint 18 deletes /etc/init.d/xorg.conf on every reboot and fails to start x-server |
1,676,638,646,000 |
Hello fellow Debian Users,
I recently purchased a Dell Optiplex 790, Installed Debian 10.9 and put an ATI Saphire card in it. Needing drivers to fix screen discoloration upon display size change, I added the FGLRX proprietary driver. Now I needed to setup some applications like OBS studio and I can't seem to find them... |
The main repository is missing in your sources.
You need to add at least
deb http://deb.debian.org/debian buster main
to /etc/apt/sources.list (see Example sources.list) and reload the package index with
sudo apt update
in the terminal or choose "Reload Package Information" (Ctrl + R) in synaptic.
| some APT packages are not showing up in Debian Buster after FGLRX install. how do I fix this? |
1,676,638,646,000 |
So, Mint 19 surprised me in the update manager with Nvidia's 465 driver, and I attempted to install it; but all it did (it's hard to tell if it even downloaded anything) was inform me that it "Could not apply changes! Fix broken packages first."
There is, concerningly, no note on which package is broken, and I don't ... |
#!/bin/bash
# script: list-nvidia.sh
# author: Craig Sanders <[email protected]>
# license: Public Domain (this script is too trivial to be anything else)
# options:
# default/none list the packages, one per line
# -v verbose (dpkg -l) list the packages
# -h hold the packages with apt-ma... | How do I handle this "broken packages" problem with Nvidia 465 on Mint 19? |
1,676,638,646,000 |
I try to install KDE Neon 18.04 on my Dell Laptop (from USB drive).
The installer asks me if I want to use third party software/drivers. Yes, I want to use them (when available).
Directly below that option I am allowed to configure Secure Boot. When ticking that checkbox I need to set a password for Secure Boot.
Direc... |
More and more Linux distributions are adding the necessary facilities for full support of Secure Boot. That can include include configuring Secure Boot with a custom certificate, and signing third-party modules using that certificate when installed using the distribution's standard procedure. If the provider of the th... | Neon installation - Secure Boot vs third party drivers |
1,676,638,646,000 |
I'm using Linux Mint. I already know how to do it in Windows but I'd like to know how to upgrade. I'm going to be changing from a GT 610 to a GTX 950. Is there anything I need to change like drivers?
|
I'll finish this as an answer. Mint should be able to detect the change and fix any problems. So:
Shutdown
Replace card
Boot
That being said, as a safety precaution, since things do go wrong sometimes, download the Nvidia drivers from their website. Before making the switch.
If something goes wrong you will boot... | What is the proper procedure for upgrading a nvidia card? |
1,676,638,646,000 |
I tried to install AMD graphics without reading. My CrunchBang crashed and now every time I try to login, my keyboard inputs don't go into the login screen. I can reset X with Ctrl+PrtScn+K and it resets but same issue appears. How can I fix that and any other driver issues that may have evolved from my ignorance?
|
First of all, this solution is for debian, I don't know if it works for crunchbang, but I think it should.
It's a pretty easy thing. All you have to know is the date when the new version of drivers (or xorg) was added to the repository. You can check it here: http://packages.qa.debian.org/f/fglrx-driver.html
If you're... | How Can I Reset Graphics Drivers and Restore Defaults? |
1,676,638,646,000 |
I'm having trouble getting my bluetooth hardware to work. I have an ASUS PCE AX3000 wifi card and the wifi works ok (maybe some problems with it glitching out occasionally, I think it's a power management issue, but I can live with it). I am using Linux Mint 20.1 Kernel 5.4.0-70-generic. The main problem is the blue... |
Hardware was not installed correctly. I reinstalled the card, and it now seems to work. Sorry for the false alarm.
| trouble getting bluetooth to work |
1,676,638,646,000 |
On my network I want to use driverless printing with IPPEverywhere using the Linux CUPS printing system.
I have some network printer which does support driverless printing with IPP only very buggy. One does not print some pdf files, the other doesn't print more than one copy and so on. But they all print very well usi... |
At time I use a partial solution that can only be used with Linux devices on the network but not as general printing solution for also mobile devices. But to have it documented I will share it. Maybe there are some pointers or answers from the community so we get the final solution.
I assume the Printer is successful ... | CUPS driverless print server as proxy for printers with legacy PPD printer drivers |
1,676,638,646,000 |
TL;DR: Is there a way to get nvidia-304 driver to work with newer Linux kernels (on any distro) with some patches? Have you any suggestions about choosing a good distro?
I have recently fixed an old desktop computer a friend gave me. It has a very old Nvidia GeForce 6100 that needs the nvidia-304 legacy driver. As I a... |
I have solved the issue by upgrading to a Nvidia GT710. It's not a good card but it is very cheap and is supported by the latest Nvidia drivers. As I do not intend to use my old PC to perform graphics-related tasks, I am satisfied with my upgrade.
| Old Nvidia GPU and Linux |
1,676,638,646,000 |
I recently installed Linux lite. I went to change from the nouveau driver to the Nvidia legacy updates driver, restarted my pc. I remember being prompted to have default Xfce or something else and I think I clicked ok but can't remember. Then my whole Xfce system went from the normal Xfce setup that comes when you in... |
I fixed the issue by following the steps to some guide on how to re-size encrypted partitions.
This answer is just to close this thread.
| After switching to the nvidia video card driver, the whole xfce setup messed up |
1,676,638,646,000 |
I would like to know whether all the firmware is copied to my PC if I install a non-free Linux distribution. What I mean is does the firmware of all the devices like WiFi adapters, keyboards etc. get copied to my PC even if my PC does not use those devices? Will this unnecessary firmware bloat/slow down the kernel?
|
Typically, when you install a Linux distribution, firmware gets installed into /lib/firmware. When firmware is needed for a device, the Linux kernel looks in that directory for the right firmware file and loads it into the device.
It depends on the distribution which firmware files are installed (by default), but ofte... | Does all the non-free firmware get copied to my system if I install a non-free Linux distribution? |
1,676,638,646,000 |
So, I am running CentOS 7 on my laptop and all seems almost OK. Now I'm trying to install the video card driver.
# lspci -nn
...
01:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Chelsea LP [Radeon HD 7730M] [1002:682f]
...
I have found this thread from U&L and have downloaded the zip fi... |
You're missing (at least) rpmbuild tool:
./packages/RedHat/ati-packager.sh: line 221: rpmbuild: command not found
This (according to CentOS wiki) should be in rpm-build package which can be installed by running yum install rpm-build.
| how can I build Radeon proprietary drivers for CentOS 7? |
1,676,638,646,000 |
Question:
I would like to re-install the nvidia driver on a 32 bit ARM computer running Linux for Tegra (L4T), however I don't know what the correct version of this driver is, where to get it, or how to install it properly.
Background:
I am trying to connect to an NVidia Jetson TK1 (32 bit ARM computer) using remote... |
Refer here: https://developer.nvidia.com/embedded/linux-tegra
And you can find whole required materials about Jetson here:
https://developer.nvidia.com/embedded/downloads
http://developer.nvidia.com/embedded/dlc/l4t-Jetson-TK1-Driver-Package-R21-5
http://developer.nvidia.com/embedded/dlc/l4t-Jetson-TK1-Sample-Root-... | How can I determine which driver to re-install on my Nvidia Jetson TK1? |
1,676,638,646,000 |
I'm on manjaro, I have deskjet 1050 printer/scanner. I installed hplip from AUR for the scanner to work.
It asks me for ppd file for deskjet 1050, what's a ppd file and how to get it?
It's this one, HP Deskjet 1050 All-in-One Printer - J410a, the first one in the table
|
I hate to tell you this, but I have bad news:
Start at the Linux Foundation Open Printing Project Database.
Click Printer Listing.
On the Printer Listing Page, choose Manufacturer: HP, and Model: deskjet 1050 j410a.
Click Show This Printer, and arrive at this results page
The results Page states:
Color inkjet print... | ppd file for deskjet 1050 |
1,676,638,646,000 |
I'm using Debian 12 Bookworm, and currently, when I run uname -a, it shows:
Linux pctxd 6.1.0-20-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.85-1 (2024-04-11) x86_64 GNU/Linux
The package linux-image-6.1.0-21-amd64 and related packages are ready to install. However, the corresponding linux-headers-6.1.0-21-amd64 package... |
The kernel image and headers packages come from the same source package, so they are available simultaneously on the mirror network (barring failures on a specific mirror). If you follow the amd64 link on the linux-headers-6.1.0-21-amd64 package page, you’ll find a package download link which works; that’s the package... | How to defer kernel updates until the corresponding "linux-headers" package is available? |
1,676,638,646,000 |
NOTE:
I have above average Linux experience but not an elite.
I have an Nvidia GTX 1650 laptop card.
I use Linux XanMod CacULE kernel.
I use the latest Mesa and Nvidia drivers from
http://ppa.launchpad.net/kisak/kisak-mesa/ubuntu and
http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu
I installed Elementary O... |
It is really easy to solve
Solution with explanation:
cd /var/cache/apt/archives/
ls -al
#list packages installed
sudo rm -rf initramfs-tools*
#removes the problem files
sudo apt update
#updates software cache
sudo apt --fix-broken install
#looks for other problems and solve it
sudo apt install initramfs-tools*... | Regular update broke initramfs on Elementary OS 6 |
1,676,638,646,000 |
I have built a portable Linux installation on USB. In my pursuit of working on all x86_64 systems,I have successfully got it to work in both BIOS and UEFI environments, and also added Mac-specific wifi drivers and got them to work. I want to clear the roadblock of GPUs.
So what I'm specifically looking to know is that... |
So what I'm specifically looking to know is that if I install Nvidia drivers, this means that the kernel will auto-load these when booting from a system using an Nvidia GPU, correct ?
Correct.
This will still mean that I can boot from an IntelHD or AMD system flawlessly, and just as from a clean Linux install, corr... | Question Regarding Nvidia GPU drivers and how Linux auto-loads them |
1,342,452,810,000 |
Question
I'd like to be able to run a UNIX command precisely every second over a long time period.
I need a solution, which does not lag behind after a certain time, because of the time the command itself needs for execution. sleep, watch, and a certain python script all failed me in this regard.
On the microcontrolle... |
How does this Perl script I just whipped up work?
#!/usr/bin/perl
use strict;
use warnings;
use Time::HiRes qw/time sleep/;
sub launch {
return if fork;
exec @_;
die "Couldn't exec";
}
$SIG{CHLD} = 'IGNORE';
my $interval = shift;
my $start = time();
while (1) {
launch(@ARGV);
$start += $interva... | Run unix command precisely at very short intervals WITHOUT accumulating time lag over time |
1,342,452,810,000 |
Is there a command line tool which shows in real time how much space remains on my external hard drive?
|
As Julie said, you can use df to display free space, passing it either the mount point or the device name:
df --human-readable /home
df --human-readable /dev/sda1
You'll get something like this:
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 833G 84G 749G 10% /home
To run it continuously, use watch. Defa... | Real time cmd tool to show HDD space remaining |
1,342,452,810,000 |
When developing a solution that requires a real-time operating system, what advantages would an operating system such an QNX or VxWorks have over Linux?
Or to put it another way, since these operating system are designed specifically for real-time, embedded use - as opposed to Linux which is a more general system th... |
Some embedded systems (a) need to meet difficult real-time requirements, and yet (b) have very limited hardware (which makes it even more difficult to meet those requirements).
If you can't change the hardware, then there are several situations where you are forced to rule out Linux and use something else instead:
Pe... | Advantages of using a RTOS such as QNX or VxWorks instead of Linux? |
1,342,452,810,000 |
I am trying to create a raspberry pi spy cam bug.
I am trying to make it so the new file created for the various processes come up with
NOW=`date '+%F_%H:%M:%S'`;
which works fine.
but it requires an echo to update the time
$NOW is also in the /home/pi/.bashrc file
Same issue, does not update wo
. ~/.bashrc
I fou... |
When you do
NOW=`date '+%F_%H:%M:%S'`
or, using more modern syntax,
NOW=$( date '+%F_%H:%M:%S' )
the variable NOW will be set to the output of the date command at the time when that line is executed. If you do this in ~/.bashrc, then $NOW will be a timestamp that tells you when you started the current interactive s... | Current time/date as a variable in BASH and stopping a program with a script |
1,342,452,810,000 |
If I do the following command on my standard Linux Mint installation:
comp ~ $ ps -eo rtprio,nice,cmd
RTPRIO NI CMD
...
99 - [migration/0]
99 - [watchdog/0]
99 - [migration/1]
- 0 [ksoftirqd/1]
99 - [watchdog/1]
I get some of the processes with realtime priority of 99.
What is the meaning of rtprio in a n... |
"Real time" means processes that must be finished by their deadlines, or Bad Things (TM) happen. A real-time kernel is one in which the latencies by the kernel are strictly bounded (subject to possiby misbehaving hardware which just doesn't answer on time), and in which most any activity can be interrupted to let high... | Real time priorities in non real time OS |
1,342,452,810,000 |
Are there any linux/unix console applications similar to Yadis that would allow me to:
be set up from the console
backup multiple directories
backup / sync in real time after the files (text files) are changed
Update 1:
I write shell scripts, ruby scripts, aliases etc etc to make my work easier. I want to have back... |
You could probably hack this together using inotify and more specifically incron to get notifications of file system events and trigger a backup.
Meanwhile, in order to find a more specific solution you might try to better define your problem.
If your problem is backup, it might be good to use a tool that is made to ... | real time backup if file changed? |
1,342,452,810,000 |
Examining the output of kill -l command
$ kill -l
1) SIGHUP 2) SIGINT 3) SIGQUIT 4) SIGILL 5) SIGTRAP
6) SIGABRT 7) SIGBUS 8) SIGFPE 9) SIGKILL 10) SIGUSR1
11) SIGSEGV 12) SIGUSR2 13) SIGPIPE 14) SIGALRM 15) SIGTERM
16) SIGSTKFLT 17) SIGCHLD 18) SIGCONT 19) SIGSTOP 20) SIGTSTP
21) SIGTTIN 22) SIGTTOU ... |
The answer to this question can be found in signal(7) man page, in Real-time Signals section
Real-time Signals
Linux supports real-time signals as originally defined in the POSIX.1b real-time extensions (and now included in POSIX.1-2001). The range of supported real-time signals is defined by the macros SIGRTMIN and ... | Why is the integer value of SIGRTMIN (first real-time signal) 34 and not 32? [duplicate] |
1,342,452,810,000 |
To display content of pcap file , we use :
tcpdump -r /Path/to/syscontection.pcap;
However, this command line does not follow the pcap file on realtime , like tail -f which follows a plain text .
Is there an option with tcpdump which acts like -f of tail ?
OR
Is there an option with tail that can read pcap fil... |
tail -c +1 -f /Path/to/syscontection.pcap | tcpdump -l -r -
| "tail -f" using "tcpdump -r" |
1,342,452,810,000 |
The output of cat /sys/devices/system/clocksource/clocksource0/available_clocksource lists the available hardware clocks.
I have changed the clocks, without any visible difference.
sudo /bin/sh -c 'echo acpi_pm > current_clocksource'
What are the practical implications of changing the hardware clock?
Is there a way t... |
Well, first of all, the kernel chooses the best one automatically, it is usually TSC if it's available, because it's kept by the cpu and it's very fast (RDTSC and reading EDX:EAX).
But that wasn't always the case, in the early days when the SMP systems were mostly built with several discrete cpus it was very importan... | What does the change of the clocksource influence? |
1,342,452,810,000 |
How can I set up an instant file sync for two local directories? The catch is I need it in real time (15, 10 or even 5 seconds is too slow), and I don't want the target root directory created.
For example, something similar to...
cp -fr sourcea/* /some/destdir
cp -fr sourceb/* /some/destdir
cp -fr sourcec/* /some/des... |
A filesystem overlay would probably work better for this. Using something like aufs you can create a 'virtual' directory out of several combined directories. You can configure whether writes should propagate back to the original directories, or use a copy-on-write method to leave the originals alone, or disallow write... | Real Time Local File Sync |
1,342,452,810,000 |
How to properly identify real-time processes currently occupied CPU queue and count them using ps? I know there is a bunch of fileds like prio,rtprio,pri,nice but do not know correct to use. It seems I need use something like ps -eo rtprio,prio,cpu,cmd --sort=+rtprio to get full list, but it do not seems for me right ... |
A list of non-zero CPU % processes:
ps -eo pid,tid,class,rtprio,ni,pri,psr,pcpu,stat,wchan:14,comm --sort=+pcpu | awk '$8!=0.0 {print}' | awk 'NR>1'
To count them
ps -eo pid,tid,class,rtprio,ni,pri,psr,pcpu,stat,wchan:14,comm --sort=+pcpu | awk '$8!=0.0 {print}' | awk 'NR>1' | wc -l
To see this continuously updated,... | How to sort ps output to find processes realtime priority and identify processess currently occupied running queue |
1,342,452,810,000 |
I'm trying to get the nearest to real-time processing I can with a Raspbian distribution on a Raspberry Pi for manipulating its GPIO pins. I want to get a "feel" for the kind of performance I can expect.
I was going to do this by writing a simple C program that toggles a pin repeatedly as fast as possible, and monitor... |
I don't have an answer but you might find one amongst the tools, examples and resources written or listed by
Brendan Gregg on the perf command and Linux kernel ftrace and debugfs.
On my Raspberry Pi these tools were in package perf-tools-unstable. The perf command was actually in /usr/bin/perf_3.16.
Of interest may ... | Record time of every process or thread context switch |
1,342,452,810,000 |
In the Linux Kernel CONFIG_NO_HZ is not set. But an initial reading suggests that setting that option would be nice from a performance point of view. But reading some posts like this made me think again.
Why CONFIG_NO_HZ is not set by default or why no performance improvement when it is enabled?
|
The performance improvement is not visible to everyone, just certain users for which RT kernels really matter : DSP, audio/video processing, and so on. So that config option is not universally beneficial, hence disabled.
| Why CONFIG_NO_HZ is not set by default |
1,342,452,810,000 |
I want to make a shell script that finds all active processes and to print to the user the scheduling policy.I want the result to be like this.
pid 3042's current scheduling policy: SCHED_OTHER
pid 3042's current scheduling priority: 0
pid 3043's current scheduling policy: SCHED_OTHER
pid 3043's current scheduling pri... |
I found two ways for doing it - which may not be optimal, but they get the job done:
#! /bin/bash
ps -u | grep '[0-9]' | awk '{print $2}' |
while read line
do
chrt -p "$line" 2>/dev/null
done
ps -u | grep '[0-9]' | awk '{system("chrt -p" $2)}' 2>/dev/null
| How to find scheduling policy and active processes' priority? |
1,342,452,810,000 |
There's a question over at audio.SE at the moment and I thought it may attract some answers here. I asked the user and he's happy to have it posted here to see if anyone has some ideas. Here it is verbatim:
I'm working with a client who needs to minimize the time between when recording is done and when the finalized ... |
Well, you could do it with some command line tools.
cdrecord (wodim on debian) can burn audio CDs on the fly, but it needs an *.inf files that specify track sizes etc. You can generate an inf file upfront with a dummy CD that has (say) one large audio track (74 minutes) using cdda2wav (icedax on debian).
In the live s... | Is it possible to record audio directly to a computer's optical drive? |
1,342,452,810,000 |
Trying to get working LinuxCNC on my Debian Jessie, I did:
Installed the kernel 4.9 RT through Jessie backport using apt-get/aptitude.
Restarted my computer and checked uname -a contain PREEMPT RT
Installed LinuxCNC by adding the repository and using apt-get
After that, starting the linuxCNC wizard (by normal clicks... |
I wonder if there is any PREEMPTION configuration to enable, or specific way to run an application to get more precise real-time?
See the following:
http://wiki.linuxcnc.org/cgi-bin/wiki.pl?Latency-Test
which links to this:
https://forum.linuxcnc.org/18-computer/25927-reducing-latency-on-multicore-pc-s-success?limit... | How to run real-time application in Linux? |
1,342,452,810,000 |
I did not see any similar questions on this site. The manpage, while helpful in describing how to use date, did not have much background info. Even the info page (as prescribed in the manpage: info '(coreutils) date invocation'), had little more than how it operates based on the TZ variable.
I'm wondering how the dat... |
date makes no effort to synchronize with anything at all, and merely makes some system call (that on linux a strace date ... may or may not show) to lookup the time since the epoch as known by the system.
The system itself may synchronize with the BIOS clock, or if a virtual machine may obtain the current time from th... | how does the gnu coreutils `date` work? [closed] |
1,342,452,810,000 |
Does the PREEMPT_RT patch (real-time kernel) have any benefit for regular desktop users?
|
I don't think so. The patch seems to provide real-time scheduling which is very important for some enviroments (planes, nuclear reactors etc.) but overkill for regular desktop. The current kernels however seems to be enough "real-time" and "preemptive" for regular desktop users[1].
It may be useful if you work with hi... | Does the Linux PreemptRT patch benefit desktop users? |
1,342,452,810,000 |
I am using the command socat to port forward a connection from a real-time live stream.
TCP4-LISTEN:8080 TCP4:123.456.789.12:80
The problem is it has added delay and low fps while the live stream without port forwarding works perfectly without delay and high fps.
What might it be causing this?
Is there a way to fi... |
I'm not an expert on socat, but after a quick view to its name (SOcket CAT), it seems that it goes through opening two sockets and operating them in user-space.
As slm suggests, why do not configuring it via iptables?
Iptables is a user-space application which configures netfilter. Netfilter code is embedded in the ke... | Port Forwarding without delay and high fps in a real time live stream using socat |
1,342,452,810,000 |
From here: http://www.xenomai.org/index.php/RTnet:Installation_%26_Testing#Debugging_RTnet
The Linux driver for the real-time network device was built into the kernel and blocks the hardware.
When I execute rmmod 8139too it says the module does not exist in /proc/modules.
Kernel is 2.6.38.8 (64 bit).
What other in... |
rmmod 8139too doesn't work because either:
8139 support is built into the kernel, and the driver can't be unloaded because it's not a module. On many systems, there's a /boot/config-2.6.38.8 file (or similar). You can grep it for something like ‘8139TOO’. If you see something like CONFIG_8139TOO=m, then the 8139too d... | How to know whether the Linux driver for the real-time network device was built into the kernel? |
1,342,452,810,000 |
With the real-time executive approach, a small real-time kernel coexists with the Linux kernel. This real-time core uses a simple real-time executive that runs the non-real-time Linux kernel as its lowest priority task and routes interrupts to the Linux kernel through a virtual interrupt layer.
All interrupts are init... |
This sounds very much like the approach taken by RTLinux, which still seems to be available but not commercially supported.
That being said, there's a community unto itself about real-time Linux concepts, and the CONFIG_PREEMPT_RT patch would seem to enable the functionality you're looking for. As with all kernel hack... | Real-time executive approach, can be run in desktop Linux? |
1,342,452,810,000 |
Unlike the answer to this question (Can a bash script be hooked to a file?) I want to be able to see content of files that haven't been created yet as or after they are created. I don't know when they will be created or what they will be named. That solution is for a specific file and actually mentions in the quest... |
If on Linux, something like this should do what you are looking for:
inotifywait -m -e close_write --format %w%f -r /watch/dir |
while IFS= read -r file
do
cat < "$file"
done
| Is there a way to cat files as they are created? [duplicate] |
1,342,452,810,000 |
I have a piece of C++ code that runs just fine when I run it from a Linux terminal, but which throws an EPERM error when run from a SystemV (init.d) script on bootup. The error comes from a pthread_create with the following bit of attributes assigned to the thread attempting to be created:
pthread_t reading_thread;
p... |
The answer seems to have been to put the following in my init.d script, which I put just before the start-stop-daemon calls in do_start:
ulimit -r ## (where ## is a sufficiently high number; 99 works)
The way I was able to determine this was by making system calls to ulimit -a inside of a bash command inside of my co... | realtime pthread created from non-realtime thread with init.d |
1,342,452,810,000 |
I looking for a way to start a real-time process or set a running process as a real-time process.
|
To start/set a process as real-time, you should use chrt
Usage to start a new process:
chrt [options] priority command [arguments...]
Usage to set a running process:
chrt [options] -p priority PID
Example:
sudo chrt -r 70 <your command>
or
<your command> &
sudo chrt -r -p 70 $!
| How to start a realtime process? |
1,342,452,810,000 |
I am trying to compile the 5.4 kernel with the latest stable PREEMPT_RT patch (5.4.28-rt19) but for some reason can't select the Fully Preemptible Kernel (RT) option inside make nconfig/menconfig.
I've compiled the 4.19 rt patch before, and it was as simple as copying the current config (/boot/config-4.18-xxx) to the... |
Please enable EXPERT mode after launching make nconfig/menuconfig. Then you'll be able to select Fully Preemptible Kernel (RT) option.
| Trouble selecting "Fully Preemptible Kernel (Real-Time)" when configuring/compiling from source |
1,342,452,810,000 |
I would like to change the perception of real time for one process.
Making the process believe that time is passing at 50% or 150% of the speed my system/kernel/hardware-clock thinks.
I'd like to find a generic solution that can be used with any program, without having to patch the program's source code.
Is there any ... |
That's what the faketime command is designed for. For instance:
$ time faketime -f '+0 x10' sh -c 'date +%T; sleep 10; date +%T'
13:29:02
13:29:12
faketime -f '+0 x10' sh -c 'date +%T; sleep 10; date +%T' 0.00s user 0.00s system 0% cpu 1.009 total
Started that shell with the clock going 10 times as fast as normal (t... | Change perception of real time for one process |
1,342,452,810,000 |
As stated in the man pages:
A SCHED_FIFO thread runs until either it is blocked by an I/O
request, it is preempted by a higher priority thread, or it calls
sched_yield(2).
From the same source:
SCHED_DEADLINE threads are the
highest priority (user controllable) threads in the system; if any
SCHED_DEADLINE thread is r... |
The manpage is correct. It should not be hard to find confirmation of this.
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/include/linux/sched/deadline.h#n5?h=v4.10
/*
* SCHED_DEADLINE tasks has negative priorities, reflecting
* the fact that any of them has higher prio than RT and
* NORMAL/... | Can SCHED_FIFO be preempted by SCHED_DEADLINE? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.