News for hackers. Stuff that matters.
Re:The Linux Commands HandBook by red_admiral on Thursday November 05, 2020 @06:56AM (#24997445)
Several red flags here.

First, I have to fill in a form and confirm an e-mail subscription before I can download the PDF. For reference, the real download link is https://flaviocopes.nyc3.digitaloceanspaces.com/linux-comman...

Secondly, "No one can dictate which apps you can run, or “call home” with apps that track you, your position, and more."

Everything from ubuntu's amazon lens integration to android to firefox' pocket integration comes to mind. Yes, technically you can rebuild all these things from source and strip out the parts you don't like - don't like google tracking you? Chromium is open source, just edit the tracking out and build your own!

Practically speaking just about no-one can manage that. You have to either live with what you're offered or go to a lot of effort and practically have a degree in CS or equivalent. The author here has a very simplistic view of the world.

This sounds like a moderate-at-best quality article written to farm newsletter subscriptions. Could be better.

Re:The Linux Commands HandBook by thefz on Thursday November 05, 2020 @07:49AM (#24997782)
> Linux is an operating system, like macOS or Windows.

Nup, it's just a kernel.

Re:The Linux Commands HandBook by emilecantin on Thursday November 05, 2020 @08:47AM (#24998157)
I'd just like to interject for moment. What you're refering to as Linux, is in fact, GNU/Linux, or as I've recently taken to calling it, GNU plus Linux. Linux is not an operating system unto itself, but rather another free component of a fully functioning GNU system made useful by the GNU corelibs, shell utilities and vital system components comprising a full OS as defined by POSIX.

Many computer users run a modified version of the GNU system every day, without realizing it. Through a peculiar turn of events, the version of GNU which is widely used today is often called Linux, and many of its users are not aware that it is basically the GNU system, developed by the GNU Project.

There really is a Linux, and these people are using it, but it is just a part of the system they use. Linux is the kernel: the program in the system that allocates the machine's resources to the other programs that you run. The kernel is an essential part of an operating system, but useless by itself; it can only function in the context of a complete operating system. Linux is normally used in combination with the GNU operating system: the whole system is basically GNU with Linux added, or GNU/Linux. All the so-called Linux distributions are really distributions of GNU/Linux!

(https://www.lurkmore.com/view/GNU/Linux_interjection)

Re:The Linux Commands HandBook by johnr2 on Thursday November 05, 2020 @09:44AM (#24998654)
> All the so-called Linux distributions are really distributions of GNU/Linux!

s/All/Most

Alpine Linux uses musl libc and busybox, for example.

Re:The Linux Commands HandBook by zepto on Thursday November 05, 2020 @09:00PM (#25004148)
This just isn’t really true from a linguistic point of view any more.

Most people use Linux to mean one of many full operating system distributions, and then refer to the kernel as ‘the Linux kernel’. Gnu gets referred to in relation to the many tools. That’s just how the language has worked out.

The comment is certainly true in terms of who contributed various components, although many distributions do increasingly contain critical components that have nothing to do with GNU.

Re:The Linux Commands HandBook by Alekhine on Friday November 06, 2020 @01:58AM (#25005586)
You're being trolled. The comment you replied to is a copy paste of an oft-mocked post made by Richard Stallman. People post it in Linux threads to make fun of his pedantry and his perceived bitterness over Linux becoming the dominant kernel over GNU Hurd.
Re:The Linux Commands HandBook by zepto on Friday November 06, 2020 @10:14AM (#25008151)
Troll successful!

I knew it was Stallman’s bitterness. I just didn’t know it was a copy/paste!

Re:The Linux Commands HandBook by twojacobtwo on Thursday November 05, 2020 @10:45AM (#24999199)
Thank you for the excellent explanation! I have always referred to Linux as an operating system and I will be more careful with that nuance. I was one of today's 10,000 [0].

[0] https://xkcd.com/1053/ (Ten Thousand)

Re:The Linux Commands HandBook by Alekhine on Friday November 06, 2020 @01:58AM (#25005589)
You're being trolled. The comment you replied to is a copy paste of an oft-mocked post made by Richard Stallman. People post it in Linux threads to make fun of his pedantry and his perceived bitterness over Linux becoming the dominant kernel over GNU Hurd
Re:The Linux Commands HandBook by twojacobtwo on Tuesday November 10, 2020 @06:46PM (#25053666)
Apologies for the late response, but thank you for letting me know!
Re:The Linux Commands HandBook by swiley on Thursday November 05, 2020 @09:04AM (#24998268)
icecat has all the tracking stuff from Firefox removed. If you're willing to put up with the "purists" from eg the FSF you get a lot of benefits like not having your software track you or do things you don't like because the dark pattern works with some sales funnel etc.
Re:The Linux Commands HandBook by megous on Thursday November 05, 2020 @08:37AM (#24998098)
It's not that hard in Arch Linux. You get the PKGBUILD for original package, and run makepkg once with an option to just prepare the src/, then you can modify it and then you run makepkg with a flag to skip the src/ preparation and finish the build.

Just to change the build/configure flags, you can simply edit the PKGBUILD.

Nothing fancy, I've been building firefox this way to disable signing requirements for extensions, until I gave up on firefox extensions completely, because of the general unfriendliness to developers with the signing requirements that can't be disabled without wasting a shitton of electricity.

Re:The Linux Commands HandBook by roryrjb on Thursday November 05, 2020 @02:58AM (#24996430)
Yeah this is OK, but running macOS commands for Linux deployments doesn't work all the time. What about `lsblk` or `ip`? Also md5 vs md5sum. Also and I don't have macOS handy to try it, I'm pretty sure grep has differing options. I can't count how many times friends and colleagues who use macOS for development have put BSD commands into Dockerfiles and CI pipelines and have wondered why it didn't work.
Re:The Linux Commands HandBook by Fnoord on Thursday November 05, 2020 @07:57AM (#24997825)
Your criticism is valid, but its possible to get compatibility between macOS (or another BSD) and Linux. GNU utilities are already mentioned but there's also, for example,

> What about `lsblk` or `ip`?

For a (partly compatible) equivalent to ip I can recommend iproute2mac [1]. You can also use the old utilities from BSD (ifconfig, route, etc) or the GUI.

For lsblk I found no drop-in replacement, just equivalents [2]

On top of that, Nix works on Linux and macOS.

[1] https://github.com/brona/iproute2mac

[2] https://apple.stackexchange.com/questions/107953/list-all-de...

[3] https://nixos.org

Re:The Linux Commands HandBook by qz2 on Thursday November 05, 2020 @03:10AM (#24996474)
This was a massive problem for me as well. And they laughed at me using a virtual machine with Linux in it while they were pissing around with broken stuff...
Re:The Linux Commands HandBook by znpy on Thursday November 05, 2020 @03:59AM (#24996681)
When I was given a macbook at work I used to curse all the time at mac os' grep which is not gnu grep, and lacks a lot of nice cool features...
Re:The Linux Commands HandBook by miked85 on Thursday November 05, 2020 @04:02AM (#24996690)
You can use brew to install gnu grep as a replacement.
Re:The Linux Commands HandBook by williamtwild on Thursday November 05, 2020 @05:43AM (#24997157)
Its funny how people will admit to being upset about something when they are supposed to be tech saavy and should have just googled the solution .
Re:The Linux Commands HandBook by snoopen on Thursday November 05, 2020 @06:23AM (#24997310)
on my work MacBook we can't just brew install things, no admin permissions except for whitelisted things
Re:The Linux Commands HandBook by znpy on Thursday November 05, 2020 @03:29PM (#25001642)
Thank god somebody understands that not everybody is given toy macbooks to install whatever they like with no screening and/or block list.
Re:The Linux Commands HandBook by miked85 on Thursday November 05, 2020 @07:37PM (#25003691)
You can install brew to any directory, including your home directory.
Re:The Linux Commands HandBook by CamJN on Thursday November 05, 2020 @02:32PM (#25001166)
Lucky that you can install homebrew into your home directory with no admin rights then!
Re:The Linux Commands HandBook by rmrfstar on Thursday November 05, 2020 @11:27AM (#24999542)
Re:The Linux Commands HandBook by robertbalent on Thursday November 05, 2020 @06:08AM (#24997250)
What is the 'open' command? Is it alias for the 'xdg-open'?

Edit: Just noticed they are using MacOS. That makes it clear.

Re:The Linux Commands HandBook by saagarjha on Thursday November 05, 2020 @06:25AM (#24997319)
Kind of a poor title, tbh.
Re:The Linux Commands HandBook by afarviral on Thursday November 05, 2020 @10:53AM (#24999273)
Having read a few of the commands, I suddenly wish many of the man pages and help (not all) of common GNU/Linux commands could be re-written in the plainest and simplest of language, like this, or re-ordered with a simplistic explanation at the beginning and more detailed further down the file. Most commands on GNU/Linux require no background knowledge, or knowledge of the more powerful applications of the command and their man pages tend to just get in your way, even though they are clear and precise; by necessity they are difficult to read (since their goal is usually completeness, rather than accessibility).
Re:The Linux Commands HandBook by hansvs on Thursday November 05, 2020 @07:34AM (#24997679)
Um, so someone just copied in content from manpages?
Re:The Linux Commands HandBook by willis936 on Thursday November 05, 2020 @06:52AM (#24997422)
This is really handy. Is there a similar document on the UNIX ideology/file structure?
Re:The Linux Commands HandBook by red_admiral on Thursday November 05, 2020 @07:00AM (#24997470)
The file structure is standardised, the document you want for all the details is called the FHS (Filesystem Hierarchy Standard), though for a blog article you can also look at https://www.howtogeek.com/117435/htg-explains-the-linux-dire... for example.

For UNIX ideology (more commonly known as UNIX philosophy) you could do worse than http://www.catb.org/~esr/writings/taoup/html/index.html - especially chapter 1 for starters.

Re:The Linux Commands HandBook by bellweather49 on Thursday November 05, 2020 @09:59AM (#24998785)
Something I learned the other day is that on Linux you can type `man hier` in a terminal to get a description of the filesystem hierarchy
Re:The Linux Commands HandBook by teddyh on Thursday November 05, 2020 @08:42AM (#24998128)
Re:The Linux Commands HandBook by dclaw on Thursday November 05, 2020 @01:37PM (#25000684)
Surprising exclusion: the mount command
Re:The Linux Commands HandBook by 29athrowaway on Thursday November 05, 2020 @03:06AM (#24996462)
pushd and popd. Thank me later.
Re:The Linux Commands HandBook by LeonM on Thursday November 05, 2020 @06:46AM (#24997399)
Weird, my Ubuntu 20 install does not have man pages on pushd and popd. Are these commands be specific to bash?

Anyway, since we are on the topic of directory navigation, I'd like to introduce 'cd -' (toggle to previous dir). Thank me later :-)

Re:The Linux Commands HandBook by c2xlZXB5Cg on Thursday November 05, 2020 @09:25AM (#24998472)
https://www.youtube.com/watch?v=BJ0uHhBkzOQ

First example:

  type -a <something>
to discover what <something> is (or if it exists on your system)
Re:The Linux Commands HandBook by Fnoord on Thursday November 05, 2020 @07:46AM (#24997764)
They are shell-specific, yes. Fish also has it built-in.

Try man -a {pushd,popd} you can also use the man -k flag to find manpages, and see man man (or man --help) for more flags.

Re:The Linux Commands HandBook by rgrau on Thursday November 05, 2020 @08:05AM (#24997871)
zsh also has them.

Another neat way of wrapping code in pushd/popd is to use a subshell.

    (cd $dir
       do-stuff
    )
Oilshell ( https://www.oilshell.org/ ) has support for code blocks so you can:

    cd /tmp {
      do-stuff
    }
Re:The Linux Commands HandBook by roryrjb on Thursday November 05, 2020 @07:41AM (#24997720)
They are bash built-ins. They are documented in bash's man page.
Re:The Linux Commands HandBook by asicsp on Thursday November 05, 2020 @08:05AM (#24997878)
can also use `help pushd` to get manual only for that command ('help' is like 'man' for built-ins)
Re:The Linux Commands HandBook by LeonM on Thursday November 05, 2020 @11:24AM (#24999519)
This is what I needed. None of the man pages showed information on the bash functions. 'help' did the job.

Ironically, 'man help' yields no results.

Re:The Linux Commands HandBook by joombaga on Thursday November 05, 2020 @11:54AM (#24999757)
That's because `help` is also builtin. It's listed under "SHELL BUILTIN COMMANDS" in `man bash 1` (or use the non-obvious `help help`)
Re:The Linux Commands HandBook by yipbub on Thursday November 05, 2020 @08:29AM (#24998026)
Get docs for shell builtins with help. Eg: `help pushd`
Re:The Linux Commands HandBook by sceadu on Thursday November 05, 2020 @11:53AM (#24999751)
Also 'setopt autopushd' (and other related options) for zsh