Chapter 2 Flashcards Preview

NDG Linux 103 > Chapter 2 > Flashcards

Flashcards in Chapter 2 Deck (32):
1

Aliases

  • Can be used to map longer commands to shorter key sequences
  • New aliases can be created using the following format, where name is the name to be given the alias and command is the command to be executed when the alias is run.
    • alias name=command

2

Functions

  • Can be built using existing commands to either create new commands, override commands built-in to the shell or commands stored in files.

3

apt-cache command

  • Allows us to display information from the APT database cache
  • Commonly used to find information about programs you wish to install and the components required to make them work

4

Argument

  • An argument can be used to specify something for the command to act upon.
  • Following a command, any desired arguments are allowed or are required depending on the command.

5

Touch command

  • Used to create empty files or update the timestamp of existing files.

6

ssh rsa key

  • A file that contains an authentication credential (similar to a password) used to verify the identity of a machine that is being logged into using the ssh command. 

7

Double quotes

Prevents the shell from interpreting some of the special characters

8

Single quotes

  • Prevents the shell from interpreting any special characters
  • Single quotes are considered safer and should probably be used whenever you have an argument that contains characters that aren't alphanumeric.

9

Options

  • Options can be used with commands to expand or modify the way a command behaves.
  • Short options are specified with a hyphen - followed by a single character.
  • Often the character is chosen to be mnemonic for its purpose, like choosing the letter l for long or r for reverse.
  • In most cases, options can be used in conjunction with other options.
    • They can be given as separate options like -l -r or combined like -lr

10

ls - r

lists files in reverse order

11

Long Options

  • Preceded by --
  • Used when its longer than a single character
    • ex. ls --all

12

ls -w

Specifies the width of the output desired 

Usually requires an argument

ex. ls -lr -w 40

13

ls -T

Tab size

14

ls --all

Lists all files, including hidden files

15

Exec command

Takes another command to execute as an argument

16

Wrapper Script

  • When the purpose of a script is to simply configure and launch another program
  • A wrapper script often uses the following as the last line of the script to execute another program.

    •  

      exec program

17

uname Command

Displays system information

18

uname -a

All information

19

uname -s

Kernel name

20

uname -n

Network node name

21

uname -r

Kernel Release

R is for release

22

uname -v

Kernel version

23

uname -m

Machine hardware name

24

uname -p

Processor type

25

uname -i

Hardware platform 

26

uname -o

Operating system

27

type Command

Displays information about a command type

28

type -a

Shows all locations of the files that contain a command

29

/bin

Contains executable programs needed for booting a system

30

/sbin

Contains executable programs which are mainly commands and tools designed for system admin

31

which Command

Searches for the location of a command in the system by searching the PATH variable

32