I want to examine the all the key files present in my /proc
. But /proc
has innumerable directories corresponding to the running processes. I don't want these directories to be listed. All these directories' names contain only numbers. As I am poor in regular expressions, can anyone tell me whats the regex
that I need to send to ls
to make it NOT to search files/directories which have numbers in their name?
UPDATE: Thanks to all the replies! But I would love to have a ls
alone solution instead of ls+grep
solution. The ls
alone solutions offered till now doesn't seem to be working!
Explanation: We use ls command in terminal to list all the directories,sub directories,files….. We have to filter the files that starts with t or s in the current directory. ... We have to filter the file names by using regular expressions. ... s -ld /etc/[ts]* | grep ^- | tr -s ' ' | cut -d' ' -f9.
To list all files and sort them by size, use the -S option. By default, it displays output in descending order (biggest to smallest in size). You can output the file sizes in human-readable format by adding the -h option as shown. And to sort in reverse order, add the -r flag as follows.
For Windows 10, follow these instructions: Hold the windows key and press "r," type in "cmd" and then press enter, type in "cd ../.." and then press enter, type in "tree" and then press enter. This will usually show all of the files on your hard drive.
You don't need grep, just ls
:
ls -ad /proc/[^0-9]*
if you want to search the whole subdirectory structure use find:
find /proc/ -type f -regex "[^0-9]*" -print
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With