Introduction Flashcards
What is the Linux directory for basic programs, and what are some example programs found there?
- /bin
- ls, cd, cat
What is the Linux directory for system programs, and what are some example programs found there?
- /sbin
- fdisk, mkfs, sysctl
What is the Linux directory for configuration files?
/etc
What is the Linux directory for applications, and what are some example programs found there?
- /usr/bin
- apt, ncat, nmap
What is the Linux directory for application support and data files?
/usr/share
What are the 8 sections of ‘man’ pages?
- User commands
- Programming interfaces and kernel sys calls
- Programming interfaces to the C library
- Special files such as device nodes and drivers
- File formats
- Games and amusements such as screen-savers
7, Misc - System administration commands
How would you search the ‘man’ page for the ‘passwd’ command with a keyword search for ‘passwd’?
man -k passwd
What would be the regex command to search the ‘man’ page for ‘passwd’ command to match on the entire line and avoid sub-string matches?
man -k ‘^passwd$’
How would you search the File Formats section of the man page for the ‘passwd’ command?
man 5 passwd
What are the three commands to find files in Linux?
- which
- find
- locate
What is the database used by the ‘locate’ command to search for files in Linux? How do you update this db?
- locate.db
- sudo updatedb
How do you start SSH in Linux?
sudo systemctl start ssh
What does the ‘ss’ command do?
- ‘ss’ = another utility to investigate sockets
- used to dump socket statistics
- allows showing information similar to netstat
- it can display more TCP and state information than other tools
What does the command ‘ss -antlp’ do?
- ‘a’ = all; displays both listening and non-listening sockets
- ‘n’ = numeric; shows exact bandwidth values, not human-readable
- ‘t’ = tcp sockets
- ‘p’ = process; show process using the socket
- ‘l’ = listening; display only listening sockets
What command would enable SSH to run at start?
sudo systemctl enable ssh
What command starts the Apache server?
sudo systemctl start apache2
What command displays a list of all available services?
systemctl list-unit-files
What command completely removes the package pure-ftpd from Linux?
sudo apt remove –purge pure-ftpd
What is PATH?
- a colon-separated list of directory paths that Bash will search through whenever a command is run without a full path
How do you display the contents of the PATH environment variable?
echo $PATH