Linux search tool with results selection and copy functionality [closed] - linux

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I am using Ubuntu now but am used to Windows where i can natively search for specific files inside a folder, select all the found entries and directly select and copy all of them in order to paste to another folder.
Now I found that this is not possible with Ubuntu. I digged on the internets a bit and found several search tools like catfish, gnome-search-tool or recoll... but all they do is search, no selection or copying of the found files.
Therefore, I'd like to ask you guys if you have any idea on how to get this functionality?
Why I am asking here - because the Ubuntu forum is either dead or nobody has an idea.

Suppose you want to select txt files in sourcedir and move them to targetdir.
cd sourcedir
find . -name "*.txt" -level 0 -exec mv "{}" targetdir "{}" ";"
The exact syntax for your flavor of linux may vary slightly - in particular the -level 0 might use a different keyword and the "{}" ";" at the end might be different.

Related

Is output of a "dir" command same in all distributions of Linux? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
I'm preparing a batch compiling sh file in Ubuntu. It is using dir command to get a list of files (and some string processing to extract names). But this may not be the best way (but easy enough) of getting list.
Question: do all Linux distros answer "dir" command same?
dir /usr/lib/nvidia-*
/usr/lib/nvidia-396:
alt_ld.so.conf libnvidia-cfg.so.396.54
bin libnvidia-compiler.so
ld.so.conf libnvidia-compiler.so.1
libEGL_nvidia.so.0 libnvidia-compiler.so.396.54
Yes, the dir tool should work the same across any distribution, provided the distribution doesn't have its own modified version or has this tool missing etc.
You might find this helpful for some background into dir tool
https://www.howtoforge.com/linux-dir-command/
You can use tree command to get all files and filter whatever you want.
tree -f -i .|grep .*\.py$ here it greps all .py files.
here's tree doc
example:
root#fdada3432377:/usr/src/app# tree -f -i conn* |grep .*\.py$
connection/__init__.py

find multiple files that contains a specific word in unix and linux [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 years ago.
Improve this question
Say i have list of files contain the word 'contain' in the same directory and i want to find those files at one command . I have tried with grep command to find out like
grep 'contain' file name
I tried following command also.
locate 'contain'
find 'contain'
grep 'contain' file name
Currently i am not able to find any thing . Kindly help as its very important to find the files in a one command . Currently i am not able to find any thing . Kindly help as its very important to find the files in a one command . Currently i am not able to find any thing . Kindly help as its very important to find the files in a one command .
Answer is within the question.
cd to the directory.
grep –l ‘contain’ *
Hope it helps .

how to deal with file without a name in linux? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
I'm a green hand to linux using the vmware called Parallels on my mac and the edition I use is CentOS7.When I use the ls -al command, I found some files don't have name as follow in surprise:
I just want to know as these files are seemingly generated at a same time, what are they? how to delete them?
On *nix system every file has an atrribute called i-node. You can find with command
ls -i
when you have i=node number you can delete file by
find . -inum 782263 -exec rm -i {} \;
You could use any other commands not only rm.
more details you can find here
http://www.cyberciti.biz/tips/delete-remove-files-with-inode-number.html
As the d in drwxr-xr-x states, those are folders (or at least the filesystem thinks they are). You may use Midnight Commander to delete them. You may already have it installed on your machine, try to run mc to see if it's there.

Exclusive parameter in find utility under Linux [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I was experimenting something different with find. I just wanted to move all my .c files under my root to my source directory. Though, I've no idea how to exclude some directories where I don't want to pick up my files.
The line of code I should improve is the following:
sudo find / -type f -name "*.c" -exec cp {} ~/my/source/directory \;
Since there are different .c files in my source directory, copying files to the same path where the files are picked up would raise an error (it would work anyway, though). Also, this would happen anyway even if I had no file in my source directory, since they were copied there before.
So, my line should look like the following:
sudo find / -type f -name "*.c" EXCEPT ~/my/source/directory -exec cp {} ~/my/source/directory
Is there anyway to do that? I've looked up in man pages as well as in my reference manual (there is something similar there even if I couldn't emulate it), but I wasn't able to find nothing helpful.
Any help appreciated.
EDIT:
find man page is clear about it. If interested, you can find the solution to my problem at line 343 (343G on less).
If i got your question correctly, then this might help: Exclude directory from find . command
Check answer posted by #GetFree in the above link.

Copy all .html files into single file [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
On my Linux server, I need to copy all .html files recursively (from under the currect directory), into a single file, "all.html", for testing purposes.
Could anyone advise on a command that might get me close to doing so?
I just use the 'copy' command, I think, but what parameters do I need to pass?
Thanks in advance!
This will copy all the files into a single HTML file:
cat *.html > all.html
He said "recursively" so a simple "cat *.html" won't do. But try this:
find -name "*.php" -print0 | xargs -0 cat > all.php.new
(beware that you get an error if the output file also ends in *.php as "find" will then match it, too)

Resources