Command Line Operations (CLOs) - Basic Operations Flashcards

1
Q

With what command can you after pressing Alt + F2 open the terminal?

A

gnome-terminal

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are four main commands, often used?

A

man: view documentation
head: show first lines of file
tail: show last lines of file
cat: type out a file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the three basic elements of most input lines at shell prompts? What do they do?

A
  • command (name of program or script ot be executed)
  • options (modify what the command does)
  • arguments (what command operates on)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How are options distinguished from arguments?

A

By starting with one or two dashes
i.e.
-p or –print

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are Virtual Terminals? (VT)

A
  • console sessions that use the entire display and keyboard outside of a graphical environment
  • considered virtual, because only one terminal remains visible at a time
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

For what are Virtual Terminals useful?

A
  • i.e. when you run into problems with the graphical desktop
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How can a Virtual Terminal be accessed?

A

Ctrl + Alt + Function Key
(1-7)
7 -> graphical desktop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How can the graphical desktop be started/stopped?

A

Depends on the distro
Newer system-based distros use systemctl

like
sudo systemctl stop gdm or sudo telinit 3

restart it
sudo systemctl start gdm or sudo telinit 5

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How can you log in and log out using the ssh command?

A

ssh student@remote-server.com

  • would connect securely to remote machine (remote-server.com)
  • and give student a command line terminal window
  • using either a password or a cryptographic key to sign in without providing a password to verify the identity
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What happens when you run the shutdown command?

A
  • sends a warning message
  • prevents further users from logging in
  • init process takes control shutting down or rebooting the system
  • its important to always shutdown properly; failure to do so can result in damage to the system and/or loss of data
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Which commands can be used to shutdown a machine?

A
  • shutdown
  • halt (runs shutdown -h)
  • poweroff (runs shutdown -h)
  • reboot (runs shutdown -r)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How can you locate the folder of a command?

A

using which utility

Like
which diff
output: /usr/bin/diff

Alternatively, if which does not find it:
whereis diff

-> looks for packages in a broader range of system directories
Also locates source and man files packaged with the program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How can you see what you home directory is?

A

echo $HOME

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are four useful commands for directory navigation?

A
  • pwd: displays present working directory
  • cd ~ or cd : change to your home directory; shortcut name is ~ (tilde)
  • cd .. : change to parent directory
  • cd - : change to previous working directory
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What does the command do:
pushd /folder

A

Changes the folder to target and adds it to history list, from where you came

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What does the command do:
popd /folder

A

Puts you back in the history, created with pushd
Walking in reverse order, most recent directory will be the first one retrieved with popd)

17
Q

How does an absolute Path start?

A

always with /

18
Q

How are multiple / dealth with as a pathname?

A

valid but seen as only one /

19
Q

How can you get a birds-eye view of a filesystem?

A

command:
tree -d

to see just directories and to suppress listing file names

20
Q

What shortcut can clear a terminal?

A

Crtl + L

21
Q

How can you view the sizes of filesystems?

A

df -h

22
Q

What does the command do:
ls -li

A
  • i option prints out in the first column the inode number, a unique quantity for each file object
23
Q

How can you create a hard link to a file?

A

ln file1 file2

24
Q

What is a hard link?

A
  • also called symbolic links
  • points to the exact same data as the original link
25
Q

What is important to think about when working with hard links?

A
  • can easily lead to subtle errors
  • editing files linked to with a hard link might have consequences, depending on the editior: most retain the link by default, but not all
26
Q

How can you create soft links?

A

ln -s file1 file3

27
Q

What is a soft link?

A
  • take no extra space in file system (unless names are very long)
  • extremely convenient
  • can be easily modified to point to different places
28
Q

How do soft links differ from hard ones?

A
  • soft links can point to objects even on different filesystems, partitions and or disks and other media
  • which may currently not be available or exist
  • if so, you obtain a dangling link
29
Q

how can you see the list of directories created with pushd?

A

dirs

30
Q
A