Globbing for a filename pattern with ls [closed] - linux

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 9 years ago.
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.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Improve this question
I need help doing the following:
Say I'm in /usr/bin and I want to run the ls command on a subdirectory of bin called datafiles from within bin.
I need to locate all files using ls that contain a dot . and contain the letters f or u anywhere after the dot.
How do I do this?
Thanks

Is this what you want?
ls datafiles/*.*[fu]*

Related

What does command cat /etc/group mean [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 have used a command called 'cat /etc/group' what does this command mean and do.Can you tell me what each part of the command does please use simple terms.
You can find the answer to your question explained better than any of us ever could with this command:
man cat
It prints to standard output the contents of the file at the location /etc/group
Ok so cat outputs the file, which (in your case) contains basic info about groups.
If you are interested in what are the groups just click here

What does two dots before a slash mean? (../) [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 7 years ago.
Improve this question
What does ../ mean in Linux/Unix paths? I've seen that it means as 'up a directory' but I couldn't get to understand it fully.
Each directory has two entries in it at the start, with names . (a link to itself) and .. (a link to its parent directory). The exception, of course, is the root directory, where the .. directory also refers to the root directory.

Linux rename command but for dynamic values [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 7 years ago.
Improve this question
I have files on a Linux server for example:
2103acc.001.lob
2507acc.002.lob
2222acc.021.lob
1210acc.051.lob
I would like to change them to:
2103acc.pdf
2507acc.pdf
2222acc.pdf
1210acc.pdf
I cannot performo
rename .001.lob .pdf *.lob
because those are dynamics number
Can someone write me the solution?
Thanks
This regexp should remove digits followed by .lob and replace with .pdf:
rename -n -v 's/\.[0-9]+\.lob$/\.pdf/' *.lob
Once you're convinced you have the right pattern, just remove the -n (dry-run) and let it run properly:
rename -v 's/\.[0-9]+\.lob$/\.pdf/' *.lob
Ixer missed a * in his answer, so i added it:
rename -n -v 's/\.[0-9]*\.lob$/\.pdf/' *.lob

How to rename a file name named "." [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 8 years ago.
Improve this question
I have downloaded a large file about 2gigs from remote server but by mistake I gave it name . (dot).
How can I rename it using linux commands ?
I don't think you really have named it .. Or at least, you cannot have done so successfully.
The name . is reserved for the current directory. So either it has been given another name implicitly, or it has been removed/discarded.
Try
find -size +1536M -ls
to find if there is any file with this size, and if so, verify if it can be the file you look for.

Mass file renaming (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 have a directory in linux with lots of images having double underscore (__), I have to make it single under score (_). Lets say file name is a__1.jpg. I have to make it a_1.jpg. I have to do it for all files inside a directory. What should be the command?
Thanks
There are several ways to achieve this goal.
If you have mmv installed (or are able to install it), you can do
mmv \*__* \#1_#2
If not, maybe rename is an option:
rename _ __ *
(but alas, here I am not so sure about the syntax.)

Resources