Commands Flashcards

1
Q

pwd

A

print the working directory

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

echo STRING

A

display text from stdin

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

time COMMAND

A

times how long COMMAND takes to execute

Three times are displayed: totalexecution time (aka real time); user CPU time; and system CPU time

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

set

A

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.

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

exit

A

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

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

logout

A

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

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

type COMMAND

A

tells you how a command you enter will be interpreted—as a built-in command; an external command; an alias; and so on

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

history

A

displays all of the commands in the history

typically the latest 500 commands

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

!!

A

display and execute the last command in your shell history

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

!NUMBER

A

execute command NUMBER from the history

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

$PATH

A

a directory list to search when you’re entering command or program names

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

env

A

display environment variables

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

unset VARNAME

A

unset an environment variable

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

$PS1

A

the shell prompt

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

man COMMAND

A

display the manual for COMMAND

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

info COMMAND

A

hypertext formatted manual

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

help COMMAND

A

a built in manual for built in commands

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

>

A

Creates a new file containing standard output. If the specified file exists; it’s overwritten. No file descriptor necessary.

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

> >

A

Appends standard output to the existing file. If the specified file doesn’t exist; it’s created. No file descriptor necessary.

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

2>

A

Creates a new file containing standard error. If the specified file exists; it’s overwritten. File descriptor necessary.

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

A

Appends standard error to the existing file. If the specified file doesn’t exist; it’s created. File descriptor necessary.

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

&>

A

Creates a new file containing both standard output and standard error. If the specified file exists; it’s overwritten. No file descriptors necessary.

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

Sends the contents of the specified file to be used as standard input. No file descriptor necessary.

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

<

A

Accepts text on the following lines as standard input. No file descriptor necessary.

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

<>

A

Causes the specified file to be used for both standard input and standard output. No file descriptor necessary.

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

COMMAND1 | COMMAND2

A

link stdout from COMMAND1 to stdin of COMMAND2

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

tee

A

display stdin on stdout and save it to the specified files

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

xargs [ options ] [ command [ initial-arguments ]]

A

run command once for every word passed to it on standard input
find / -user Christine | xargs -d “” \ n”” rm

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

COMMAND

A

a separate command whose results are substituted on the command line
rm ` find . / -user Christine `

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

$(COMMAND)

A

a separate command whose results are substituted on the command line
rm $(find ./ -user Christine)

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

cat

A

concatenate files and print on the standard output

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

tac

A

concatenate files and print on the standard output in reverse line order

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

join

A

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

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

paste

A

Write lines consisting of the sequentially corresponding lines from each FILE; separated by TABs; to standard output

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

expand

A

Convert tabs in each FILE to spaces; writing to standard output.
assumes a tab stop every eight characters

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

od

A

dump files in octal and other formats

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

sort

A

sort lines of text files

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

split

A

Output pieces of FILE to PREFIXaa; PREFIXab; …; default size is 1000 lines; and default PREFIX is ‘x’.
split -l 2 listing1.1.txt numbers

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

tr [ options ] SET1 [ SET2 ]

A
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
40
Q

unexpand

A

unexpand - convert spaces to tabs

defaults to 8

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

uniq

A

report or omit repeated lines

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

fmt

A

Reformat each paragraph in the FILE(s); writing to standard output.
(default of 75 columns)

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

nl

A

number lines of files (non empty)

the similar to ““cat -b”” by default

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

pr

A

Paginate or columnate FILE(s) for printing

defaults to 80 columns

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

head

A

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.

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

tail

A

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.

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

less

A

Less is a program similar to more (1); but it has many more features.

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

cut

A

Print selected parts of lines from each FILE to standard output.

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

wc

A

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.

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

grep

A

searches for PATTERN in each FILE

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

sed

A

stream editor for filtering and transforming text
sed [ options ] -f script-file [ input-file ]
sed [ options ] script-text [ input-file ]

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

rpm

A

RPM Package Manager

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

rpm2cpio

A

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.

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

cpio

A

copy files to and from archives
find ./my-work | cpio -o > /media/usb/my-work.cpio
cpio -i < /media/usb/my-work.cpio

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

yum

A

a repository based rpm manage
used by: Red Hat; CentOS; Fedora; and some other RPM-based distributions
not usd by: SUSE and Mandriva;

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

yumdownloader

A

yumdownloader is a program for downloading RPMs from Yum repositories

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

kyum

A

a gui frontend for yum

also yumex

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

yumex

A

a gui frontend for yum

also kyum

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

dpkg

A

debian’s equivelant of rpm

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

dselect

A

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.

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

apt-get

A

debian’s equivelant of yum

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

apt-cache

A

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).

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

aptitude

A

a text based debian package manager with an optional interactive mode that is similar to dselect

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

synaptic

A

a X gui program similar to dselect or aptitude

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

dpkg-reconfigure

A

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.

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

alien

A

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

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

$LD_LIBRARY_PATH

A

This environment variable specifies additional directories the system is to search for libraries
Does not require ldconfig for changes to take effect

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

ldd

A

prints the shared objects (shared libraries) required by each program or shared object specified on the command line.

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

ldconfig

A

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

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

uname

A

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

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

ps

A

ps displays information about a selection of the active processes.

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

top

A

provides a dynamic real-time view of a running system

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

free

A

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

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

uptime

A

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

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

jobs

A

displays minimal information about the processes associated with the current session

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

pgrep

A

looks through the currently running processes and lists the process IDs which match the selection criteria to stdout.
pgrep -u root cron

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

bg

A

move the specified job to the background, or start the first background process if it is stopped

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

fg

A

bring the specified job to the foreground

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

nice

A

Run COMMAND with an adjusted niceness (defaults to 10); which affects process scheduling. With no COMMAND; print the current niceness.

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

renice

A

renice alters the scheduling priority of one or more running processes.
renice 7 16580 -u pdavison tbaker

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

kill

A

send a signal to a process
The default signal for kill is TERM.
used to stop programs

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

nohup

A

Run COMMAND; ignoring hangup signals

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

killall

A

kill processes by name

killall vi

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

pkill

A

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

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

setpci

A

a utility for querying and configuring PCI devices.

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

lspci

A

utility for displaying information about PCI buses in the system and devices connected to them

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

lsmod

A

a trivial program which nicely formats the contents of the /proc/modules (kernel modules)

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

insmod

A
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
89
Q

modprobe

A
intelligently adds or removes a module from the Linux kernel
e.g. modprobe bluetooth
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
90
Q

rmmod

A

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.

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

lsusb

A

a utility for displaying information about USB buses in the system and the devices connected to them

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

pvcreate

A

initialize a disk or partition for use by LVM

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

vgcreate

A

create a volume group (for LVM)

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

lvcreate

A

create a logical volume in an existing volume group (for LVM)

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

lvscan

A

scan (all disks) for Logical Volumes (for LVM)

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

fdisk

A

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

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

gdisk

A

GPT fdisk (aka gdisk) is a text-mode menu-driven program for creation and manipulation of partition tables

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

mkfs

A

build a Linux filesystem
deprecated in favour of filesystem specific mkfs. utils
mkfs -t ext3 /dev/sda6

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

mkswap

A

sets up a Linux swap area on a device or in a file

mkswap /dev/sda7

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

swapon

A

used to specify devices on which paging and swapping are to take place
/dev/sda7

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

dumpe2fs

A

dump ext2/ext3/ext4 filesystem information

prints the super block and blocks group information for the filesystem present on device

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

xfs_info

A

like dumpe2fs but for xfs; displays filesystem info

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

xfs_metadump

A

copies the filesystem’s metadata (filenames; file sizes; and so on) to a file

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

tune2fs

A

enables you to change many of the filesystem parameters that are reported by dumpe2fs
adjust tunable filesystem parameters on ext2/ext3/ext4 filesystems

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

fsck

A

check and repair a Linux filesystem

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

xfs_admin

A

xfs equivelant to tune2fs

xfs_admin -L av_data /dev/sda7

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

blkid

A

display the label and UUID of any partition’s filesystem

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

debugfs

A

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

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

xfs_db

A

xfs equivelant to debugfs; only for experts

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

df

A

report file system disk space usage

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

du

A

estimate file space usage

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

mount

A

mount a filesystem

mount /dev/sdb7 /mnt/shared

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

umount

A

unmount file systems

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

ls

A

list directory contents

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

cp

A

make a copy

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

mv

A

move (rename) files

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

rm

A

remove files or directories

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

touch

A

Update the access and modification times of each FILE to the current time

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

tar

A

an archiving utility

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

gzip

A

compress or expand files; oldest least compression

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

bzip2

A

a block-sorting file compressor; improved over gzip

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

xz

A

Compress or decompress .xz and .lzma files newest and best compression compared to gzip and bzip2

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

dd

A

Copy a file; converting and formatting according to the operands.
very low level

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

ln

A

make links between files
ln [options] source link
you can’t make hard links to directories

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

mkdir

A

make directories

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

rmdir

A

remove empty directories

127
Q

chown

A

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

128
Q

chmod

A

change file mode bits (permissions)

chmod [ options ] [ mode [; mode… ]] filename…

129
Q

umask

A

sets the bits that will be removed from 777 for directories and 666 for files when a new file/directory is created

130
Q

newgrp

A

set the users default group

newgrp mygroup

131
Q

chattr

A

change file attributes on a Linux file system

132
Q

lsattr

A

display file attributes

133
Q

quotaon

A

turn on disk quotas

134
Q

quotaoff

A

turn off disk quotas

135
Q

quotacheck

A

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

136
Q

edquota

A

open a text editor to edit quotas

137
Q

repquota

A

summarizes the quota information about the filesystem you specify or on all filesystems if you pass it the -a option

138
Q

quota

A

display disk usage and limits

139
Q

find

A

search for files in a directory hierarchy

140
Q

locate

A

reads one or more databases prepared by updatedb(8) and writes file names matching at least one of the PATTERNs

141
Q

updatedb

A

creates or updates a database used by locate(1)

142
Q

whereis

A

searches for files in a restricted set of locations; such as standard binary file directories; library directories; and man page directories.

143
Q

which

A

searches your path for the command that you type and lists the complete path to the first match it finds

144
Q

grub-install

A
installs grub legacy
grub-install /dev/sda
grub-install '(hd0)'
install to bootsector instead of MBR: 
/dev/sda1 or (hd0;0)
145
Q

efibootmgr

A

manipulate the EFI Boot Manager

efibootmgr -c -l \EFI\redhat\grub.efi -L GRUB

146
Q

update-grub

A
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
147
Q

dmesg

A
print or control the kernel ring buffer
kernel and module log messages
sometimes it's in /var/log/dmesg
148
Q

chkconfig

A

(SysV) updates and queries runlevel information for system services

149
Q

runlevel

A

returns the previous and current runlevel

150
Q

init

A

reread the /etc/inittab file and change runlevels

151
Q

telinit

A

just like init; but telinit [qQ] will re-read the /etc/inittab

152
Q

shutdown

A

shutdown the machine

shutdown -h +15 ““system going down for maintenance””

153
Q

halt

A

halt the machine

154
Q

reboot

A

reboot the machine

155
Q

poweroff

A

poweroff the machine

156
Q

systemctl

A

Control the systemd system and service manager

157
Q

journalctl

A

Query the systemd journal

158
Q

pwd

A

print the working directory

159
Q

echo STRING

A

display text from stdin

160
Q

time COMMAND

A

times how long COMMAND takes to execute

Three times are displayed: totalexecution time (aka real time); user CPU time; and system CPU time

161
Q

set

A

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.

162
Q

exit

A

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

163
Q

logout

A

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

164
Q

type COMMAND

A

tells you how a command you enter will be interpreted—as a built-in command; an external command; an alias; and so on

165
Q

history

A

displays all of the commands in the history

typically the latest 500 commands

166
Q

!!

A

display and execute the last command in your shell history

167
Q

!NUMBER

A

execute command NUMBER from the history

168
Q

$PATH

A

a directory list to search when you’re entering command or program names

169
Q

env

A

display environment variables

170
Q

unset VARNAME

A

unset an environment variable

171
Q

$PS1

A

the shell prompt

172
Q

man COMMAND

A

display the manual for COMMAND

173
Q

info COMMAND

A

hypertext formatted manual

174
Q

help COMMAND

A

a built in manual for built in commands

175
Q

>

A

Creates a new file containing standard output. If the specified file exists; it’s overwritten. No file descriptor necessary.

176
Q

> >

A

Appends standard output to the existing file. If the specified file doesn’t exist; it’s created. No file descriptor necessary.

177
Q

2>

A

Creates a new file containing standard error. If the specified file exists; it’s overwritten. File descriptor necessary.

178
Q

A

Appends standard error to the existing file. If the specified file doesn’t exist; it’s created. File descriptor necessary.

179
Q

&>

A

Creates a new file containing both standard output and standard error. If the specified file exists; it’s overwritten. No file descriptors necessary.

180
Q
A

Sends the contents of the specified file to be used as standard input. No file descriptor necessary.

181
Q

<

A

Accepts text on the following lines as standard input. No file descriptor necessary.

182
Q

<>

A

Causes the specified file to be used for both standard input and standard output. No file descriptor necessary.

183
Q

COMMAND1 | COMMAND2

A

link stdout from COMMAND1 to stdin of COMMAND2

184
Q

tee

A

display stdin on stdout and save it to the specified files

185
Q

xargs [ options ] [ command [ initial-arguments ]]

A

run command once for every word passed to it on standard input
find / -user Christine | xargs -d “” \ n”” rm

186
Q

COMMAND

A

a separate command whose results are substituted on the command line
rm ` find . / -user Christine `

187
Q

$(COMMAND)

A

a separate command whose results are substituted on the command line
rm $(find ./ -user Christine)

188
Q

cat

A

concatenate files and print on the standard output

189
Q

tac

A

concatenate files and print on the standard output in reverse line order

190
Q

join

A

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

191
Q

paste

A

Write lines consisting of the sequentially corresponding lines from each FILE; separated by TABs; to standard output

192
Q

expand

A

Convert tabs in each FILE to spaces; writing to standard output.
assumes a tab stop every eight characters

193
Q

od

A

dump files in octal and other formats

194
Q

sort

A

sort lines of text files

195
Q

split

A

Output pieces of FILE to PREFIXaa; PREFIXab; …; default size is 1000 lines; and default PREFIX is ‘x’.
split -l 2 listing1.1.txt numbers

196
Q

tr [ options ] SET1 [ SET2 ]

A
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
197
Q

unexpand

A

unexpand - convert spaces to tabs

defaults to 8

198
Q

uniq

A

report or omit repeated lines

199
Q

fmt

A

Reformat each paragraph in the FILE(s); writing to standard output.
(default of 75 columns)

200
Q

nl

A

number lines of files (non empty)

the similar to ““cat -b”” by default

201
Q

pr

A

Paginate or columnate FILE(s) for printing

defaults to 80 columns

202
Q

head

A

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.

203
Q

tail

A

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.

204
Q

less

A

Less is a program similar to more (1); but it has many more features.

205
Q

cut

A

Print selected parts of lines from each FILE to standard output.

206
Q

wc

A

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.

207
Q

grep

A

searches for PATTERN in each FILE

208
Q

sed

A

stream editor for filtering and transforming text
sed [ options ] -f script-file [ input-file ]
sed [ options ] script-text [ input-file ]

209
Q

rpm

A

RPM Package Manager

210
Q

rpm2cpio

A

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.

211
Q

cpio

A

copy files to and from archives
find ./my-work | cpio -o > /media/usb/my-work.cpio
cpio -i < /media/usb/my-work.cpio

212
Q

yum

A

a repository based rpm manage
used by: Red Hat; CentOS; Fedora; and some other RPM-based distributions
not usd by: SUSE and Mandriva;

213
Q

yumdownloader

A

yumdownloader is a program for downloading RPMs from Yum repositories

214
Q

kyum

A

a gui frontend for yum

also yumex

215
Q

yumex

A

a gui frontend for yum

also kyum

216
Q

dpkg

A

debian’s equivelant of rpm

217
Q

dselect

A

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.

218
Q

apt-get

A

debian’s equivelant of yum

219
Q

apt-cache

A

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).

220
Q

aptitude

A

a text based debian package manager with an optional interactive mode that is similar to dselect

221
Q

synaptic

A

a X gui program similar to dselect or aptitude

222
Q

dpkg-reconfigure

A

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.

223
Q

alien

A

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

224
Q

$LD_LIBRARY_PATH

A

This environment variable specifies additional directories the system is to search for libraries
Does not require ldconfig for changes to take effect

225
Q

ldd

A

prints the shared objects (shared libraries) required by each program or shared object specified on the command line.

226
Q

ldconfig

A

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

227
Q

uname

A

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

228
Q

ps

A

ps displays information about a selection of the active processes.

229
Q

top

A

provides a dynamic real-time view of a running system

230
Q

free

A

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

231
Q

uptime

A

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

232
Q

jobs

A

displays minimal information about the processes associated with the current session

233
Q

pgrep

A

looks through the currently running processes and lists the process IDs which match the selection criteria to stdout.
pgrep -u root cron

234
Q

bg

A

move the specified job to the background, or start the first background process if it is stopped

235
Q

fg

A

bring the specified job to the foreground

236
Q

nice

A

Run COMMAND with an adjusted niceness (defaults to 10); which affects process scheduling. With no COMMAND; print the current niceness.

237
Q

renice

A

renice alters the scheduling priority of one or more running processes.
renice 7 16580 -u pdavison tbaker

238
Q

kill

A

send a signal to a process
The default signal for kill is TERM.
used to stop programs

239
Q

nohup

A

Run COMMAND; ignoring hangup signals

240
Q

killall

A

kill processes by name

killall vi

241
Q

pkill

A

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

242
Q

setpci

A

a utility for querying and configuring PCI devices.

243
Q

lspci

A

utility for displaying information about PCI buses in the system and devices connected to them

244
Q

lsmod

A

a trivial program which nicely formats the contents of the /proc/modules (kernel modules)

245
Q

insmod

A
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
246
Q

modprobe

A
intelligently adds or removes a module from the Linux kernel
e.g. modprobe bluetooth
247
Q

rmmod

A

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.

248
Q

lsusb

A

a utility for displaying information about USB buses in the system and the devices connected to them

249
Q

pvcreate

A

initialize a disk or partition for use by LVM

250
Q

vgcreate

A

create a volume group (for LVM)

251
Q

lvcreate

A

create a logical volume in an existing volume group (for LVM)

252
Q

lvscan

A

scan (all disks) for Logical Volumes (for LVM)

253
Q

fdisk

A

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

254
Q

gdisk

A

GPT fdisk (aka gdisk) is a text-mode menu-driven program for creation and manipulation of partition tables

255
Q

mkfs

A

build a Linux filesystem
deprecated in favour of filesystem specific mkfs. utils
mkfs -t ext3 /dev/sda6

256
Q

mkswap

A

sets up a Linux swap area on a device or in a file

mkswap /dev/sda7

257
Q

swapon

A

used to specify devices on which paging and swapping are to take place
/dev/sda7

258
Q

dumpe2fs

A

dump ext2/ext3/ext4 filesystem information

prints the super block and blocks group information for the filesystem present on device

259
Q

xfs_info

A

like dumpe2fs but for xfs; displays filesystem info

260
Q

xfs_metadump

A

copies the filesystem’s metadata (filenames; file sizes; and so on) to a file

261
Q

tune2fs

A

enables you to change many of the filesystem parameters that are reported by dumpe2fs
adjust tunable filesystem parameters on ext2/ext3/ext4 filesystems

262
Q

fsck

A

check and repair a Linux filesystem

263
Q

xfs_admin

A

xfs equivelant to tune2fs

xfs_admin -L av_data /dev/sda7

264
Q

blkid

A

display the label and UUID of any partition’s filesystem

265
Q

debugfs

A

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

266
Q

xfs_db

A

xfs equivelant to debugfs; only for experts

267
Q

df

A

report file system disk space usage

268
Q

du

A

estimate file space usage

269
Q

mount

A

mount a filesystem

mount /dev/sdb7 /mnt/shared

270
Q

umount

A

unmount file systems

271
Q

ls

A

list directory contents

272
Q

cp

A

make a copy

273
Q

mv

A

move (rename) files

274
Q

rm

A

remove files or directories

275
Q

touch

A

Update the access and modification times of each FILE to the current time

276
Q

tar

A

an archiving utility

277
Q

gzip

A

compress or expand files; oldest least compression

278
Q

bzip2

A

a block-sorting file compressor; improved over gzip

279
Q

xz

A

Compress or decompress .xz and .lzma files newest and best compression compared to gzip and bzip2

280
Q

dd

A

Copy a file; converting and formatting according to the operands.
very low level

281
Q

ln

A

make links between files
ln [options] source link
you can’t make hard links to directories

282
Q

mkdir

A

make directories

283
Q

rmdir

A

remove empty directories

284
Q

chown

A

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

285
Q

chmod

A

change file mode bits (permissions)

chmod [ options ] [ mode [; mode… ]] filename…

286
Q

umask

A

sets the bits that will be removed from 777 for directories and 666 for files when a new file/directory is created

287
Q

newgrp

A

set the users default group

newgrp mygroup

288
Q

chattr

A

change file attributes on a Linux file system

289
Q

lsattr

A

display file attributes

290
Q

quotaon

A

turn on disk quotas

291
Q

quotaoff

A

turn off disk quotas

292
Q

quotacheck

A

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

293
Q

edquota

A

open a text editor to edit quotas

294
Q

repquota

A

summarizes the quota information about the filesystem you specify or on all filesystems if you pass it the -a option

295
Q

quota

A

display disk usage and limits

296
Q

find

A

search for files in a directory hierarchy

297
Q

locate

A

reads one or more databases prepared by updatedb(8) and writes file names matching at least one of the PATTERNs

298
Q

updatedb

A

creates or updates a database used by locate(1)

299
Q

whereis

A

searches for files in a restricted set of locations; such as standard binary file directories; library directories; and man page directories.

300
Q

which

A

searches your path for the command that you type and lists the complete path to the first match it finds

301
Q

grub-install

A
installs grub legacy
grub-install /dev/sda
grub-install '(hd0)'
install to bootsector instead of MBR: 
/dev/sda1 or (hd0;0)
302
Q

efibootmgr

A

manipulate the EFI Boot Manager

efibootmgr -c -l \EFI\redhat\grub.efi -L GRUB

303
Q

update-grub

A
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
304
Q

dmesg

A
print or control the kernel ring buffer
kernel and module log messages
sometimes it's in /var/log/dmesg
305
Q

chkconfig

A

(SysV) updates and queries runlevel information for system services

306
Q

runlevel

A

returns the previous and current runlevel

307
Q

init

A

reread the /etc/inittab file and change runlevels

308
Q

telinit

A

just like init; but telinit [qQ] will re-read the /etc/inittab

309
Q

shutdown

A

shutdown the machine

shutdown -h +15 ““system going down for maintenance””

310
Q

halt

A

halt the machine

311
Q

reboot

A

reboot the machine

312
Q

poweroff

A

poweroff the machine

313
Q

systemctl

A

Control the systemd system and service manager

314
Q

journalctl

A

Query the systemd journal