Linux tutorial, part 5

Using command-line expansion

Now, if I'm really cool, I don't actually type out that whole remove command, do I? As a practical matter I usually just type in something like this:

rm de

and then hit the [Tab] key, and if "delete.me" is the only file in the current directory beginning with the characters "de" the Unix system expands my command line to look like this:

rm delete.me

Pretty cool, eh? That part is called "command-line expansion", and it makes life very easy.

BTW, it still works if you have 100 files in the current directory beginning with the letters "de", but the system will prompt you and say "There are 100 possibilities, do you want to see them all? (y/n)". Again, very cool.

So now I have the file on the remote system in the directory I want it, so my work here is done. A novice user might type something like "exit" to log off the remote system, but I haven't done that in about 15 years now. Just type [Ctrl][d] (the "Control" key and letter "d") and I'm logged off the remote system, and my prompt changes back to whatever it looks like on the local system.

(And yes, I could have just used the scp command to copy the file right to the destination directory I wanted it in, but that wouldn't help my demonstration much, would it?)

As a Unix/Linux user, a lot of my command-line life looks just like that. Of course there are many more commands available, but those are some of the basics.

Summary

To summarize this session I've just shown you some of the most common things to do when working on one or more Unix systems:

  • How to open a terminal
  • How to copy files to a remote system
  • How to login to a remote system
  • How to move between directories
  • How to move and copy files on a Unix system
  • How to remove files on a Unix system
  • How to list files and directories on a Unix system
  • How to look at file contents with the "more" and "cat" commands

You wouldn't think that there'd be much more to see, but it turns out I've just touched on a very small tip of the overall iceberg. Unix systems are incredibly powerful environments, and there's a whole lot more to see ... if you're interested.

More Unix/Linux resources

Here are some of my other Unix/Linux resources: