Test your CLI skills
No u
># Print all files in the current directory,
># one per line (not the path, just the filename)
># that contain the string "500".
what did he mean by this?
ls -1 *500*
grep -F '500' -l ./*
if you can't RTFM, you are lost
i don't understand why i can't rm -rf . for the delete_files one.
>command timed out
seriously?
grep -Fl 500 *
Wow, user, you're wasting keystrokes for nothing.
Files that *contain* that string in them, not in the file name.
grep -ir
Dont care if its "standard", its what I do
-F isn't needed at all.
if you are obsessed with char length than indeed, but otherwise it's much faster if you aren't matching refex
>see user submitted solutions
>scroll to the bottom
At this point you can write C programs every time you need to do a task of this sort. But would it be worth the time required to compile your code?
shit, this is priceless
for f in $(ls); do...
seriously...
ls | while read x; do cat $x | grep 500 > /dev/null; if [[ $? -eq 0 ]]; then echo $x; fi done
Holy shit.
for i in *; if [ -f "$i" ]; then grep -q "500" "$i" && echo "$i"; fi; done
I have to rtfm more.
I do not understand either
I tried
rm -rf *
rm -rf * . ..
Turns out this one works for some reason
rm -rf * .*
grep -ls 500 *
rm -rf *
You're only removing all files that don't start with .
rm -rf * . ..
Same with the above, but also the current directory and the directory above the current one (obviously not a subdirectory)
rm -rf * .*
Removing all files that don't start with . and the ones that start with . which is what they want
inst this a false positive?
ls | grep 500
wow
That just list file names containing it
Seriously just do:
grep -ir 500 .
>test ur l33t bash skills
>almost all the questions are about using coreutils
>most can be solved using a find and no pipelining.
ya ok
It says "cmd challenge" not "bash challenge".
no
(triple checked)
Here's my never fails go to.
$ cat Documents/bash/find-grep
grep -l '500' ./*
>frogposter
Sage and hide.
>amphibian shamer
filtered
...
WTF?? Thats not even in the rules!!
You probably need to clear your cache.
wtf I hate frogs now.
How do i do thta/