A lot of people know this, some don't; but youtube-dl supports hundreds of sites. Soundcloud, Twitch, Streamable, pretty much any popular video or music streaming site you can think of is supported.
A lot of people know this, some don't; but youtube-dl supports hundreds of sites. Soundcloud, Twitch, Streamable, pretty much any popular video or music streaming site you can think of is supported.
jq csvcut/csvgrep/csvlook/csvjson/csvstat (those are the ones I use, anyway, there are a few more as part of csvkit) qmv/qcp (part of renameutils) And, these functions I’ve had in my .bashrc...
And, these functions I’ve had in my .bashrc forever:
# Get numerical frequency distribution of lines.
# E.g., get frequency distribution of extensions of files in current directory:
# $ find . -type f | xargs basename | egrep -o '[^\.]+\.[^\.]+$' | cut -f2 -d'.' | count
function count () {
sort | uniq -c | sort -nr
}
# Create .tar.gz archive(s) of a file(s) or directorie(s)
function archive() {
for arg in ${@}; do
echo "==> ${arg%/} <=="
tar -cvzf "${arg%/}".tar.gz "${arg%/}"
done
}
# Extract things. Thanks to urukrama, Ubuntuforums.org
function extract () {
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) unrar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xvf $1 ;;
*.tbz2) tar xvjf $1 ;;
*.tgz) tar xvzf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1 ;;
*.7z) 7z x $1 ;;
*) echo "'$1' cannot be extracted via extract()" ;;
esac
else
echo "'$1' is not a valid file"
fi
}
And, these in my .inputrc:
"\e[A": history-search-backward
"\e[B": history-search-forward
set completion-ignore-case on
set completion-query-items -1
set show-all-if-ambiguous on
set show-all-if-unmodified on
set bell-style visible
Have you tried unar as a replacement for your extract function? It extracts a lot of different formats and the command is always unar $1 regardless of the archive format.
Have you tried unar as a replacement for your extract function? It extracts a lot of different formats and the command is always unar $1 regardless of the archive format.
Another suggestion for your extract function might be: case $1 in *.tar* | *.tgz | *.gz | *.xz | *.bz2) tar xf $1 ;; Modern versions of tar now scan for gzipped, bzipped, etc tars and seem to pipe...
Another suggestion for your extract function might be:
case $1 in
*.tar* | *.tgz | *.gz | *.xz | *.bz2) tar xf $1 ;;
Modern versions of tar now scan for gzipped, bzipped, etc tars and seem to pipe them through the appropriate decompressor. You just have to use tar xf filename.ext for pretty much everything but zips, rars, and 7z files I think.
fish is my shell. Automatic suggestions (visible suggestions), and a fuzzy finder in-built. Syntax is less POSIX, and more Lua-ish, and has actual arrays to play with. Most things are colored....
fish is my shell. Automatic suggestions (visible suggestions), and a fuzzy finder in-built. Syntax is less POSIX, and more Lua-ish, and has actual arrays to play with. Most things are colored. fish_config is a life-saver if you need to reconfigure something. Editing functions inline is awesome.
But the biggest time saver is the suggestions. They're context sensitive, linked to both a global history, and your current working directory. So most of the time working on something, I cd to the directory (which is also predicted), type one letter, and hit an arrow key and return.
Cron. The syntax might be annoying to get a handle on, but DuckDuckGo can explain cron for you, if you forget.
But... If you find yourself regularly doing anything... Time to automate.
Like:
23 0 * * * * sh /home/jmilne/Code/Backup/backup >/home/jmilne/backup.log 2>&1
Like SSH, but has local echo, and won't die when you're on the move between access point. (Like on a train, for example).
And for restricted systems... Doesn't require privileges to run.
Very useful when facing high-latency.
For entertainment... Both mpv (for videos) and rhythmbox (for music) can be controlled by the commandline. If I'm doing a movie night or a party, I usually control both via ssh (or mosh) from my phone, as it tends to be more reliable than most remote controls.
Lots of lay people often ask about that and love it. One or two have had me set up their entertainment system that way... And now the commandline is their friend.
FZF the fuzzy file finder. Especially useful for CLI file selection, directory jumping and command history searcher. I also have some git- and vim- specific keybinds.
I like good old find -- it's a time-saver and occasionally life-saver. As an example, sometimes a file's name got corrupted and becomes unprintable or garbage. To rename the file from the command...
I like good old find -- it's a time-saver and occasionally life-saver. As an example, sometimes a file's name got corrupted and becomes unprintable or garbage. To rename the file from the command line, we can find the file by its inode number and tell find to execute the mv command on it.
There's also cscope which is very helpful for browsing large source code directories, especially from the vim editor. I usually work with C and Python, and the latter is supported by the pycscope program.
Print stderr in red. Ascend multiple directory levels at once while leaving $PWD intact so you can cd - back: up() { cd $(printf '../%.0s' $(seq 1 $1)) }
My list of commonly used CL apps: ag (the silver searcher) Fast grep and file location ncdu (ncurses disk usage) Recursive disk folder and file size analysis. Useful for tracking whats using all...
My list of commonly used CL apps:
ag (the silver searcher) Fast grep and file location
ncdu (ncurses disk usage) Recursive disk folder and file size analysis. Useful for tracking whats using all your SSD space and nuking it
icdiff - command line visual merge/diff
slackcat - cat files directly to a slack channel
httpie - command line http client
One of my favorite .bash_functions is something I call gofind. It'll let you list all the files in your working directory and sub-folders matching a regular expression. function gofind() { find ....
One of my favorite .bash_functions is something I call gofind. It'll let you list all the files in your working directory and sub-folders matching a regular expression.
function gofind() {
find . -type f -iname "*${@}*" -exec ls -lh {} \;
}
For my job, I have to create a "List of Items Reviewed" as an appendix for each report we issue. I've found that the best way to generate a list of files in a complex structure of folders and...
For my job, I have to create a "List of Items Reviewed" as an appendix for each report we issue. I've found that the best way to generate a list of files in a complex structure of folders and subfolders is through the command line. After I cd to the top level of the directory, I'll type "for /r %i in (*) do @echo %~nxi >> ItemsReviewed.txt". This recursively lists file names without the full path, and it also removes the folder names and structuring from the list. Then I can easily drop it into Word or Excel and go from there.
A few things I haven't seen mentioned yet: Browsh: A command-line browser that can actually use modern sites. It uses Firefox as a backend and renders everything in ASCII. xonsh: A shell that...
A few things I haven't seen mentioned yet:
Browsh: A command-line browser that can actually use modern sites. It uses Firefox as a backend and renders everything in ASCII.
xonsh: A shell that basically operates like Python. Very useful for scripting and also compatible with Bourne shells.
I use
ffmpeg
andyoutube-dl
the most.zsh
with autosuggestions would be handy for some newer folks.A lot of people know this, some don't; but
youtube-dl
supports hundreds of sites. Soundcloud, Twitch, Streamable, pretty much any popular video or music streaming site you can think of is supported.Here's a full list --- its remarkable.
https://rg3.github.io/youtube-dl/supportedsites.html
jq
csvcut
/csvgrep
/csvlook
/csvjson
/csvstat
(those are the ones I use, anyway, there are a few more as part ofcsvkit
)qmv
/qcp
(part ofrenameutils
)And, these functions I’ve had in my
.bashrc
forever:And, these in my
.inputrc
:Have you tried
unar
as a replacement for yourextract
function? It extracts a lot of different formats and the command is alwaysunar $1
regardless of the archive format.Ah, I have used the GUI version of The Unarchiver for macOS. Didn’t know of the CLI. Thanks! I’ll try it out.
Another suggestion for your extract function might be:
Modern versions of
tar
now scan for gzipped, bzipped, etc tars and seem to pipe them through the appropriate decompressor. You just have to usetar xf filename.ext
for pretty much everything but zips, rars, and 7z files I think.Yeah, I also found this recently:
dtrx
Edit: Haha, someone else already mentioned it in this very thread!
fish is my shell. Automatic suggestions (visible suggestions), and a fuzzy finder in-built. Syntax is less POSIX, and more Lua-ish, and has actual arrays to play with. Most things are colored. fish_config is a life-saver if you need to reconfigure something. Editing functions inline is awesome.
But the biggest time saver is the suggestions. They're context sensitive, linked to both a global history, and your current working directory. So most of the time working on something, I cd to the directory (which is also predicted), type one letter, and hit an arrow key and return.
Cron. The syntax might be annoying to get a handle on, but DuckDuckGo can explain cron for you, if you forget.
But... If you find yourself regularly doing anything... Time to automate.
Like:
Which, runs a little backup script I wrote, at 12:23AM everyday. (And yes, DDG can explain.)
Ag.
A crazy-fast recursive file searcher. Let's me find something if I forget where I put it.
It can use regular expressions and so on. So kind of a combination of find and grep, but faster than both, and recursive on directories by default.
Mosh.
Like SSH, but has local echo, and won't die when you're on the move between access point. (Like on a train, for example).
And for restricted systems... Doesn't require privileges to run.
Very useful when facing high-latency.
For entertainment... Both mpv (for videos) and rhythmbox (for music) can be controlled by the commandline. If I'm doing a movie night or a party, I usually control both via ssh (or mosh) from my phone, as it tends to be more reliable than most remote controls.
Lots of lay people often ask about that and love it. One or two have had me set up their entertainment system that way... And now the commandline is their friend.
I like "the silver searcher" (
ag
) a lot. It interact with other tools (such asgit
and thevim
editor) very nicely.FZF the fuzzy file finder.
Especially useful for CLI file selection, directory jumping and command history searcher. I also have some git- and vim- specific keybinds.
I like good old
find
-- it's a time-saver and occasionally life-saver. As an example, sometimes a file's name got corrupted and becomes unprintable or garbage. To rename the file from the command line, we canfind
the file by its inode number and tellfind
to execute themv
command on it.There's also
cscope
which is very helpful for browsing large source code directories, especially from thevim
editor. I usually work with C and Python, and the latter is supported by thepycscope
program.WOOF to swap single files across computers when starting up sshfs is too much effort.
Print stderr in red.
Ascend multiple directory levels at once while leaving $PWD intact so you can
cd -
back:up() {
cd $(printf '../%.0s' $(seq 1 $1))
}
Taskwarrior is literally a command-line productivity tool. It’s quite complete, more like Org Mode than todo.txt
My list of commonly used CL apps:
ag (the silver searcher) Fast grep and file location
ncdu (ncurses disk usage) Recursive disk folder and file size analysis. Useful for tracking whats using all your SSD space and nuking it
icdiff - command line visual merge/diff
slackcat - cat files directly to a slack channel
httpie - command line http client
I use
dtrx
all the time so I don't have to memorize all the different tar command flags.One of my favorite
.bash_functions
is something I call gofind. It'll let you list all the files in your working directory and sub-folders matching a regular expression.Possibly relevant: https://www.hpe.com/us/en/insights/articles/how-to-see-whats-going-on-with-your-linux-system-right-now-1807.html
For my job, I have to create a "List of Items Reviewed" as an appendix for each report we issue. I've found that the best way to generate a list of files in a complex structure of folders and subfolders is through the command line. After I cd to the top level of the directory, I'll type "for /r %i in (*) do @echo %~nxi >> ItemsReviewed.txt". This recursively lists file names without the full path, and it also removes the folder names and structuring from the list. Then I can easily drop it into Word or Excel and go from there.
A few things I haven't seen mentioned yet:
Browsh: A command-line browser that can actually use modern sites. It uses Firefox as a backend and renders everything in ASCII.
xonsh: A shell that basically operates like Python. Very useful for scripting and also compatible with Bourne shells.
Also miscellaneous novelties like mapscii.me