All Flashcards
DEFAULT
list the common shells
bash #The GNU Bourne Again Shell
sh #The Bourne shell upon which bash is based
tcsh #This shell is based on the earlier C shell
csh #The original C shell
ksh #The Korn shell; bourne shell+c shell+extended
zsh #The Z shell takes shell evolution further than the Korn shell
DEFAULT
what is an internal command
a command that is built into the shell program
DEFAULT
what is an external command
a command that is not built into the shell program
DEFAULT
how do you reverse search for a command in your history
ctrl+r
DEFAULT
how do you search for a command in your history
ctrl+s
DEFAULT
how do you terminate a search through your command history
ctrl+g
DEFAULT
how do you move your shell cursor to the beginning of the line
ctrl+a
DEFAULT
how do you move your shell cursor to the end of the line
ctrl+e
DEFAULT
how do you move the shell cursor back one character
Ctrl+b
DEFAULT
how do you move the shell cursor forward one character
Ctrl+f
DEFAULT
how do you delete the character under the shell cursor
Ctrl+d
DEFAULT
how do you delete all text from the shell cursor to the end of the line
ctrl+k
DEFAULT
how do you delete all of the text from the shell cursor to the beginning of the line
Ctrl+x and then Backspace
DEFAULT
how do you transpose the character before the cursor with the character under the shell cursor
ctrl+t
DEFAULT
how do you transpose the two words immediately before (or under) the shell cursor
Esc and then t
DEFAULT
how do you convert text from the shell cursor to the end of the word to uppercase.
Pressing Esc and then u
DEFAULT
how do you convert text from the cursor to the end of the word to lowercase
Esc and then l
DEFAULT
how do you convert the letter under the cursor (or the first letter of the next word) to uppercase; leaving the rest of the word unaffected.
Esc and then c
DEFAULT
how do you launch a full-fledged editor to edit a command at the shell
Ctrl+x followed by Ctrl+e
DEFAULT
how do you set an enviornment variable
VARNAME=VALUE
DEFAULT
how do you save an environment variable across sessions
export VARNAME
DEFAULT
how do you set and save an environment variable across sessions
export VARNAME=VALUE
DEFAULT
what is man section 1
Executable programs and shell commands
DEFAULT
what is man section 2
System calls provided by the kernel
DEFAULT
what is man section 3
Library calls provided by program libraries
DEFAULT
what is man section 4
Device files (usually stored in /dev )
DEFAULT
what is man section 5
File formats
DEFAULT
what is man section 6
Games
DEFAULT
what is man section 7
Miscellaneous (macro packages; conventions; and so on)
DEFAULT
what is man section 8
System administration commands (programs run mostly or exclusively by root )
DEFAULT
what is man section 9
Kernel routines
DEFAULT
what is stdin’s file descriptor
0
DEFAULT
what is stdout’s file descriptor
1
DEFAULT
what is stderr’s file descriptor
2
DEFAULT
how do you specify all numbers and letters in the tr command
[:alnum:]
DEFAULT
how do you specify all uppercase letters in the tr command
[:upper:]
DEFAULT
how do you specify all lowercase letters in the tr command
[:lower:]
DEFAULT
how do you specify all numbers in the tr command
[:digit:]
DEFAULT
how do you specify a range of characters in the tr command
You can specify a range of characters by separating them with dashes ( - ); as in A-M
DEFAULT
how do you move forward one screen in less
spacebar
DEFAULT
how do you move back one screen in less
Esc followed by v
DEFAULT
how do you do a search in less
/STRING
DEFAULT
how do you do a backward search in less
?STRING
DEFAULT
how do you move to the next search result in less
n
DEFAULT
how do you move to the previous search result in less
N
DEFAULT
how do you go to a specific line in less
gNUMBER
DEFAULT
how do you display the help system in less
h
DEFAULT
what are the extended regular express characters
? + | ( )
DEFAULT
what is the windows newline
/r/n
DEFAULT
what is the mac newline
/n
DEFAULT
what is the linux newline
/n
DEFAULT
how could you use tr to convert from windows to linux format line endings
tr -d \r < dosfile.txt > unixfile.txt
DEFAULT
how could you use sed to convert from linux to windows line endings
sed “”s/$/\r/”” unixfile.txt > dosfile.txt
DEFAULT
describe the naming convention of this rpm package: string-a.b.c-x.y.rpm
string = Package Name a.b.c = Version Number x = Build Number y = Architecture
DEFAULT
How would you use rpm to install or upgrade package samba-4.1.9-4.fc20.x86_64.rpm from an RPM file that you have already downloaded to your local system
rpm -Uvh samba-4.1.9-4.fc20.x86_64.rpm
DEFAULT
how would you query information on the installed package samba using rpm
rpm -qi samba
DEFAULT
how would you convert samba-4.1.9-4.fc20.src.rpm to samba-4.1.9-4.fc20.src.cpio
rpm2cpio samba-4.1.9-4.fc20.src.rpm > samba-4.1.9-4.fc20.src.cpio
DEFAULT
how would you extract samba-4.1.9-4.fc20.src.cpio
cpio -i –make-directories < samba-4.1.9-4.fc20.src.cpio
DEFAULT
how would you extract samba-4.1.9-4.fc20.src.rpm on a system without rpm
rpm2cpio samba-4.1.9-4.fc20.src.rpm | cpio -i –make-directories
DEFAULT
how do you install samba_4.1.6+dfsg- 1ubuntu2.1404.3_amd64.deb
dpkg -i samba_4.1.6+dfsg-1ubuntu2.1404.3_amd64.deb
DEFAULT
how do you uninstall samba using dpkg
dpkg -r samba
DEFAULT
what information is displayed by ps
username; process id; parent process id; tty; cpu time; cpu priority; memory usage; command
DEFAULT
how do you send a program to the background
ctrl+z
DEFAULT
what is process signal 1 and what does it do
SIGHUP ; which terminates interactive programs and causes many daemons to reread their configuration files
DEFAULT
what is process signal 9 and what does it do
SIGKILL ; which causes the process to exit without performing routine shutdown tasks)
DEFAULT
what is process signal 15 and what does it do
SIGTERM ; which causes the process to exit but allows it to close open files and so on
DEFAULT
what is process signal SIGHUP and what does it do
1 ; which terminates interactive programs and causes many daemons to reread their configuration files
DEFAULT
what is process signal SIGHKILL and what does it do
9 ; which causes the process to exit without performing routine shutdown tasks)
DEFAULT
what is process signal SIGHTERM and what does it do
15 ; which causes the process to exit but allows it to close open files and so on
DEFAULT
what is an interrupt request
a signal sent to the CPU instructing it to suspend its current activity and to handle some external event such as keyboard input
DEFAULT
what is IRQ 0
system timer
DEFAULT
what is IRQ 1
keyboard
DEFAULT
what is IRQ 2
handles IRQ 8-15
DEFAULT
what is IRQ 3
COM2
DEFAULT
what is IRQ 4
COM1
DEFAULT
what is IRQ 5
LPT2 / Sound card
DEFAULT
what is IRQ 6
Floppy controller
DEFAULT
what is IRQ 7
parallel port
DEFAULT
what is IRQ 8
real time clock
DEFAULT
what is IRQ 12
ps2 mouse
DEFAULT
what is IRQ 13
floating point proc
DEFAULT
what is IRQ 14
primary IDE
DEFAULT
what is IRQ 15
secondary IDE
DEFAULT
what are i/o addresses
unique locations in memory that are reserved for communications between the CPU and specific physical hardware devices
DEFAULT
what is direct memory addressing
an alternative method of communication to I/O ports. Rather than have the CPU mediate the transfer of data between a device and memory; DMA permits the device to transfer data directly; without the CPU’s attention
DEFAULT
how does the BIOS boot process begin
the computer reading a boot sector (typically the first sector) from a disk and then executing that code
DEFAULT
how does the EFI boot process begin
the computer reading a boot loader file from a filesystem on a special partition; known as the EFI System Partition (ESP) . This file either can take a special default name or can be registered in the computer’s NVRAM
DEFAULT
what is the HAL Daemon
The Hardware Abstraction Layer (HAL) Daemon ; or hald ; is a user-space program that runs at all times (that is; as a daemon) and provides other user-space programs with information about available hardware
DEFAULT
what is the D-Bus
The Desktop Bus (D-Bus) provides a further abstraction of hardware information access. Like hald ; D-Bus runs as a daemon. D-Bus enables processes to communicate with each other as well as to register to be notified of events; both by other processes and by hardware (such as the availability of a new USB device).
DEFAULT
what is mbr partition code 0x0c
fat
DEFAULT
what is mbr partition code 0x05
old extended code
DEFAULT
what is mbr partition code 0x07
ntfs
DEFAULT
what is mbr partition code 0x0f
newer extended code
DEFAULT
what is mbr partition code 0x82
linux swap
DEFAULT
what is mbr partition code 0x83
linux filesystem
DEFAULT
what is mbr partition code 0x8e
LVM
DEFAULT
what directories should never be on a seperate partition from /
/bin /dev /etc /lib /sbin
DEFAULT
describe ext2fs
traditional Linux-native filesystem; no journaling
DEFAULT
describe ext3fs
ext2 with journaling
DEFAULT
describe ext4fs
ext3 with performance and size extensions
DEFAULT
describe ReiserFS
designed from scratch as a journaling filesystem for Linux. It’s particularly good at handling large numbers of small files (
DEFAULT
describe JFS
IBM developed the Journaled File System (JFS) for its AIX OS on mainframe systems and later reimplemented it on its attempt at a workstation OS; called OS/2. After the demise of OS/2; the OS/2 version of JFS was subsequently donated to Linux
DEFAULT
describe XFS
Silicon Graphics (SGI) created its Extents File System (XFS) for its IRIX OS and; like IBM; later donated the code to Linux. Like JFS; XFS is a very technically sophisticated filesystem. XFS has gained a reputation for robustness; speed; and flexibility on IRIX; but some of the XFS features that make it so flexible on IRIX aren’t supported well under Linux.
DEFAULT
describe Btrfs
is an advanced filesystem with features inspired by those of Sun’s Zettabyte File System (ZFS).
DEFAULT
describe FAT
old and primitive—but ubiquitous. It’s the only hard disk filesystem supported by DOS and early versions of Windows (such as the Windows 9 x series and the short-lived Windows Me). For this reason; every major OS understands FAT;
DEFAULT
describe NTFS
the preferred filesystem for Windows NT and beyond. Unfortunately; Linux’s NTFS support is rather rudimentary. As of the 2.6. x kernel series; Linux can reliably read NTFS and can overwrite existing files; but the Linux kernel can’t write new files to an NTFS partition. There are separate drivers outside of the kernel that you can use in Linux to create new files on an NTFS filesystem
DEFAULT
describe HFS[+]
Apple has long used the Hierarchical File System (HFS) with its Mac OS; and Linux provides full read/write HFS support. This support isn’t as reliable as Linux’s read/write FAT support; though; so you may want to use FAT when exchanging files with Mac users.
DEFAULT
describe ISO-9660
CD-ROMs; Linux Rock Ridge extensions; Joliet Windows extensions
DEFAULT
describe UDF
Universal Disc Format (UDF) is the next-generation filesystem for optical discs. It’s commonly used on DVD-ROMs and recordable optical discs. Linux supports it; but read/write UDF support is still in its infancy.
DEFAULT
describe the /etc/fstab file format
#device mount point filesystem options dump(1 means the dump program should do a dump) fsck(fsck check order, 0 means don't check) e.g. UUID=3631a288-673e-40f5-9e96-6539fec468e9 \ /usr reiserfs defaults 0 0
DEFAULT
what does ““credentials=/etc/creds”” in the options column of the /etc/fstab signify
the login credentials(username and password) are stored in /etc/creds
DEFAULT
what characters should not be used in filenames
- ? / \ “”
DEFAULT
what are the wildcard expansion characters
? * [a-z]
DEFAULT
what are the three timestamps on each file
Last file-modification time
Last inode change time
Last access time
DEFAULT
how would you compress ∼/my-work and gzip it into /media/pen/my-work.tgz
tar cvfz /media/pen/my-work.tgz ∼/my-work
DEFAULT
what are the file type codes displayed by ls -l
- normal file
d directory
l symlink
p named pipe (A pipe enables two running Linux programs to communicate with each other. One opens the pipe for reading; and the other opens it for writing; enabling data to be transferred between the programs)
s socket (similar to a named pipe; but it permits network and bidirectional links)
b block device (a file that corresponds to a hardware device to and from which data is transferred in blocks of more than 1 byte. Disk devices (hard disks; USB flash drives; CD-ROMs; and so on))
c character device (a hardware device to and from which data is transferred in units of 1 byte. Examples include parallel port; RS-232 serial port; and audio devices)
DEFAULT
what does the directory execution bit do
When a directory’s execute bit is set; that means that the directory’s contents may be searched
DEFAULT
what does the write bit on a directory do
if a user can write to a directory; that user can create; delete; or rename files in the directory as well
use the sticky bit to alter this behavior
DEFAULT
what are the permissions of a symlink
always 777
trying to change it’s permissions will affect the file it points to
DEFAULT
how is set user id represented
4000
SUID
s in the owner’s execute bit
If the SUID bit is set on a file without execution permission set; the permission string appears with a capital S ; as in rwSr-xr-x . However; in this case; SUID will not function and the setting is called benign .
DEFAULT
how is set group id represented
2000
SGID
s in the group’s execute bit
f the SGID bit is set on a file without execution permission set; the permission string appears with a capital S ; as in rwsr-Sr-x . Also in this case the setting is benign.
SGID is also useful on directories. When the SGID bit is set on a directory; new files or subdirectories created in the original directory will inherit the group ownership of the directory rather than be based on the user’s current default group
DEFAULT
how is sticky bit represented
1000
t in the world’s execute bit
When this bit is present on a directory; the directory’s files can be deleted only by their owners; the directory’s owner; or root
DEFAULT
what is a typical default umask
002 or 022
DEFAULT
how would you set the permissions of newly created folders to have rwxrxrx permissions symbolically
umask u=rwx,g=rx,o=rx
DEFAULT
how would you add user quota support to a mount point in /etc/fstab
/dev/sdc5 /home ext4 usrquota 1 1
DEFAULT
how would you add group quota support to a mount point in /etc/fstab
/dev/sdc5 /home ext4 grpquota 1 1
DEFAULT
how would you add user and group quota support to a mount point in /etc/fstab
/dev/sdc5 /home ext4 usrquota,grpquota 1 1
DEFAULT
what is the old filesystem structure for linux called
FSSTND
Filesystem Standard
Standardized the programs that reside in
/bin and /usr/bin.
Specified that executable files shouldn’t reside in
/etc
Removed changeable files from the
/usr
enabling it to be mounted read-only (a useful security measure).
DEFAULT
what is the current filesystem structure
Filesystem Hierarchy Standard (FHS)
Shareable; Unshareable; Static; Variable
DEFAULT
what are some static shareable directories in FHS
/usr
/opt
DEFAULT
what are some static unshareable folders in FHS
/etc
/boot
DEFAULT
what are some variable shareable folders in FHS
/home
/var/mail
DEFAULT
what are some variable unshareable folders in FHS
/var/run
/var/lock
DEFAULT
what directories are recommended to have their own partition
/boot /home /opt /tmp /usr /usr/local /var
DEFAULT
how does grub legacy start a boot entry
title
DEFAULT
how does grub 2 start a boot entry
menuentry
DEFAULT
what is the system logger
syslogd
writes files to
/var/log/messages
/var/log/syslog
DEFAULT
what are the 3 popular initialization process methods used in linux
Unix System V (also called SysV)
Upstart (ubuntu; each service has a configuration file)
systemd (redhat) (this is the winner! everyone important is switching to it)
DEFAULT
describe runlevel 0
shutdown
A transitional runlevel; meaning that it’s used to shift the computer from one state to another. Specifically; it shuts down the system. On modern hardware; the computer should completely power down. If not; you’re expected to either reboot the computer manually or power it off.
DEFAULT
describe runlevel 1
also s or S
Single-user mode. What services; if any; are started at this runlevel vary by distribution. It’s typically used for low-level system maintenance that may be impaired by normal system operation; such as resizing partitions.
DEFAULT
describe runlevel 2
On Debian and its derivatives; a full multi-user mode with X running and a graphical login. Most other distributions leave this runlevel undefined.
DEFAULT
describe runlevel 3
On Fedora; Mandriva; Red Hat; and most other distributions; a full multi-user mode with a console (nongraphical) login screen.
DEFAULT
describe runlevel 4
Usually undefined by default and therefore available for customization.
DEFAULT
describe runlevel 5
On Fedora; Mandriva; Red Hat; and most other distributions; the same behavior as runlevel 3; with the addition of having X run with an XDM (graphical) login.
DEFAULT
describe runlevel 6
Used to reboot the system. This runlevel is also a transitional runlevel. Your system is completely shut down; and then the computer reboots automatically.
DEFAULT
what is a systemd unit
defines a service or action on the system
eg. mount; service; snapshot
DEFAULT
what are the systemd units
automount device mount path service snapshot socket target
COMMANDS
pwd
print the working directory
COMMANDS
echo STRING
display text from stdin
COMMANDS
time COMMAND
times how long COMMAND takes to execute
Three times are displayed: totalexecution time (aka real time); user CPU time; and system CPU time
COMMANDS
set
displays a wide variety of options relating to bash shell operation
These options are formatted much like environment variables; but they aren’t the same things. You can pass various options to set to have it affect a wide range of shell operations.
COMMANDS
exit
terminates any shell
Login shells are shell programs that are launched automatically when you initiate a text-mode login as opposed to those that run in xterm windows or other terminal emulators
COMMANDS
logout
terminates only login shells
Login shells are shell programs that are launched automatically when you initiate a text-mode login as opposed to those that run in xterm windows or other terminal emulators
COMMANDS
type COMMAND
tells you how a command you enter will be interpreted—as a built-in command; an external command; an alias; and so on
COMMANDS
history
displays all of the commands in the history
typically the latest 500 commands
COMMANDS
!!
display and execute the last command in your shell history
COMMANDS
!NUMBER
execute command NUMBER from the history
COMMANDS
$PATH
a directory list to search when you’re entering command or program names
COMMANDS
env
display environment variables
COMMANDS
unset VARNAME
unset an environment variable
COMMANDS
$PS1
the shell prompt
COMMANDS
man COMMAND
display the manual for COMMAND
COMMANDS
info COMMAND
hypertext formatted manual
COMMANDS
help COMMAND
a built in manual for built in commands
COMMANDS
>
Creates a new file containing standard output. If the specified file exists; it’s overwritten. No file descriptor necessary.
COMMANDS
|»_space;
Appends standard output to the existing file. If the specified file doesn’t exist; it’s created. No file descriptor necessary.
COMMANDS
2>
Creates a new file containing standard error. If the specified file exists; it’s overwritten. File descriptor necessary.
COMMANDS
2»
Appends standard error to the existing file. If the specified file doesn’t exist; it’s created. File descriptor necessary.
COMMANDS
&>
Creates a new file containing both standard output and standard error. If the specified file exists; it’s overwritten. No file descriptors necessary.
COMMANDS
Sends the contents of the specified file to be used as standard input. No file descriptor necessary.
COMMANDS
Accepts text on the following lines as standard input. No file descriptor necessary.
COMMANDS
<>
Causes the specified file to be used for both standard input and standard output. No file descriptor necessary.
COMMANDS
COMMAND1 | COMMAND2
link stdout from COMMAND1 to stdin of COMMAND2
COMMANDS
tee
display stdin on stdout and save it to the specified files
COMMANDS
xargs [ options ] [ command [ initial-arguments ]]
run command once for every word passed to it on standard input
find / -user Christine | xargs -d “” \ n”” rm
COMMANDS
COMMAND
a separate command whose results are substituted on the command line
rm ` find . / -user Christine `
COMMANDS
$(COMMAND)
a separate command whose results are substituted on the command line
rm $(find ./ -user Christine)
COMMANDS
cat
concatenate files and print on the standard output
COMMANDS
tac
concatenate files and print on the standard output in reverse line order
COMMANDS
join
For each pair of input lines with identical join fields; write a line to standard output. The default join field is the first; delimited by blanks.
Fields are typically space-separated entries on a line
COMMANDS
paste
Write lines consisting of the sequentially corresponding lines from each FILE; separated by TABs; to standard output
COMMANDS
expand
Convert tabs in each FILE to spaces; writing to standard output.
assumes a tab stop every eight characters
COMMANDS
od
dump files in octal and other formats
COMMANDS
sort
sort lines of text files
COMMANDS
split
Output pieces of FILE to PREFIXaa; PREFIXab; …; default size is 1000 lines; and default PREFIX is ‘x’.
split -l 2 listing1.1.txt numbers
COMMANDS
tr [ options ] SET1 [ SET2 ]
Translate; squeeze; and/or delete characters from standard input; writing to standard output tr BCJ bc < listing1.1.txt B is replaced with b C is replaced with c J is replaced with c
COMMANDS
unexpand
unexpand - convert spaces to tabs
defaults to 8
COMMANDS
uniq
report or omit repeated lines
COMMANDS
fmt
Reformat each paragraph in the FILE(s); writing to standard output.
(default of 75 columns)
COMMANDS
nl
number lines of files (non empty)
the similar to ““cat -b”” by default
COMMANDS
pr
Paginate or columnate FILE(s) for printing
defaults to 80 columns
COMMANDS
head
Print the first 10 lines of each FILE to standard output. With more than one FILE; precede each with a header giving the file name.
COMMANDS
tail
Print the last 10 lines of each FILE to standard output. With more than one FILE; precede each with a header giving the file name.
COMMANDS
less
Less is a program similar to more (1); but it has many more features.
COMMANDS
cut
Print selected parts of lines from each FILE to standard output.
COMMANDS
wc
Print newline; word; and byte counts for each FILE; and a total line if more than one FILE is specified. A word is a non-zero-length sequence of characters delimited by white space.
COMMANDS
grep
searches for PATTERN in each FILE
COMMANDS
sed
stream editor for filtering and transforming text
sed [ options ] -f script-file [ input-file ]
sed [ options ] script-text [ input-file ]
COMMANDS
rpm
RPM Package Manager
COMMANDS
rpm2cpio
converts the .rpm file specified as a single argument to a cpio archive on standard out. If a ‘-‘ argument is given; an rpm stream is read from standard in.
COMMANDS
cpio
copy files to and from archives
find ./my-work | cpio -o > /media/usb/my-work.cpio
cpio -i < /media/usb/my-work.cpio
COMMANDS
yum
a repository based rpm manage
used by: Red Hat; CentOS; Fedora; and some other RPM-based distributions
not usd by: SUSE and Mandriva;
COMMANDS
yumdownloader
yumdownloader is a program for downloading RPMs from Yum repositories
COMMANDS
kyum
a gui frontend for yum
also yumex
COMMANDS
yumex
a gui frontend for yum
also kyum
COMMANDS
dpkg
debian’s equivelant of rpm
COMMANDS
dselect
a high-level interactive package browser. Using it; you can select packages to install on your system from the APT archives defined in /etc/apt/sources.list ; review the packages that are already installed on your system; uninstall packages; and upgrade packages.
COMMANDS
apt-get
debian’s equivelant of yum
COMMANDS
apt-cache
apt-cache performs a variety of operations on APT’s package cache. apt-cache does not manipulate the state of the system but does provide operations to search and generate interesting output from the package metadata. The metadata is acquired and updated via the ‘update’ command of e.g. apt-get; so that it can be outdated if the last update is too long ago; but in exchange apt-cache works independently of the availability of the configured sources (e.g. offline).
COMMANDS
aptitude
a text based debian package manager with an optional interactive mode that is similar to dselect
COMMANDS
synaptic
a X gui program similar to dselect or aptitude
COMMANDS
dpkg-reconfigure
reconfigures packages after they have already been installed. Pass it the names of a package or packages to reconfigure. It will ask configuration questions; much like when the package was first installed.
COMMANDS
alien
converts between Red Hat rpm; Debian deb; Stampede slp; Slackware tgz; Solaris pkg; and tarballs
requires that you have appropriate package manager software installed—for instance; both RPM and Debian—to convert between these formats
When converting from a tarball; alien copies the files directly as they had been in the tarball; so alien works only if the original tarball has files that should be installed off the root ( / ) directory of the system
COMMANDS
$LD_LIBRARY_PATH
This environment variable specifies additional directories the system is to search for libraries
Does not require ldconfig for changes to take effect
COMMANDS
ldd
prints the shared objects (shared libraries) required by each program or shared object specified on the command line.
COMMANDS
ldconfig
usually called without any options
updates caches and links used by the system for locating libraries—that is; it reads /etc/ld.so.conf and implements any changes in that file or in the directories to which it refers
COMMANDS
uname
Print certain system information. With no OPTION; same as -s
node(host) name; kernel name; kernel version; kernel release; machine; processor; hardware platform; os name
COMMANDS
ps
ps displays information about a selection of the active processes.
COMMANDS
top
provides a dynamic real-time view of a running system
COMMANDS
free
displays the total amount of free and used physical and swap memory in the system; as well as the buffers and caches used by the kernel. The information is gathered by parsing /proc/meminfo. T
COMMANDS
uptime
gives a one line display of the following information. The current time; how long the system has been running; how many users are currently logged on; and the system load averages for the past 1; 5; and 15 minutes
the same information displayed in the header of w
COMMANDS
jobs
displays minimal information about the processes associated with the current session
COMMANDS
pgrep
looks through the currently running processes and lists the process IDs which match the selection criteria to stdout.
pgrep -u root cron
COMMANDS
bg
move the specified job to the background, or start the first background process if it is stopped
COMMANDS
fg
bring the specified job to the foreground
COMMANDS
nice
Run COMMAND with an adjusted niceness (defaults to 10); which affects process scheduling. With no COMMAND; print the current niceness.
COMMANDS
renice
renice alters the scheduling priority of one or more running processes.
renice 7 16580 -u pdavison tbaker
COMMANDS
kill
send a signal to a process
The default signal for kill is TERM.
used to stop programs
COMMANDS
nohup
Run COMMAND; ignoring hangup signals
COMMANDS
killall
kill processes by name
killall vi
COMMANDS
pkill
allows you to kill one or more processes based on usernames; user IDs; group IDs; and other features as well as using a matching regular expression
COMMANDS
setpci
a utility for querying and configuring PCI devices.
COMMANDS
lspci
utility for displaying information about PCI buses in the system and devices connected to them
COMMANDS
lsmod
a trivial program which nicely formats the contents of the /proc/modules (kernel modules)
COMMANDS
insmod
a trivial program to insert a module into the kernel. Most users will want to use modprobe(8) instead; which is more clever and can handle module dependencies. e.g. insmod /lib/modules/3.16.6/kernel/drivers/bluetooth/bluetooth.ko
COMMANDS
modprobe
intelligently adds or removes a module from the Linux kernel e.g. modprobe bluetooth
COMMANDS
rmmod
a trivial program to remove a module (when module unloading support is provided) from the kernel. Most users will want to use modprobe(8) with the -r option instead.
COMMANDS
lsusb
a utility for displaying information about USB buses in the system and the devices connected to them
COMMANDS
pvcreate
initialize a disk or partition for use by LVM
COMMANDS
vgcreate
create a volume group (for LVM)
COMMANDS
lvcreate
create a logical volume in an existing volume group (for LVM)
COMMANDS
lvscan
scan (all disks) for Logical Volumes (for LVM)
COMMANDS
fdisk
a dialog-driven program for creation and manipulation of partition tables. It understands GPT; MBR; Sun; SGI and BSD partition tables.
the book says this tool can’t do GPT even though it can
e.g. fdisk /dev/hda
COMMANDS
gdisk
GPT fdisk (aka gdisk) is a text-mode menu-driven program for creation and manipulation of partition tables
COMMANDS
mkfs
build a Linux filesystem
deprecated in favour of filesystem specific mkfs. utils
mkfs -t ext3 /dev/sda6
COMMANDS
mkswap
sets up a Linux swap area on a device or in a file
mkswap /dev/sda7
COMMANDS
swapon
used to specify devices on which paging and swapping are to take place
/dev/sda7
COMMANDS
dumpe2fs
dump ext2/ext3/ext4 filesystem information
prints the super block and blocks group information for the filesystem present on device
COMMANDS
xfs_info
like dumpe2fs but for xfs; displays filesystem info
COMMANDS
xfs_metadump
copies the filesystem’s metadata (filenames; file sizes; and so on) to a file
COMMANDS
tune2fs
enables you to change many of the filesystem parameters that are reported by dumpe2fs
adjust tunable filesystem parameters on ext2/ext3/ext4 filesystems
COMMANDS
fsck
check and repair a Linux filesystem
COMMANDS
xfs_admin
xfs equivelant to tune2fs
xfs_admin -L av_data /dev/sda7
COMMANDS
blkid
display the label and UUID of any partition’s filesystem
COMMANDS
debugfs
provides the abilities of dumpe2fs ; tune2fs ; and many of Linux’s normal file-manipulation tools all rolled into one
an interactive file system debugger. It can be used to examine and change the state of an ext2; ext3; or ext4 file system
e.g. debugfs /dev/sda11
COMMANDS
xfs_db
xfs equivelant to debugfs; only for experts
COMMANDS
df
report file system disk space usage
COMMANDS
du
estimate file space usage
COMMANDS
mount
mount a filesystem
mount /dev/sdb7 /mnt/shared
COMMANDS
umount
unmount file systems
COMMANDS
ls
list directory contents
COMMANDS
cp
make a copy
COMMANDS
mv
move (rename) files
COMMANDS
rm
remove files or directories
COMMANDS
touch
Update the access and modification times of each FILE to the current time
COMMANDS
tar
an archiving utility
COMMANDS
gzip
compress or expand files; oldest least compression
COMMANDS
bzip2
a block-sorting file compressor; improved over gzip
COMMANDS
xz
Compress or decompress .xz and .lzma files newest and best compression compared to gzip and bzip2
COMMANDS
dd
Copy a file; converting and formatting according to the operands.
very low level
COMMANDS
ln
make links between files
ln [options] source link
you can’t make hard links to directories
COMMANDS
mkdir
make directories
COMMANDS
rmdir
remove empty directories
COMMANDS
chown
change file owner and group
chown [ options ] [ newowner ][: newgroup ] filenames
eg. chown sally:skyhook forward.odt
Ordinary users may use chown to change the group of files that they own; provided that the users belong to the target group
COMMANDS
chmod
change file mode bits (permissions)
chmod [ options ] [ mode [; mode… ]] filename…
COMMANDS
umask
sets the bits that will be removed from 777 for directories and 666 for files when a new file/directory is created
COMMANDS
newgrp
set the users default group
newgrp mygroup
COMMANDS
chattr
change file attributes on a Linux file system
COMMANDS
lsattr
display file attributes
COMMANDS
quotaon
turn on disk quotas
COMMANDS
quotaoff
turn off disk quotas
COMMANDS
quotacheck
surveys the filesystem needing quotas and builds current disk usage data records.
e.g. create needed files and check the user quota on home: quotacheck -cu /home
COMMANDS
edquota
open a text editor to edit quotas
COMMANDS
repquota
summarizes the quota information about the filesystem you specify or on all filesystems if you pass it the -a option
COMMANDS
quota
display disk usage and limits
COMMANDS
find
search for files in a directory hierarchy
COMMANDS
locate
reads one or more databases prepared by updatedb(8) and writes file names matching at least one of the PATTERNs
COMMANDS
updatedb
creates or updates a database used by locate(1)
COMMANDS
whereis
searches for files in a restricted set of locations; such as standard binary file directories; library directories; and man page directories.
COMMANDS
which
searches your path for the command that you type and lists the complete path to the first match it finds
COMMANDS
grub-install
installs grub legacy grub-install /dev/sda grub-install '(hd0)' install to bootsector instead of MBR: /dev/sda1 or (hd0;0)
COMMANDS
efibootmgr
manipulate the EFI Boot Manager
efibootmgr -c -l \EFI\redhat\grub.efi -L GRUB
COMMANDS
update-grub
apply changes from /etc/default/grub and /etc/grub.d/ to /boot/grub/grub.cfg or grub-mkconfig some versions output to stdio; if so redirect them to the file /boot/grub/grub.cfg
COMMANDS
dmesg
print or control the kernel ring buffer kernel and module log messages sometimes it's in /var/log/dmesg
COMMANDS
chkconfig
(SysV) updates and queries runlevel information for system services
COMMANDS
runlevel
returns the previous and current runlevel
COMMANDS
init
reread the /etc/inittab file and change runlevels
COMMANDS
telinit
just like init; but telinit [qQ] will re-read the /etc/inittab
COMMANDS
shutdown
shutdown the machine
shutdown -h +15 ““system going down for maintenance””
COMMANDS
halt
halt the machine
COMMANDS
reboot
reboot the machine
COMMANDS
poweroff
poweroff the machine
COMMANDS
systemctl
Control the systemd system and service manager
COMMANDS
journalctl
Query the systemd journal
SWITCHES
type -a
returns all of the places that contain an executable named file
SWITCHES
uname -a
show all information
SWITCHES
history -c
clear the history
SWITCHES
man -k
search man pages for a topic; requires the whatis database to work
man -k ““system information””
SWITCHES
man #
select the section in the man page to open
man 5 passwd
SWITCHES
xargs -d
specify the delimiter
defaults to space
SWITCHES
cat -E
display a “”$”” at the end of each line
–show-ends
SWITCHES
cat -n
adds line numbers to the beginning of every line.
–number
SWITCHES
cat -b
adds line numbers to the beginning of every line that contains text
–number-nonblank
SWITCHES
cat -s
compresses groups of blank lines down to a single blank line
–squeeze-blank
SWITCHES
cat -T
displays tab characters as ““∧I””
–show-tabs
SWITCHES
cat -v
displays most control and other special characters using carat ( ∧ ) and M- notations.
–show-nonprinting
SWITCHES
join -t CHAR
use CHAR as input and output field separator
SWITCHES
join -i
ignore differences in case when comparing fields
–ignore-case
SWITCHES
expand -t NUMBER
have tabs NUMBER characters apart; not 8
–tabs=NUMBER
SWITCHES
sort -f
ignore case
–ignore-case; (fold)
SWITCHES
sort -M
sort by three-letter month abbreviation ( JAN through DEC )
–month-sort
SWITCHES
sort -n
compare according to string numerical value
–numeric-sort
SWITCHES
sort -r
reverse the result of comparisons
–reverse
SWITCHES
sort -k KEYDEF
sort via a key; KEYDEF gives location and type
–key=KEYDEF
(KEYDEF can be two numbered fields separated by commas; to sort on multiple fields.)
E.G. sort -k 3 listing1.1.txt
SWITCHES
split -b NUMBER
put NUMBER bytes per output file
–bytes=NUMBER
SWITCHES
split -C NUMBER
put at most NUMBER bytes of records per output file
–line-bytes=NUMBER
SWITCHES
split -l NUMBER
put NUMBER lines/records per output file
–lines=NUMBER
SWITCHES
tr -t
first truncate SET1 to length of SET2
–truncate-set1
SWITCHES
tr -d
delete characters in SET1; do not translate
–delete
SWITCHES
unexpand -t LIST
use comma separated LIST of tab positions (enables -a)
–tabs=LIST
SWITCHES
fmt -w NUMBER
maximum line width (default of 75 columns)
–width=NUMBER
SWITCHES
nl -b STYLE
use STYLE for numbering body lines
–body-numbering=STYLE
STYLE is:
t (The default behavior is to number lines that aren’t empty. You can make this default explicit by using a style code of t .)
a (This style code causes all lines to be numbered; including empty lines.)
n (This style code causes all line numbers to be omitted; which may be desirable for headers or footers.)
pREGEXP (This option causes only lines that match the specified regular expression ( REGEXP ) to be numbered.)
SWITCHES
nl -h STYLE
use STYLE for numbering header lines
–header-numbering=STYLE
STYLE is: t (The default behavior is to number lines that aren’t empty. You can make this default explicit by using a style code of t .) a (This style code causes all lines to be numbered; including empty lines.) n (This style code causes all line numbers to be omitted; which may be desirable for headers or footers.)
pREGEXP (This option causes only lines that match the specified regular expression ( REGEXP ) to be numbered.)
SWITCHES
nl -f STYLE
use STYLE for numbering footer lines
–footer-numbering=STYLE
STYLE is: t (The default behavior is to number lines that aren’t empty. You can make this default explicit by using a style code of t .) a (This style code causes all lines to be numbered; including empty lines.) n (This style code causes all line numbers to be omitted; which may be desirable for headers or footers.)
pREGEXP (This option causes only lines that match the specified regular expression ( REGEXP ) to be numbered.)
SWITCHES
nl -d CC
use CC for logical page delimiters
–section-delimiter=CC
SWITCHES
nl -n FORMAT
insert line numbers according to FORMAT --number-format=FORMAT format is: ln (left justified; no leading zeros); rn (right justified; no leading zeros); rz (right justified with leading zeros).
SWITCHES
pr -NUMBER
output COLUMN columns and print columns down; unless -a is used
–columns=NUMBER
default is 80
SWITCHES
pr -d
double space the output
–double-space