I'm wrong folder and delete a list of very important python files! How can I configure the rules in foremost to recover them? and using Debian O.S  /etc/foremost.conf   CONFIGURATION FILE               The configuration file is used to control what types  of               files  foremost  searches  for.  A  sample configuration               file, foremost.conf, is included with this distribution.               For each file type, the configuration file describes the               file’s extension, whether the header and footer are case               sensitive,  the  maximum  file  size, and the header and               footer for the file. The footer field is  optional,  but               header, size, case sensitivity, and extension are not!                Any  line  that begins with a pound sign is considered a               comment and ignored. Thus, to skip a file type just  put               a pound sign at the beginning of that line                Headers and footers are decoded before use. To specify a               value in hexadecimal use \x[0-f][0-f], and for octal use               \[1-9][1-9][1-9].   Spaces  can  be  represented  by \s.               Example: "\x4F\123\I\sCCI" decodes to "OSI CCI".                To match any single character (aka a wildcard) use a  ?.               If you need to search for the ? character, you will need               to change the wildcard line *and*  every  occurrence  of               the old wildcard character in the configuration file. Do               not forget those h   but file .py python and .js javascript
38463
Has anyone had success recovering deleted files from an ext4 partition? I've tried various utilities, but none have worked yet. I'd be grateful if someone can share a success story!
51800
When I use the search function in  it only returns files with matching file names. It doesn't even support wildcards. For example, "*.txt" doesn't return anything. I would expect it to return all .txt files.  Anyway, is there a way, without using the command line, to search the contents of files, including all plain text files (.txt, .html, .css, .js, .c, .csv, .sh, .py, ...), archives (.zip, .7z, .rar, .tar, ...), office/libreoffice files (.doc, .docx, pptx, .odf, .ods, ...), and media (.mp3, .mp4, ...) meta data? The search should also have the option of setting file size, date, type, and being case insensitive.
115094
Dealing with a whole bunch of two-line config files, I'd like a way to exclude any files that have a different number of lines.  So, something like:  mv * destdir only if file contains exactly two lines   Or:  wc -l * | grep '^ *2' | xargs mv {} destdir   Except that neither of those is actual working code.  While writing this I realized I do have a way to do this, which is ugly as heck, and I've included it below as an answer.  Is there an easy/clean way to do this?
46458
I have many files with .abc extension and want to change them to .edefg How to do this from command line ?  I have a root folder with many sub-folders, so the solution should work recursively.
64880
This is a follow-up question to . Consider the MWE:  \documentclass{article} %\usepackage{etoolbox}% http://ctan.org/pkg/etoolbox \usepackage{filecontents,listings}% http://ctan.org/pkg/{filecontents,listings} \lstset{   numbers=left,   basicstyle=\ttfamily\footnotesize } \begin{filecontents*}{mycode.txt} Line 1 Line 2 Line 3 Line 4 Line 5 \end{filecontents*}  \makeatletter % https://tex.stackexchange.com/q/26828/5764 %\patchcmd{\lst@GLI@}% &lt;command&gt; %  {\def\lst@firstline{#1\relax}}% &lt;search&gt; %  {\def\lst@firstline{#1\relax}\def\lst@firstnumber{#1\relax}}% &lt;replace&gt; %  {\typeout{listings firstnumber=firstline}}% &lt;success&gt; %  {\typeout{listings firstnumber not set}}% &lt;failure&gt; \makeatother  \begin{document} \lstinputlisting[linerange={1-3}]{mycode.txt} \lstinputlisting[linerange={2-4}]{mycode.txt} \lstinputlisting[linerange={2-2,4-5}]{mycode.txt} \end{document}   Without the aid of the  patch (or the default), the output looks like that of the leftmost column. With the aid of the patch (a "firstnumber correction), the output looks like that of the middle side. However, I'd like the output to look like that of the rightmost column.    That is, the eventual output of line numbers should match that of the linerange specification.  The trivial solution I'm hoping to avoid is the inclusion of separate \lstinputlistings for each range with the appropriate vertical adjustment of -2\medskipamount (default space above/below an included listing). That was how the rightmost column was obtained in the first place.
21130
At work we're letting one of our very tech savvy clients actually help out a little with a few development projects specific to him. However, he uses his own personal Macbook, and as he edits files on our (Windows) networks, his Macbook always creates a bunch of unnecessary meta files that we end up deleting later.  For instance, it creates a file called .DS_Store in any directory he opens, as well as "dot underscore" files for each file he edits. So for instance, if he's editing a file called "Main.php", his Macbook will create another file called "._Main.php".  I know  to , but none about how to prevent creation of these hidden files prefixed with dot underscore.  Is there any way to turn that off on Macs? Any way to prevent it from creating those files in the first place?
5500
When I run ifconfig -a, I only get lo and enp0s10 interfaces, not the classical eth0  What does enp0s10 mean? Why is there no eth0?
33483
Preface: Every couple of days there comes a question of this type, which is easy to solve with sed, but takes time to explain. I'm writing this question and answer, so I can later refer to this generic solution and only explain the adaption for the specific case. Feel free to contribute.  I have files with variable definitions. Variables consist of uppercase letters or underscore _ and their values follow after the :=. The values can contain other variables. This is Gnom.def:  NAME:=Gnom FULL_NAME:=$FIRST_NAME $NAME FIRST_NAME:=Sman STREET:=Mainstreet 42 TOWN:=Nowhere BIRTHDAY:=May 1st, 1999   Then there is another file form.txt with a template form:  $NAME Full name: $FULL_NAME Address: $STREET in $TOWN Birthday: $BIRTHDAY Don't be confused by $NAMES   Now I want a script which replaces the variables (marked with $ and the identifier) in the form by the definitions in the other file, recursively, if necessary, so I get this text back:  Gnom Full name: Sman Gnom Address: Mainstreet 42 in Nowhere Birthday: May 1st, 1999 Don't be confused by $NAMES   The last line is to ensure that no substrings of variables get replaced accidentally.
35574
Is there a way to turn option strict off for just a single line of code?    I'm doing some maintenance work and I need to "cheat" in just one place and I don't want to lower the standard for the entire file.
13527
Until now I was using a "traditional" version of Nautilus: that that comes with Ubuntu 10.10. Now I'm using 3.6.3, included with Ubuntu 13.04 (most likely any recent version is equivalent for the scope of my question, anyway).  One major difference between the two is the search-as-you-type behavior: in classic versions of Nautilus, when you typed an input, the file with the closest alphabetical match would become the selected one, the eligible files/folders being restricted to the current directory.  The new behavior is to perform an optionally-global search instead.  Can one configure Nautilus to provide the previous functionality ?
64483
Given a string "filename.conf", how to I verify the extension part?  I need a cross platform solution.
9268
A search with locate finds paths in the filesystem. Often, you know a priori you are interested in either files only, or directories only. A 'locate' search often returns many results. It would be useful to include only one of the types in the result, because it helps shorten the output.  But there is a more interesting argument to leave out either files or directories: because the list of result paths can be ambiguous - not only in theory.    The example below is a real world case, and not unusual:  $ locate --regex --basename "xfce4-keyboard-overlay$" /usr/local/bin/xfce4-keyboard-overlay /usr/local/share/xfce4-keyboard-overlay   Ok, we found something! But... files, or directories?    $ file /usr/local/bin/xfce4-keyboard-overlay  /usr/local/bin/xfce4-keyboard-overlay:   bash script   So that is a file...  $ file /usr/local/share/xfce4-keyboard-overlay /usr/local/share/xfce4-keyboard-overlay: directory   while the second is not.    This ambiguity is making long lists of paths hard to read, so it would be really nice to filter directories out, for example using a comman line option for locate.  Does something like this exist? Even if the filter for directories is separate from locate?  At least, one could use a script to iterate all the file names to check - which may be slow.
80019
I tried this:  find . -type f -size 128 -exec mv {} new_dir/  \;   Which didn't work, and it didn't give me an error. Here is an example of what the file looks like, when using stat -x  $ stat -x ./testfile | grep Size    Size: 128          FileType: Regular File
116212
Is the order in which Nginx includes configuration files fixed, or random? Apache  wildcard characters are expanded in alphabetical order. With Nginx it seems this does not apply, and .  In my setup, 20_example.com was included before 00_default, which defeats my purpose of defining shared directives (like log formats) there.
77757
What do I mean by Convention? First of all, allow me to clear myself about the word 'conventions. As most of you already know, coding conventions are a set of guidelines for a specific programming language that recommend programming style, practices and methods for each aspect of a piece program written in this language []. These conventions usually cover 'file organization', 'indentation', 'comments', 'declarations', 'statements', 'white space', 'naming conventions', 'programming practices', 'programming principles', 'programming rules of thumb', etc. An Example! As an example, consider Java (and other C-like programming languages). In Java Naming Conventions, class names should be in UpperCamelCase, methods and variables should follow lowerCamelCase and constants should be ALLCAPS. A Personal Experience: There are some of these conventions that I have realised while writing smaller reports. For example, the second time I wrote a report with LaTeX, I realized it's better to put each chapter in a separate file. Also, I learned about them reading other peoples code like  one that I learned about it recently: One-Sentence-per-Line. This looks very important for sake of readability of the latex source but I never thought about it until I read that answer. Here comes the Question! I'm about to write my master thesis and I want to know these conventions for LaTeX. My goal is to achieve a readable, reusable, easy to modify and standard source code. If you know any conventions, or if you have your own personal ones, regarding any aspect of LaTeX, please share with me and I would be delighted if you support your answers/conventions with reasons or examples.
59724
One sees all kind of versions in source files for defining something like a limit etc. So my question is which one serves what purpose. Is there any "best practice" in chosing one over the other?
82612
I'm a beginner to Ubuntu. Can anyone tell me how to edit a configuration file?  This is on Ubuntu 18.04 LTS. Thanks in advance.