20250412 Flashcards
A simple command that lists users who are logged into a Linux server
who
What is | in Linux?
who | wc -l
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
What does cd
command do if you don’t provide it with any argments?
Returns you to your home directory like:/home/smith
The same as echo $HOME
or echo ~
cd
How to quickly go to somebody else’s home directory if you know there username? Like the username is Fred
cd ~fred
What are the three parts of system directories in linux and how is it in this directory:usr/local/share/emacs
- Scope
usr/local
- The purpose of the entire directory - Category
share
- The type of the files found in directory likelib
orbin
- Application
emacs
What are /
, /usr
, and /usr/local
purposes?
/
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
Name some category parts in Linux file systems and explain if necessary
-
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
What is systemd
and where it is located?
It is an aplication that is a service for configuring Linux machines - systemd contains configuration files for that service
Name some kernel-related directories
-
/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
What is -d option in ls command of linux
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 to know which shell you are running?
echo $SHELL
To print a command’s (like find) location in your search path:
type find
which find
To add directories to your shell’s search path temporarily
You can append usr/sbin
to your search path:
- PATH=$PATH:/usr/sbin
How to determine whether a command is in the filesystem, a built-in command, or an alias?
use the type
command
- type wc cd