#tbt Do you think of the command line as an antiquated leftover from the past, or an old fashioned way of interacting with a computer? Think again. In Linux, the command line remains the most flexible and powerful way to perform tasks.
Nice article. Here are a some other things that may be worth knowing:
Linux is case sensitive, so /home/Name is different from /home/name ls -l show long listing format - displays permissions, owners, size, date ls -R recursively list files in subdirectories nano is a simple easy to use word processor, good for changing basic files vi is a powerful word processor, though a bit tricky to learn (need to remember various commands) mkdir dirname creates a directory called dirname
And that reason is that most users have no interest in learning how to get the most from a computer, only ever master an extremely small computing skill set, and are generally more concerned with ease of use than speed, flexibility or automation. It's absolutely true that general users don't need a command line, and are apt to be more effective with an ***** proof GUI than a tool that takes time to learn to use well. If you want to keep improving your ability to use a computer, however, then a GUI only takes you so far, and you need to learn to use and love a CLI.
The CLI was swapped in favor of the GUI. With a GUI though your limited to what is presented to you. With a CLI it's much more dynamic allowing for some powerful commands. Microsoft have even jumped on this with their addition of PowerShell. Obviously a CLI is not as user friendly so naturally guides like this exist. This guide is very well written.
Glad to see autocomplete and searching have been included - makes navigation so much faster. Every computing enthusiast should get an understanding of the commands presented (as they're now applicable to all OSs, including Windows).
You may be wondering 'why not use the mouse'? Because there will be times when you have to automate tasks, and CLI is the best way.
Good starting article. I did note that you mention piping cat to less which is fine to use as a simple example of how to use the pipe command. However, you don't need to pipe cat to less, you can just read the file using the less command I.e.. less myfile.sh Then you can traverse the file using the cursors or you can use the spacebar to move forward a page at a time, or the B key to move back a page at a time.
As a developer, you use the CLI frequently. Linux installs using things like RPM, but at the bottom of the GUI is config & make CLI processors. Linux also favors tar, gzip & gunzip
You can learn a lot of the CLI with the documentation package man and/or info
use man man for an overview
the terse synopsis is also seen using man -h (-h is the ms equiv of /?)
I'll also mention some directory navigation tricks of the shell (that thing that reads the CLI inputs you type)
given a login and a prompt like
# pwd gives the current working directory
moving to the webserver
-- do some work and then need to see a file in the home directory
-- go back to the webserver (without retyping the whole bloody thing again)
-- get to access server config
-- work on the server config
--- show you where we are
--- and move back to my home in one fell swoop
SO; pushd & popd operate like a stack; pushd moves to the new dir and places it on top popd forgets the top entry on the stack and makes the next one the current dir
pushd x; pushd y; creates y, x pushd without an argument toggles the top two dirs
Curious to see in point 5, cat file.txt is piped to the less command. Although it is a neat touch point to gently explain piping and how piping a long output from *any* command to less makes its navigable, it is far easier to contemplate `less file.txt`. As written it gives the impression that the only way you can read a long text file is with both cat and less. Same goes for point 6, I can `vi newfile.txt` instead of `touch newfile.txt; vi newfile.txt`
Like where you are going with that introducing concepts silently thing, just think people will go I can't open and page a file all in one command, this is crap!