Re:Most Important Linux Commands Cheatsheet
by eternityforest on Saturday January 15, 2022 @11:25AM
(#29947612)
This is the best list I've seen in this genre, because it excludes a lot of commands that you don't need and probably won't want to use in a modern mostly-GUI workflow, and even gives the appropriate scary warning for rm.
If you need something like dd, or any of the "real programming" stuff like if statements and xargs, you probably really love it all and will find it yourself. If you just do a few things in shell and use Python and GUI for the rest, these Are the main ones.
Slightly less common ones I'd add:
kill and killall
ps -aux | grep APPNAME
(Technically not a single command, but it's 90% of my use of ps or grep, so it might as well be it's own command)
cowsay, fortune, neofetch, and lolcat, sl
Not actually included in shell but people should know about them anyway.
It's said that Arch users are legally required to stare at the output of neofetch once per hour at minimum.
Various systemctl commands:
start, stop, status, enable, disable, mask
systemd-analyze critical-chain
nmtui
(Not sure which distros include this by default and which don't)
dmesg
journalctl, dmesg
sudo reboot now
sudo shutdown now
units
(Usually not included, gotta install it)
ping, ip a
Also, this would be fantastic to include in educational material or even add directly to a distro. Does it have a license?
Re:Most Important Linux Commands Cheatsheet
by Maursault on Thursday January 13, 2022 @07:40PM
(#29929102)
Thank goodness for Linux. Where would UNIX and BSD be without the most important Linux commands? I kid. No Linux commands listed, only shell commands. I'd like to initiate a cutesy repeatable Ghostbuster's themed meme: There is no Linux. There is only shell. Maybe if it is popular enough, the zealots will stop insisting GNU/Linux is the center of the cosmos, but I doubt it.
Re:Most Important Linux Commands Cheatsheet
by xt00 on Friday January 14, 2022 @12:13AM
(#29930831)
I would tweak the redirect info to have “xxx &> file” in there since that’s one that is often confusing to people early on that want to output stdout and stderr to a file and are confused about how to do that. But yea the list of stuff here is a nice starter list for sure.
Re:Most Important Linux Commands Cheatsheet
by nhutton on Friday January 14, 2022 @06:45AM
(#29933284)
I know that people like to use ctrl-R to search backwards through history, but I am very zealous about using the up-arrow to search through your history instead (in your .bashrc):
Re:Most Important Linux Commands Cheatsheet
by gnubison on Saturday January 15, 2022 @12:39AM
(#29943884)
Pedantic-er note: ^D isn’t necessarily the VEOF character — you can change it with tcsetattr() after modifying termiosp->c_cc[VINTR] or by using stty(1). And it doesn’t send an “EOF character” (EOF is a condition/convention more than a character). All it does is make read(2) return immediately with whatever data is currently in the line buffer. You can try it now:
$ cat
something^Dsomething^D
$ cat
VEOF causes the tty driver (tty(4)) to send “something” to cat immediately; and cat echoes that back out to the terminal as intended.
If there’s nothing in the line-buffer (because you pressed VEOF at the start of the line) then read(2) returns 0, which is interpreted as an end-of-file condition by your libc in fread() and friends.
You can checkout OpenBSD’s termios(4) for a more detailed explanation :)
Re:Most Important Linux Commands Cheatsheet
by dmckeon on Thursday January 13, 2022 @09:30PM
(#29929933)
The content is useful, and familiar to any experienced Unix/Linux user,
but formatting that content as a table with many heavily folded lines
nearly ruins the content for any really new user.
If you need something like dd, or any of the "real programming" stuff like if statements and xargs, you probably really love it all and will find it yourself. If you just do a few things in shell and use Python and GUI for the rest, these Are the main ones.
Slightly less common ones I'd add:
kill and killall
ps -aux | grep APPNAME
(Technically not a single command, but it's 90% of my use of ps or grep, so it might as well be it's own command)
cowsay, fortune, neofetch, and lolcat, sl
Not actually included in shell but people should know about them anyway.
It's said that Arch users are legally required to stare at the output of neofetch once per hour at minimum.
Various systemctl commands:
start, stop, status, enable, disable, mask
systemd-analyze critical-chain
nmtui (Not sure which distros include this by default and which don't)
dmesg
journalctl, dmesg
sudo reboot now
sudo shutdown now
units (Usually not included, gotta install it)
ping, ip a
Also, this would be fantastic to include in educational material or even add directly to a distro. Does it have a license?
man
grep
sed
find
piping and redirect
xargs
looping
Knowing the basics of those unlocks a lot of the power of the shell. You can you them to brute force your way through most problems as you learn more.
bindkey "^[[a" history-beginning-search-backward
bindkey "^[[B" history-beginning-search-forward
Said EOF is honoured by your TTY, which closes the FD this ending the session.
You can see this by typing `cat -` and ending it with ctrl+d. The windows equivalent is ctrl+z.
If there’s nothing in the line-buffer (because you pressed VEOF at the start of the line) then read(2) returns 0, which is interpreted as an end-of-file condition by your libc in fread() and friends.
You can checkout OpenBSD’s termios(4) for a more detailed explanation :)
I work with clients for whom this knowledge will be greatly useful. CTRL-R is a revelation, every time.