Skip to content

Linux – Sort files by part of name (no delimiters)

I want to get a sorted list of files. Files have the following naming convention: DATENUMBER.txt (without spaces). E.g., file 3 on 2015-12-09 looks like: 201512093.txt The version sort option of ls doesn’t help me: sort -V, –key=1.[number] do not work too as I have different filename length. As I …

replacing “”” by empty character

I need to replace ” (ASCII value 34) char by empty character “”. In output, instead of quote i get an “?” question mark character. I tried to use things like: My code: Any ideas how to fix that? For clarification: the strings in mystring are like: “hello” “place…

Convert int to hex and make terminal read it as hex

I am trying to convert an integer to hex. I have found answers that address this problem like this, though they do not work for me. What i mean: if i take this: and i run it from console with python myfile.py then the output is something like this: ���t$���ʈ�Z), which is what i want (the output has been read…