RedHat Flashcards
(103 cards)
w command
displays a list of users currently logged into the computer. This is especially useful to show which users are logged in using ssh from which remote locations, and what they are doing
ssh command
encrypts the connection to secure the communication against eavesdropping or hijacking of the passwords and content; i option is used to specify the user’s private key file; the private key file must be readable only by the user that owns the file (chmod 600 could be used to ensure this)
exit command
terminate the current shell session. Alternatively, finish a session by pressing Ctrl+D
date command
displays the current date and time; can be used to calculate a date in the future: date -d “+45 days” -u (The -u option reports the time in UTC.)
passwd command
changes a user’s own password; The superuser can use the passwd command to change other users’ passwords; passwd username command sets the initial password or changes the existing password of username.
file command
scans the beginning of a file’s contents and displays what type it is. The files to be classified are passed as arguments to the command.
cat command
create single or multiple files, view the contents of files, concatenate the contents from multiple files, and redirect contents of the file to a terminal or files.
less command
displays one page of a file at a time and lets you scroll at your leisure.
head and tail commands
display the beginning and end of a file, respectively. By default these commands display 10 lines of the file, but they both have a -n option that allows a different number of lines to be specified. The file to display is passed as an argument to these commands.
wc command
counts lines, words, and characters in a file. It takes a -l, -w, or -c option to display only the number of lines, words, or characters, respectively.
useradd command
used by the superuser, root, to create additional users on the system; Tab completion following a partial option can be used to complete the option without a lot of typing.
history command
displays a list of previously executed commands prefixed with a command number; exclamation point character (!) is a metacharacter that is used to expand previous commands without having to retype them. The !number command expands to the command matching the number specified. The !string command expands to the most recent command that begins with the string specified.
/ directory
root directory at the top of the file-system hierarchy
• static
content remains unchanged until explicitly edited or reconfigured
• dynamic or variable
content may be modified or appended by active processes
• persistent
content remains after a reboot, like configuration settings
• runtime
process- or system-specific content that is deleted by a reboot
/usr
Installed software, shared libraries, include files, and read-only program data. Important subdirectories include:
• /usr/bin: User commands.
• /usr/sbin: System administration commands.
• /usr/local: Locally customized software.
/etc
Configuration files specific to this system.
/var
Variable data specific to this system that should persist between boots. Files that dynamically change, such as databases, cache directories, log files, printer-spooled documents, and website content may be found under /var.
/run
Runtime data for processes started since the last boot. This includes process ID files and lock files, among other things. The contents of this directory are recreated on reboot. This directory consolidates /var/run and /var/lock from earlier versions of Red Hat Enterprise Linux.
/home
Home directories are where regular users store their personal data and configuration files.
/root
Home directory for the administrative superuser, root.
/tmp
A world-writable space for temporary files. Files which have not been accessed, changed, or modified for 10 days are deleted from this directory automatically. Another temporary directory exists, /var/tmp, in which files that have not been accessed, changed, or modified in more than 30 days are deleted automatically.