Skip to content

Tag: linux

how to move to the end of line in screen linux

If CTRL+A+a is how you move to the beginning of a line in screen then what is the shortcut key to go to end of the line aside from the End key in screen. I tried CTRL+A + I like in vim. no luck. Also OT: if you exit a shell will the session persist? Answer CTRL + E will

Grouping child processes with setpgid()

I just don’t get the whole thing. My process tree: I want to make a process group (3, 4, 5), and send this group a signal from, say, 2. I tried it this way: Where should I place my setpgid() block? I tried placing it in 3, 0 and every other process, but setpgid()s return either “No such process&#8…

Insert into mysql from linux terminal

I have a question. i can insert into mysql database from linux terminal a record with this command: Now i have a file in Linux with some records for example: i don’t know how can i insert all records to the file to mysql database from linux terminal. I intent with a bash file but i don’t know =( A…

Edit linux capabilities in Perl

In a C program, you can edit your capabilities with cap_set_proc from libcap. How can I achieve the same in a Perl program? Answer Linux::Prctl may meet your needs. If not, you can use syscall() and try to do it the hard way. If that’s unpalatable, too (and I would find it so), I’m sure CPAN would…

subversion pre-commit hook error code 255

I added pre-commit hook script to the repository. It always gives below error while committing: I have already checked that my pre-commit script is having executable permission and its a bash script. is added in the beginning of the file. Even if I write in the beginning of the file, it is not allowing me to …

how to extract a substring in bash

I have the following string in bash with length > 4 and I want to extract into str2 the 5 first charachter of str. So How to do it with bash? Answer Do use the expression So in this case: See other usages: Taken from: – wooledge.org – How can I use parameter expansion? How can I get substrings?…