Categories
Development Linux

Are shells allowed to ignore NUL bytes in scripts?

Because that’s what some of them are doing. > echo echo Hallo, Baby! | iconv -f utf-8 -t utf-16le > /tmp/hallo > chmod 755 /tmp/hallo > dash /tmp/hallo Hallo, Baby! > bash /tmp/hallo /tmp/hallo: /tmp/hallo: cannot execute binary file > (echo ‘#’; echo echo Hallo, Baby! | iconv -f utf-8 -t utf-16le) > /tmp/hallo > […]

Categories
Development Linux

Mass file renaming from from text file

I have a folder with about 7,000 files and each file is numbered e.g. 74857.mkv 74858.mkv etc. I also have a text file which has all the file numbers and file names: In this order: I would like to rename each file from its number to its name; an example: 74857.mkv > Taken S01 E01.mkv […]

Categories
Development Linux

Mass file rename

I would like to mass rename/remove spacing between all my files as below: TO Basically I want to remove the spacing between SXX EXX on all files in the directory. The other files are named different but the pattern is the same on all of them, they end with SXX EXX Thanks for your help […]

Categories
Development Linux

Syntax error: “(” unexpected

!/bin/sh # ### se ingresa nombre de usuario y contraseña? if [ $# -ne 2 ] then echo “Se requiere nombre de usuarios y contraseña.” echo “Ejemplo:” echo “sh script-sesiones usuarios contraseña” exit fi USUARIO=$1 PASSWORD=$2 ### se esta ejecutando como root? yo=$(whoami) if [ “root” = $yo ] then echo “” else echo “Este […]

Categories
Android Development Linux

How can I know the hostname of an Android phone for use in SSH connection?

When setting up public key authentication on SimpleSSHD server on my Android phone, by http://www.galexander.org/software/simplesshd/ Quick start Install SimpleSSHD. On any computer which will connect to your Android device, set the port to 2222. With OpenSSH, this can be done by putting these lines in ~/.ssh/config: Host myphone Port 2222 Launch SimpleSSHD, and in Settings […]

Categories
Development Drivers Linux

Error installing WiFi driver make[1]: *** No rule to make target ‘modules’. Stop

I just got a WiFi dongle that is ostensibly Linux compatible, with 802.11 ac standard. If I can’t get it to work I can take it back and get a refund. I just ran the install script and got this output with error: https://gist.github.com/jamesray1/b855bb63384bb138b1d6b042c5530d41 This is the last part with the make error: Authentication requested […]

Categories
Development Linux

How to use zgrep to find out what line number or give some contextual info. surrounding a .gz file

In Debian you can use zgrep to grep through a gunzipped archive file. The reason for making a gunzip file is easy enough, files such as changelogs are vast which can be highly compressed. The issue is with zgrep you only get a specific line and no above or below info. to give contextual info. […]

Categories
Development Linux

How to monitor changes in file filled by null bytes?

I have a 10Mb file filled by null bytes. A program is accessing it and changes zeros to specific strings up to the end of the file. I’ve tried to use tail -F | grep wanted_text | grep -v “unwanted_text”, but it does not monitor changes. It only works for usual text files, but not […]

Categories
Development Linux

how to merge multiple files based on matching of the first two columns?

I am new to linux. I am struggling with a question,how to merge multiple files based on matching of the second column?but keep the first column. For the example the file1, file2,file3,the second column is a sub category of first column, for example, the A has three values, 19 20 23. file1 A 19 0.5 […]

Categories
Development Linux

File keeps reappear every time I delete it CentOS 7

I’m cleaning a directory on the CentOS 7 server over SSH and can’t delete one file. It is deleted without errors and reappears with size 0 in a moment after I’m deleting it. I’ve tried: rm sudo rm Midnight Commander F8 If I remove directory completely or rename it file disappear. But if directory exists […]