Anyone here will probably enjoy checking out commandlinefu: http://commandlinefu.com Especially looking down the list of all time greats: http://www.commandlinefu.com/commands/browse/sort-by-votes
Bringing this on a small tangent, but I've never been comfortable with 'sudo !!' and I can't really articulate why aside from wanting to be as explicit as possible. , , type sudo and enter is nearly as quick and much more explicit for me.
Linux utils that you might not know
111–120 of 159 posts
Re: Linux utils that you might not know
#112Earlier quoted context omitted.
Bringing this on a small tangent, but I've never been comfortable with 'sudo !!' and I can't really articulate why aside from wanting to be as explicit as possible. , , type sudo and enter is nearly as quick and much more explicit for me.
If you are a long time "vi" user, put `set -o vi` in "~/.bashrc": the sequence to issue the previous command with sudo prepended will be 0isudo , probably something that is in your muscle memory already.
Re: Linux utils that you might not know
#113Earlier quoted context omitted.
Although these tools are great, I'm afraid these are of limited use, as these aren't preinstalled but must be explicitly installed. For personal use these are great. But if you write a shell script to be executed on different machines where you can't install anything, these tools won't be available to you. And if you don't have that requirement, i.e. you can install everything, just install appropriate Perl/Python/Ru…
Why assume python? It's huge compared to bash or perl. Lots of minimal configuration operational systems won't have python. More likely than go/ruby/node though.
Re: Linux utils that you might not know
#114Earlier quoted context omitted.
I'd stick with pushd and popd every time, it's considerably more expressive.
> considerably more expressive is that an advantage? Do you have the time to explain this a bit more? I feel that new users need less expressiveness, to avoid decision overload, and keeping one automatic directory save point is easier to mentally manage than a stack of them. I do recommend using pushd/popd in shell scripts (always) and interactively (if you must), but I think 'cd -' should be the first thing you intr…
That said, I don't disagree that cd - is a good introduction to the idea that there's more to the cd command than meets the eye. (I'm also a big fan of the CDPATH variable, despite its issues.)
Re: Linux utils that you might not know
#115$ curl -s http://datascienceatthecommandline.com | pup '.sect3 > h3 text{}' | head alias awk aws bash bc bigmler body cat cd chmod
Re: Linux utils that you might not know
#116Re: Linux utils that you might not know
#117Earlier quoted context omitted.
You can, but ssds are internally log structured, you have to overwrite whole free space plus the reserve and then run a TRIM.
You can't overwrite the reserve directly though. You have to write non-zero data to 99% to lock it, then destructively update the last 1% many times to cycle through the reserve. Many disks have a full erase command, which asks the internal controller to do the erase. In general though, I use a hammer.
.30-06. >:)
Re: Linux utils that you might not know
#118Earlier quoted context omitted.
Is that really a problem anymore? Not being able to install things was common in multi-user thin-client type systems, but these days with containerisation and VMs, if you're allowed to execute a script, you're probably allowed to install new packages No?
Sadly, no. It is often possible to install things locally, i.e. not using apt. The idea that everyone has sudo privs is unrealistic. A version of apt that added a per user subset would be very useful.
I regularly run "one-off" stuff in a `guix environment` that includes all the required packages for that command, without polluting my user (or system) profile.
For example, I recently wanted to transfer a file over HTTP from one machine to another, and did not have the "python" executable in PATH. So I started it in a `guix environment` and "containerized" it (using user namespaces) just for show:
guix environment --container --network --ad-hoc python -- python3 -m http.server
That starts the HTTP server from the current directory, but the process can not see anything else from the "real" system.Re: Linux utils that you might not know
#119Just look at anything in the "moreutils" package. Just great stuff. Excerpt: - ifdata: do not parse the output of ifconfig/ip anymore. Just use this tool. - sponge: when you need to overwrite an input file at the end of pipe. sponge will wait for the pipe to end before overwriting, preventing any data loss - vidir: edit a given dir with your EDITOR. Awesome for mass renames/deletes. - ts: add timestamps to a command…
Although these tools are great, I'm afraid these are of limited use, as these aren't preinstalled but must be explicitly installed. For personal use these are great. But if you write a shell script to be executed on different machines where you can't install anything, these tools won't be available to you. And if you don't have that requirement, i.e. you can install everything, just install appropriate Perl/Python/Ru…
Re: Linux utils that you might not know
#120Earlier quoted context omitted.
One of my favorite moreutils tools is combine[1]. It allows you to compare the contents of text files with boolean operations. For example, want to know what lines are in file1 but not file2? Use: combine file1 not file2 1. http://manpages.ubuntu.com/manpages/zesty/en/man1/combine.1....
You can use comm from coreutils for that too: `comm -1 file1 file2`
1. http://manpages.ubuntu.com/manpages/zesty/en/man1/comm.1.htm...