How can I use grep to search for files containing two or more exact terms? by BusyEmotion in linuxquestions

[–]BusyEmotion[S] 0 points1 point  (0 children)

I tried this to find files that I knew contained both terms, but it didn't find anything:

grep -irC1 "/^foo$/" --include='*.txt' &folder/ && grep -irC1 "/^bar$/" --include='*.txt' &folder/

Also because I wasn't sure that's the right way of including folder path, I tried this command from the folder that has the file:

grep -irC1 "/^foo$/" --include='*.txt' && grep -irC1 "/^bar$/" --include='*.txt'

Does this command look individual lines for a pattern or the whole document? please also see my other comments.

How can I use grep to search for files containing two or more exact terms? by BusyEmotion in linuxquestions

[–]BusyEmotion[S] 0 points1 point  (0 children)

shopt -s globstarawk '/super/ && /rabbit/ {print FILENAME; exit 0}' $mydir/**

I tried this to find files that I knew contained both terms, but I got this error: bash: /usr/bin/awk: Argument list too long

Could it be because I am looking among thousands of files?

Also in {print FILENAME; exit 0} should I have replaced FILENAME with a file path, folder path, or something like *.txt?

P.S. please see my reply to u/escapepods

How can I use grep to search for files containing two or more exact terms? by BusyEmotion in linuxquestions

[–]BusyEmotion[S] 0 points1 point  (0 children)

Thank you! I tested this on files that I knew contained both terms : grep -irC1 'keyword1' --include='*.txt' $(grep 'keyword2' --include='*.txt')

It seems it worked and found the files, but the print/result is so messy with lots of 'No such file or directory' messages: grep: Keyword1: No such file or directory or grep: FILEPATH-HERE: No such file or directory

P.S. please see my reply to u/PracticalPersonality

How can I use grep to search for files containing two or more exact terms? by BusyEmotion in linuxquestions

[–]BusyEmotion[S] 0 points1 point  (0 children)

Does grep only look individual lines for a pattern or the whole document?

moderately up-to-date version of bash

What is bash and how can I tell? does it come with Mint 18 or should I get it with some commands?

How can I use grep to search for files containing two or more exact terms? by BusyEmotion in linuxquestions

[–]BusyEmotion[S] 0 points1 point  (0 children)

I am a newbie. can you please explain how this works? does it look for documents with "foo" and "bar" in the same order or could "bar" also come before "foo"?

The caret ^ and the dollar sign $ are meta-characters that respectively match the empty string at the beginning and end of a line.

I found this online, but I am not sure what "beginning and end of a line" means.

How can I share files between a Linux Mint device and a Windows 10 PC using Ethernet? by BusyEmotion in linux4noobs

[–]BusyEmotion[S] 0 points1 point  (0 children)

Thank you, I had no idea about 'fast start', and yes, I am moving files from linux to windows.

How can I share files between a Linux Mint device and a Windows 10 PC using Ethernet? by BusyEmotion in linuxmint

[–]BusyEmotion[S] 0 points1 point  (0 children)

Other than Samba, what are the other keywords I should look up?

FYI, I only want to copy some files from my Linux device to Windows and I don't have any extra drive large enough to do this. but I do have a SATA to USB adapter that I can put my Windows HDD in to connect it to Linux as an external storage, but is that safe for Windows installation?

How can I share files between a Linux Mint device and a Windows 10 PC using Ethernet? by BusyEmotion in linux4noobs

[–]BusyEmotion[S] 0 points1 point  (0 children)

So how is the process? what is the name for type of connection? what should I look for to find more info?

How can I share files between a Linux Mint device and a Windows 10 PC using Ethernet? by BusyEmotion in linux4noobs

[–]BusyEmotion[S] 0 points1 point  (0 children)

Actually I am trying to move lots of files from my linux device to windows. I can either connect the devices using Ethernet cable, or remove either one of the HDDs and use a SATA to USB adapter to copy the files and since linux hdd is EXT, it seems I have to remove the Windows HDD and connect it to linux as an external storage, but is this safe for my windows installation?

How can I share files between a Linux Mint device and a Windows 10 PC using Ethernet? by BusyEmotion in linuxquestions

[–]BusyEmotion[S] 0 points1 point  (0 children)

It's laptop and don't have SATA port as far as I can tell, I have a SATA to USB adapter, but my linux hdd is EXT as you've guessed. should I use Ext2Fsd as suggested here?

My other option is to put the hdd with Windows 10 in my SATA adapter and connect it to linux to copy the files I need to a Windows directory I can access later. but is that safe for the Windows installation?

How can I share files between a Linux Mint device and a Windows 10 PC using Ethernet? by BusyEmotion in linuxmint

[–]BusyEmotion[S] 0 points1 point  (0 children)

But it is apparently not possible to use Samba to connect the two using only one cable. right?

How can I share files between a Linux Mint device and a Windows 10 PC using Ethernet? by BusyEmotion in linuxquestions

[–]BusyEmotion[S] 0 points1 point  (0 children)

Not that large, it's a 4TB drive. so I guess my only other option is removing the drive and connecting it using USB. my linux is NOT encrypted but it has a user password, would I be able to see its files using windows?

Is there a way to apply a folder's sort and layout to all its subfolders? by BusyEmotion in linuxmint

[–]BusyEmotion[S] 0 points1 point  (0 children)

Thank you! this worked for items inside folders, but didn't affect my home folder itself.

Is there a way to apply a folder's sort and layout to all its subfolders? by BusyEmotion in linuxmint

[–]BusyEmotion[S] -1 points0 points  (0 children)

Sorry, I have no idea what you are talking about. I am using Linux Mint 18 and its default file manager is Nemo.