Linux Commands

Chapter 5 Linux commands

Introduction

This chapter is a work in process.

If you have any comments, questions or suggestions

drop me an email at author@myraspi.tech

This chapter will list various common and not so common Linux commands and how tow/where to use them.

CTRL commands

These commands consist of pressing the CTRL key plus a letter or number key at the same time. I will just list the letter or number and then describe what the combination does. This program automatically sets the letter to caps but when used with the CTRL key you should use a lower case letter.

As I am entering the data for this chapter I am learning about what of the keys I never use can do. Some of the commands can be used in a lot of applications and some might be specific to a certain application, like ctrl+e below where it did not do anything in this document. Also when clicking on any of the top menu items it will show some of the ctrl+key will do so if you can’t remember a certain combination you can look at the menu.

They say: “It is what you learn after you know it all that counts!!!”. So by writing this book I am still learning stuff. Now to remember it when I need it.

  • A – This will mark all of the text in the document where the cursor is. This is short for ALL.

  • B – This will set characters to BOLD. This can be used in several ways.

    1. While typing you can either use ctrl+b or click on the B on the toolkit line at the top of the screen to make the following text to be BOLD and then pressing ctrl+b again will turn it off, so it acts like an on/off switch.
    2. If your text is already written you can highlight it either with the mouse or shift+arrow keys and then following the above instructions.
  • C – This will copy text you have highlighted either by ctrl+a for all text or by using the mouse or shift+arrow keys.

  • D – Thus will turn on/off the underline key to be used like above for BOLD.

  • E – This will turn the center option for your text. In the Geany text editor program it will turn everything that is highlighted into comments by adding a “# - " to the front of all highlighted lines.

  • F – This will open a box (generally at the bottom of the screen where you can enter a search word or phrase. So it is short for FIND.

  • G – In the LibreOffice writer program I am using it opened a box asking what page I wanted to go to. So this is the Go to Page command.

  • H – This opened a large box titled “Find and Replace”. This can also be accomplished by clicking on the Edit menu option or in LibreOffice Writer there is also an icon on the top line menu.

  • I – This will Italicize the highlighted text like B & D above.

  • J – This will turn on the justification of text so the right hand side is an even margin the same as the left edge.

  • K – This will open a box where a hyperlink can be entered within a document.

  • L – Did nothing in this application. May be used in other applications.

  • M – When looking a the “Format” menu option it says this is used to “Clear Direct Formatting”.

  • N – Opened a New document of the type I am using here.

  • O – Opened a box to open another file.

  • P – This will open a Print dialog where you can set print settings.

  • Q – Will close the application with a dialog asking if you want to save the document before closing. Also has a cancel button if pressed in error.

  • R – Sets the document to Right Alignment. Similar to ctrl+e which sets center alignment.

  • S – Will Save your document using the name and location from where it was opened.

  • T – I could not find any mention where the ctrl+t is used. Possibly it is used in some other application.

  • U – This is like the ctrl+d combination where it will set the text to be Underlined like the ctrl+b and the ctrl+i. These three commands can be used together all together or in any combination.

  • V – This can be used any text that has been copied (ctrl+c) or cut (ctrl+x to be discussed below). Just imagine the point of the letter V to be an arrow head pointing to where the text should be pasted.

  • W – This will close the application with a dialog box asking if you want to save the document before quitting it.

  • X – This will cut the highlighted text. Think of it as a pair scissors where it will cut. The cut text can then be pasted by pressing ctrl+v. This is known as cut and paste where the ctrl+c and ctrl+v combination is know as copy and paste.

  • Y – I did not find any use for the command.

  • Z – Last but not least comes the letter “Z”. This is known as the error fixer command as it will UNDO the last command if you should have made an error. Every time this is pressed it will UNDO another command in the list of commands.

  • 0 – This is used in the styles menu to set the text body in LibreOffice Writer documents.

  • 1 - 5 – Will set Heading 1 - 5 styles.

  • Other combinations consist of using the Shift key in combination with the Ctrl key with Letter keys, Number keys and/or F keys (at top of keyboard). So far I have not found a use for them.

Directory commands: #

  • mkdir – Creates a new directory. If you get a "permissions required" error message reenter the command with "sudo" in front.
  • cd directory_name -- Change to a new named directory.
  • cd .. - Change to the next higher directory.
  • rm -rf -- Removes a directory and all files contained in that directory.
  • rm file_name – Removes/Deletes the named file.
  • rm *.ext – Removes/Deletes all files with specified extension.

File commands #

  • cp file1 file2 - This will copy file1 to file2, which can be in another directory with a different name.
  • mv file1 file2 -- This will move a file to another directory or rename the file to a new name in the same directory.
  • scp file1 file2 – This will securely copy a file. This can be used to copy a file from one computer to another.
  • Rsync – This will copy a group of files from one computer to another. I will ONLY copies that have been changed on the source. There are a number of options that can be used with this command.

List commands #

  • ls -- Lists files in the directory on a line horizontally
  • ls -l -- Lists files with all attributes in a vertical list
  • ls -la -- Lists all files, including hidden files in a directory.
  • ls -lart -- Lists all files, including hidden files sorted by date with newest ones at the bottom in the directory.

Summary #

This chapter has listed some common and not so common Linux commands. More will be added as I think of them or use them.

These commands are designed using LibreOffice on Linux but as noted some can also be used in other applications in different operating systems. LibreOffice is also available on the other operating systems. When I entered some of the commands the word processing program capitalized some of the first letters. All commands should be entered in lower case.

Back in the old days when I still used Windows and DOS is where I started using some of these commands. As the Apple operating system has been made into a proprietary version of Linux some of these commands can also be used on that system.

I also found an on-line source with a lot more commands than what I have listed here. It is https://www.linuxtrainingacademy.com/linux-commands-cheat-sheet/.

Have fun learning and using these Linux commands.

comments powered by Disqus