20250412 Flashcards

1
Q

A simple command that lists users who are logged into a Linux server

A

who

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

What is | in Linux?
who | wc -l

A

it is pipe, a command that connects the output of who to the input of wc
The result is the number of lines in the output of who

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

What does cd command do if you don’t provide it with any argments?

A

Returns you to your home directory like:
/home/smith
The same as echo $HOME or echo ~cd

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

How to quickly go to somebody else’s home directory if you know there username? Like the username is Fred

A

cd ~fred

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

What are the three parts of system directories in linux and how is it in this directory:
usr/local/share/emacs

A
  • Scope usr/local - The purpose of the entire directory
  • Category share - The type of the files found in directory like lib or bin
  • Application emacs
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are /, /usr, and /usr/local purposes?

A

/ system files supplied with you distribution (considered lower level)
/usr more system file supplied with you distro
/usr/local system files that are not supplied with your distro - They may be unique to your local Linux distro or your individual computer

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

Name some category parts in Linux file systems and explain if necessary

A
  • bin binary files - executable programs
  • sbin programs for superusers
  • doc
  • info
  • man
  • etc Configuration files for the system
  • init.d Configuration files for booting Linux
  • src
  • cgi-bin
  • html
  • public_html
  • dev Device file for interfacing with disks and other hardware
  • media, mnt, var, lock, log, mail, run, spool, tmp
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is systemd and where it is located?

A

It is an aplication that is a service for configuring Linux machines - systemd contains configuration files for that service

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

Name some kernel-related directories

A
  • /boot - files for booting the system - the kernel lives here, typycally in /boot/vmlinuz or a file of a similar name
  • /lost+found - Damaged files that are rescued by a disk recovery tool (permission denied!)
  • /proc files for currently running processes - for advanced users
  • /sys files for kernel internals
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is -d option in ls command of linux

A

The -d option in the ls command stands for “directory”, and it changes the behavior of ls so that it shows information about the directory itself, rather than listing the contents inside the directory.

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

How to know which shell you are running?

A

echo $SHELL

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

To print a command’s (like find) location in your search path:

A

type find
which find

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

To add directories to your shell’s search path temporarily

A

You can append usr/sbin to your search path:
- PATH=$PATH:/usr/sbin

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

How to determine whether a command is in the filesystem, a built-in command, or an alias?

A

use the type command
- type wc cd

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