include in the list human readable hidden files too:
file .* *|grep 'ASCII text'|sort -rk2
more reliable command:
ls|xargs file|grep 'ASCII text'|sort -rk2
and include hidden files:
ls -a|xargs file|grep 'ASCII text'|sort -rk2
GNU grep's PCRE(Perl-compatible regular expressions).
Delete the beginning of each line until first match of given character, in this case it's ":" Does it on all lines. The given character is deleted also, and can be a space.
It finds, specifically, the connections to the HTTP and HTTPS ports as source ports. You can check for destination ports as well. Show Sample Output
1 = on ac, 0 = on bat
Just an alternative for `acpi -b` Show Sample Output
Bash's here string
Number of days back: change/append arbitrary amount of '\|'$[$(date +%Y%j)-x] expressions or specify any n-th day before today for a single day (you have to replace x with 3, 4, 5, whatever ... above I replaced it with 1 and 2 to get listing for yesterday and day before yesterday and 0 for today was not necessary, so left out).
Q: How to narrow to *.pdf , *.png, *.jpg, *.txt, *.doc, *.sh or any type of files only?
A: Pipe to grep at the end of command.
Even shorter:
cd && day=3;for a in $(seq $day -1 0);do tree -aicfnF --timefmt %Y%j-%d-%b-%y|grep $[$(date +%Y%j)-$a];done
Here it's only needed to change amount of variable day to list period of days back - here is set to three days back (the seq command is adjusted for listing the oldest stuff first).
Show Sample Output
If you try to access cd - you go to the last folder you were in.
Remove lines from a bibtex file that have abstracts in them.
This will also work with bash instead of sh shell sudo bash -c 'apt update -y && apt upgrade -y'
"seq" has an additional parameter to use as INCREMENT. # seq FIRST INCREMENT LAST https://linux.die.net/man/1/seq Show Sample Output
Add this to a script and you can do ./scriptname site help or ./scriptname mput etc etc.
Was to long with a loop, use a while loop for have it running 24/7
For ipv6 use: grep -oE "\b([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4}\b"
Bash's arithmetic evaluation.
commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for: